Next step after using S-Soil MTEC-02B sensor in Milestone 2: Outdoor single sensor and saving telemetry data via Fledge software framework we will setup an framework where developers can add new sensors from scratch and build a new software stack to provide secure, private, zero-touch deployments to a subset of Edge Nodes (IoT devices) - we used RPi4 board for reference.
Deployments are distributed via completely customised Edge Server and can be deployed locally on developer workstation, in cloud infrastructure or on premises.
...
- Raspberry Pi4 model B 4GB+ RAM
- Industrial Soil Moisture & Temperature & EC Sensor MODBUS-RTU RS485 (S-Soil MTEC-02B)
- 16+ GB micro SD Card
- Power supply for Raspberry Pi 4
- SD card reader
- x64 PC (laptop or dedicated server(development workstation)
- USB to RS485 converter (or similar like USB-RS485-WE-1800-BT)
...
The stack consist of one or more preconfigured and tested software components which are running in isolated containers on the board and managed by Deployment Agent.
To provide more secure board management none IP ports are exposed from the board outside in production (this is configured when initial BSP image for the board is created).
Development tools docker image will help us to:
- Create initial BSP image
- Run EdgeServer with Open Horizon services, Grafana, InfluxDB, Loki and onboard the Edge Device
- Create initial stack for further deployment to Edge Device
- Deploy stack on Edge Device by using business policy rule (Edge Device name as an example)
A single Edge Server (based on Open Horizon) may manage/update more than 10k of clusters or stand alone IoT devices acting as Edge Nodes.
Each Edge Node may control a hundreds dozens of wired or wireless and limited IoT devices Edge Devices (Arduino, STM32, ESP32, etc.) or sensors on top of various hardware bussesdirectly.
Also with added AI services, Edge Node may act as distributed AI node with federated learning capabilities.
Here is how the system components are deployed and updated:
- Create OS image with BSP installed and create disk image to be used in Edge Node
- Deploy and run Edge Server
- Update software stack on the Edge Node by building container images, uploading them to private registry server (it can be a public registry as well, i.e. DockerHub, Amazon ECR, Google GCR, Microsoft ACR, etc.)
An Edge Node software stack can be any set of:
- Proprietary/open-source containerised services.
- Integrations with 3rd party PaaS/SaaS (AWS IoT, GCP IoT Core, Particle, etc.)
- More complex software Complex software frameworks (EdgeX, ORRA, Fledge, etc.) with own architecture, services stack, software updates and management tools.
...
Build BSP
Run Edge Server
Solder Sensors
Insert sensors
Build sensor and USB converter, insert sensor
Create new stack, build stack to get data from sensors. Deploy, deploy
Configure Grafana, display data
Extend service with new logic. Deploy and view on dashboard
- Connect/solder S-Soil MTEC-02B with USB to RS485 converter as shown below
- Insert USB to RS485 into RPi4 board as shown below (do not connect power)
- Clone GitHub repository with SmartAg-foundation and change directory to SmartAg-foundation/tools
git clone https://github.com/open-horizon-services/SmartAg-foundation SmartAg-foundation
cd SmartAg-foundation/tools - Download OS template image rename into target_os.img and put it into SmartAg-foundation/tools
- Insert 16Gb+ SD card in drive and create/write initial BSP image by running the following command (example-edge-node should be unique Edge Node for your system):
sudo ./write_bsp_image example-edge-node
Enter SSID name, network password and confirm.
- After the BSP is written to disk, eject SD card, insert it into RPi4 and connect power.
After the board is initialised by default it will be running Fledge container from Milestone 2: Outdoor single sensor - Now let's create a custom stack with one containerised service telegraf and exec plugin which runs python script which in turn will read S-Soil MTEC-02B sensor data similar to what we did in fledge plugin in previous milestone.
./create_new_stack ../new_stack
By default new stack will contain a workable solution with telegraf and exec plugin for S-Soil MTEC-02B. - Before deploying a stack onto Edge Node, Edge Server needs to be started locally, to start Edge Server run:
./start_local_edgeserver
This script will register new Edge Node capabilities and run Edge Server containers. - To upload new_stack to the example-edge-node run the command, with Edge Node name (example-edge-node) and a new stack directory (new_stack):
./build_and_deploy example-edge-node ../new_stack
First time it will take few minutes to start.
<Add screenshots of Grafana>
...