Paxcounter and TTN
In the last post, I explained the bootstrapping and use cases of Paxcounter device based on ESP32 microcontroller and Sx1276 LoRa chip. I also demonstrated the integration of the Paxcounter with The Things Network (TTN). We were also able to receive data from the Paxcounter and send commands back to it on TTN console. Although the console provides basic functionality, an industrial use case requires a sophisticate solution. It is desired from a portal to have a functionality of visualizing data with graphs, generating insights from it, making intelligent decisions and sending notifications to concerned person. In this post, I am going to introduce a new portal and its integration procedure with TTN.
The Things Network facilitates HTTP integration for uplink and downlink data. Using this feature one could send data from TTN console to an HTTP end point and receive & forward data from end point to LoRa node.
To your surprise it takes only couple of minutes to setup whole thing on TTN console. Go to your application on the TTN console, click on Integration and select HTTP Integration among giving options. In the next screen fill in unique name for Process ID, default access key, end point URL and finally HTTP request methods e.g. GET, POST. It also has options to add Authorization and one custom header, however there are not mandatory. To test the integration one could create an end-point on the Request Bin for free and receive the data.
Every message received by TTN console from a LoRa node is posted to HTTP end point after successful integration. The format of the data posted is following.
As mentioned earlier TTN can be used to schedule downlink messages also. For developer’s convenience a downlink URL is provided in every uplink message sent over HTTP. The same is depicted in the image above.
We developed a online portal for an industrial use case for EVM. The portal collects data from multiple sensor registered on TTN. The dashboard displays current, average, maximum and minimum values for a sensor. On the portal a registered user can visualize the data using interactive graphs. One line graph is utilized to show data from last 24 hours and a heat map graph displays weekly data. At the moment, we have integrated 2 sensors, Paxounter and Temperature/Humidity. In future, we are going to integrate Air quality, Water quality, Door and noise sensors also.
The Things Network facilitates HTTP integration for the applications registered on the portal. The feature is extremely useful to play around with data generated by LoRa devices. We have also been working with Siemens MindSprere and soon I will write blog about that also. Until then register your IoT application on TTN console and send data cloud application over HTTP.