Consuming real-time sensor data in a web application
In this section, we will learn how to visualize sensor data in real time. The scenario is to perform sensing from an IoT device and then send sensor data to the client app. This concept is similar to the publisher/subscriber application. This scenario is depicted in the following figure:
To implement how to visualize sensor data in real time, we will develop a web application that utilizes HTML5 and JavaScript. Once the sensing process is done, the sensor data will be sent to the web client application. The data pushing engine can apply the Socket.IO library to address data transferring in real time.
Socket.IO provides a JavaScript/Node.js that implements WebSocket to push data from the backend to the frontend. This library can serve request sensor data and push the data. You can get more information about Socket.IO at https://socket.io/.
In this section, we will develop a web application using Node.js and apply Express for the web framework...