How we built up Azure with a connection to an ESP8266
For our university project, we utilized Azure to establish a connection between an ESP8266 device and an MQTT broker. The connection was made possible by using Azure IoT Hub as the central hub for data communication between the device and the cloud.
We first set up a Message Routing in the IoT Hub to route the incoming data from the device to a Stream Analytics Job. The Stream Analytics Job was used to process the incoming data from the ESP8266 and pass it on to a SQL Database. This database was hosted on a SQL Server from Azure and was used to store the data from our pulse sensor.
To establish the connection on the ESP8266, we used the Azure IoT SDK for Embedded C. The SDK provided a set of libraries and tools for connecting to Azure IoT Hub and communicating with the cloud. We wrote a code for the ESP8266 that connected to the IoT Hub using the MQTT protocol and sent data from the pulse sensor to the cloud.
In addition to sending data to the cloud, we also used cloud to device messages in Azure to control the vibration motor on the ESP8266. This was done by sending messages from the cloud to the device, which were processed by the firmware and used to control the motor. The implementation of this feature allowed us to remotely control the motor from the cloud, making it possible to monitor and control the device remotely.
In conclusion, our university project demonstrated the use of Azure to establish a connection between an ESP8266 device and an MQTT broker. The use of Azure IoT Hub, Message Routing, Stream Analytics Job, and SQL Database, along with the Azure IoT SDK for Embedded C, allowed us to send data from the pulse sensor to the cloud and control the vibration motor using cloud to device messages.