Blecon Brings Cloud Connectivity to Nordic’s New nRF54L Series SoCs
London, UK –November 11, 2024 – Blecon, a leader in Bluetooth Low Energy (LE) for IoT Connectivity, today released its support for Nordic...
Blecon is enabling a new class of physical data sources and sensors based on Bluetooth that allows developers and application builders to quickly integrate real-world data into their products and applications.
Sensors and other data sources that use Blecon can use nearby phones or gateways as hotspots, require zero configuration or coding to use, and deliver data as WebHooks; enabling them to work with any cloud, any web framework, and any language.
In this article, I will show you an example of how you can use Blecon and AWS to create a real-world streaming data ingestion pipeline in a few minutes, using Amazon Kinesis. Amazon Kinesis is a hyper-scale message broker service by AWS, which allows you to process and react to incoming data in real-time as well as route it to multiple consumers.
Once you have created a stream of events in Kinesis, it can be consumed by multiple consumers. In this example, I will show how to route it to an Amazon Redshift cluster. Amazon Redshift is a petabyte-scale SQL database typically used for data warehouse applications.
This architecture is suitable for an environment where you have many hundreds or thousands of Blecon sensors all regularly reporting real-world conditions.
This tutorial assumes intermediate-level knowledge of AWS.
Let’s have a look at what we’ll build.
Because Blecon presents Bluetooth sensor readings as HTTP requests, we can use a Lambda function with Function URL to ingest data to the Kinesis stream. Once the data is in the stream we use a delivery stream to write it to Redshift.
After we have created a stream of sensor readings in Amazon Kinesis, you can then analyze and consume this stream in multiple ways.
Let’s start with creating our Kinesis data stream. Kinesis is a big data streaming service designed for processing large-scale data streams. We're going to push sensor data into this stream.
To start, you’ll need an AWS account. If you’ve never used AWS before, this AWS getting started tutorial may be useful.
Note: I have used the us-east-1 region in my examples.
The ingestion lambda function will receive HTTP requests from your Blecon network, and insert sensor events onto your Kinesis stream, where they can be consumed later.
import json, boto3
|
Note: Make sure STREAM_NAME matches what you chose earlier.
What does this do? It extracts the sensor events from the Blecon request and puts a subset of them onto the Kinesis stream. Specifically, it un-batches the events and sends a simplified event to the stream containing only the sensor value, the device ID, and the timestamp.
Your application will vary but keep in mind that Blecon devices batch sensor readings, so you will usually want to un-batch them for further processing.
Your Lambda function needs permission to post onto the Kinesis stream you created.
Once your Redshift cluster has been created, we need to create a table to store your data.
device_id type varchar
sensor_value type integer
timestamp type varchar
A Kinesis Delivery Stream batches up records and saves them to a location such as S3 or Redshift.
We need to use this to write our data to Redshift.
As Source, choose Amazon Kinesis Data Streams
As Destination, choose Amazon Redshift
We need to ensure that public access is enabled, as Kinesis operates outside of your VPC.
As a final step we need to allow IP access to your Redshift cluster from the Kinesis IP range.
SELECT * FROM “sensors”;as below, from the “dev” database.
You should start to see a list of sensor values appearing in your data warehouse.
In this tutorial, I’ve shown you one way to connect Blecon-enabled Bluetooth devices to a data warehouse.
This architecture is scalable to thousands of sensor readings per second and petabytes of storage. Applications of this pattern include
This is just one example; Blecon enables low-cost generic sensors or custom hardware to integrate with any cloud-native system efficiently and securely. See https://blecon.net for more.
London, UK –November 11, 2024 – Blecon, a leader in Bluetooth Low Energy (LE) for IoT Connectivity, today released its support for Nordic...
Blecon Shows Bluetooth Means Business