Pushing data to Bytebeam
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.
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.
You can now write to uplink from your application. Below you can see samples for some popular languages.
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.