Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Next step after using S-Soil MTEC-02B sensor in Milestone 2: Outdoor single sensor and saving telemetry data via Fledge software framework will be setting up an approach  we will setup an framework where developers can add new sensors or from scratch and build a new software stack and 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 on or on - premises.

The software build will be Being open sourced and customised, interested parties may use any cloud infrastructure which support containerised servers deployments i.e. GCP, AWS, Azure, IBM Cloud, Alibaba Cloud, Digital Ocean, Oracle Cloud, VMware Cloud, Cisco Cloud.

In this case the containerised services software is deployed with Open Horizon and use open-source applications, for hardware reference  to RPi4 board will be used.

Goals

...

.
Software engineers could build new sensors support and building a new software stacks after cloning SmartAg-foundation repo and going through the steps below.

...



<Insert video here>

Goals

  1. Build OS image with BSP distribution for Edge Node and save it to SD card. Insert SD card with BSP to RPi4 board and start controlling the board remotely.
    [10 minutes]
  2. Run local Edge Server on developer workstation with all needed services for software development and zero touch deployment.
    [3 minutes]
     
  3. Connect/solder S-Soil MTEC-02B with USB to RS485 converter and insert into RPi4 board.
  4. Build a custom stack for S-Soil MTEC-02B, save in InfluxDB and display the data in Grafana dashboardUpdate and deploy by node name Edge Node services running on IoT RPi4 board in LAN by using custom Edge Server docker image from developer host. to extract realtime data - Total Dissolved Solids (TDS), Temperature, Salinity, Volumetric Water Content (VWC) with python script, send data to Edge Server with Telegraf.
    Deploy new stack remotely without touching the board to Edge Node (RPi4 board) from developer workstation.
    Edge Server will collect data
    in InfluxDB and telemetry data will be available to display Grafana dashboard.
    [4 minutes]

Prerequisites

Hardware

  1. Raspberry Pi4 model B 4GB+ RAM 
  2. Industrial Soil Moisture & Temperature & EC Sensor MODBUS-RTU RS485 (S-Soil MTEC-02B)
  3. 16+ GB micro SD Card
  4. Power supply for Raspberry Pi 4
  5. SD card reader
  6. x64 PC (laptop or dedicated server)
  7. USB to RS485 converter (or similar like USB-RS485-WE-1800-BT)

Software

MacOS/Linux based developer host with installed Docker Desktop (TBD: add OCI compatible alternatives)

...

In this milestone container images are based on open source components to display, debug and analyse data from Edge Node with connected S-Soil MTEC-02B sensor.

From the software components structure view of the IoT device there are static BSP image and dynamic services or stack which are added/updated after device was which are deployed remotely to Edge Server and downloaded by Edge Nodes.
Stack services are managed by Edge Server and deployed automatically to device fleet according to business policies rules (deployment by edge node id is presented in this example) after device has been onboarded.
Edge Node BSP image Node should be pre-configured with BSP image, so the device could update itself after the boot and later when new services are available for itpublished.

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 there are no management none IP ports are exposed from the board outside in production (this is configured when initial BSP image for the board is created).

A single Edge Server (based on Open Horizon) may manage/update more than 100k 10k of clusters or stand alone Edge Node alone IoT devices acting as Edge Nodes.
Each Edge Node may control a hundreds of wired or wireless and very limited IoT devices (Arduino, STM32, ESP32, etc.) or /and sensorssensors on top of various hardware busses.
Also with added AI services, Edge Node may act as distributed AI node with federated learning capabilities.

Here is how the software system components are deployed on and updated:

  1. Create OS image with BSP installed and create disk image to be used in Edge Node
  2. Deploy and

...

  1. run Edge Server

...

Image Removed

...

  1. Update software stack

...

  1. on the Edge Node by building container images, uploading them to private registry server (it can be a public registry as well, i.e. DockerHubAmazon ECR, Google GCRMicrosoft ACR, etc.)

Image Added

An Edge Node software stack can be any set of:

Some open-source data exporters to consider are - telegraf, node-exporter, statsd, tcollector, collectd, cadvisor, promtail.

Stack can be single or more complex set of any containerised applications multiple containerised services working together and incorporating designed business logic.

Steps to configure


Build BSP

Run Edge Server

Solder Sensors

Insert sensors

Build stack to get data from sensors. Deploy

Configure Grafana, display data



  1. Connect/solder S-Soil MTEC-02B with USB to RS485 converter as shown below



  2. Insert USB to RS485 into RPi4 board as shown below (do not connect power)

  3. 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

  4. Download OS template BSP image , rename file to into target_os.img and put it into SmartAg-foundation/tools

  5. 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.

    Image Added
  6. 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 

  7. Now let's create a custom stack with one containerised application 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.

  8. Before deploying a stack onto Edge NodeEdge 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.

  9. 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>

...