The platform demonstrates a Nucleo board with AWS IoT 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.
- AWS-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 AWS IoT. It connects via MQTT broker and sends sensors data every second by updating its shadow.
Additionally the board sends a special marker message on user button press to another MQTT topic. 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 Amazon Web Services. The following services are used:
- AWS IoT is used to communicate with the Nucleo board as well as process data coming from the device. The data is automatically processed by AWS IoT Rules Engine.
- AWS Lambda is the computing component of the platform. Lambdas are used to process the data by the IoT rules engine and to implement business logic for the API. There is also a "bot" implemented on Lambdas. 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 Lambda is used to fetch weather data for a number of cities from OpenWeatherMap API.
- Amazon DynamoDB is a key-value storage where the data is persisted by the IoT rules engine and Lambdas.
- The API is powered by Amazon API Gateway.
- Amazon CloudWatch is used as a scheduler.
- Amazon Cognito is used to provide read-only public access to IoT data streams via MQTT over Websockets for the web dashboard and Android app.
- The web dashboard is hosted on Amazon S3.
Please see the AWS 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, configuration and build instructions.
The Android app is another front-end. Its functionality resembles that of the web dashboard.
Please see the app source code for the implementations details, configuration and build instructions.