Pushing data to Bytebeam
Learn how to push temperature data from your device to the Bytebeam cloud with step-by-step instructions in this document. It includes Python and JavaScript scripts, diagrams, and screenshots along with examples. The code provided consists of a combinatio
This section talks about how to push the data from the device to the cloud. Data is pushed to the cloud in Streams.
To push data you need to write an application that connects to uplink over TCP and pushes data to it. Uplink then in turn pushes the data to the cloud over MQTT.
As an example, this guide assumes you are pushing temperature data to Bytebeam.
Create a stream on the cloud
First, let us create a stream called temperature
on the Bytebeam cloud. First, go to Bytebeam Cloud. Now, click on your username in the top right corner and navigate to the “Settings” section.
Next, select Streams and Click on “Create Stream”.
Now, enter the stream name and column name. In this example, we have chosen the data type of temperature as Float64. Click on the “Submit” button.
The temperature stream should be visible under the “Streams” section.
Configuration on the device side
You can now write to uplink from your application. Below you can see samples for some popular languages.
:::codeblocktabs
:::
If you do not see your favorite language do not worry. You can write to uplink in 2 easy steps:
- Create a TCP socket and connect to
localhost
and port 5050 - Periodically write data in the below JSON format to the port (NOTE: newline delimited)
In the above JSON you need to auto-increment the sequence
for each packet and the timestamp needs to be in milliseconds
The temperature data should now be visible on the cloud. Head over to Bytebeam Cloud and go to Device Management -> Device tab. Now click on the device and Select “Show Streams”.
Select “temperature” stream.
The temperature data should be visible on the cloud now.