The platform demonstrates a Nucleo board with Azure IoT Services integration use case. The major platform components are:
- STM32 Nucleo-64 board with WiFi and sensors expansions. The board is a "thing" for the AWS IoT service. It updates its shadow with the sensors data every second.
- Azure-powered back-end receives the data, stores it in a DB and provides an API for the data retrieval.
- Web dashboard uses the API to fetch and visualize the data
- Android app is another front-end. It fetches and displays the sensors data as well.
Here is the overall platform scheme:
The board is registered as a "thing" in Azure IoT Hub. It connects via MQTT to IoT Hub and sends sensors data every second.
Additionally the board sends a special marker message on user button press. These markers are then visualized on the charts.
Please see the board software source code for implementation, configuration details and build instructions.
The back-end is entirely powered by Microsoft Azure Cloud. The following services are used:
- Azure IoT Hub is used to communicate with the Nucleo board as well as process data coming from the device.
- Azure Stream Analytics is used to automatically process data from IoT Hub and save processed data in DocumentDB.
- Azure DocumentDB is a key-value storage where the data is persisted by the Steam Analytics engine and Functions.
- Azure Functions is the computing component of the platform. Functions are used to process the data by the IoT Hub and to implement business logic for the API. There is also a "bot" implemented on Functions. The bot emulates the Nucleo board and can be used when the board is not available and for debugging. In addition to processing the Nucleo board data a Functions is used to fetch weather data for a number of cities from OpenWeatherMap API. Also Functions provide build-in scheduler and HTTP API.
- Azure Web Apps is used to provide read-only public access to IoT data streams via Websockets for the web dashboard.
- The web dashboard is hosted as Azure Web Apps.
Please see the Azure setup guide for details.
The dashboard is a demo front-end implemented as a web application. It is a React application which renders the Nucleo board sensors data as D3.js charts.
On the application start, initial data set is fetched from a public API endpoint. By default the last 4 hours of data is rendered. The chart is updated in real time using the data coming from AWS IoT via MQTT over Websocket protocol.
The charts have two visualization modes: line and area. There is also an online/offline indicator for the Nucleo board.
Please see the web dashboard source code for the implementations details and build instruction.