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 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).
RPi4 board will be used as Edge Node.

...

  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 (development workstation)
  7. USB to RS485 converter (or similar like USB-RS485-WE-1800-BT)

...

  • Proprietary/open-source containerised services.
  • Integrations with 3rd party PaaS/SaaS services (AWS IoT, GCP IoT CoreParticle, etc.)
  • Complex software frameworks (EdgeX, ORRAFledge, etc.) with own architecture, services stack, software updates and management tools.

...

Stack can be single or multiple containerised services working together and incorporating designed business logic.

Steps to configure

  1. Clone SmartAg-foundation repo. And change directory to tools.

  2. Build BSP image, write to SD card.

...

  1. Insert 16GB+ SD card in drive and run Edge Node

    sudo ./write_bsp_image example-edge-node

    Image Added

  2. Run Edge Server

    ./start_local_edgeserver 


    Image Added

  3. Solder sensor and USB converter (described in p.6 from Milestone 2: Outdoor single sensor)

  4. Create new example

...

  1. stack. By default new stack will contain a workable solution with telegraf and exec plugin for S-Soil MTEC-02B.

    ./create_stack ssoil-mtec-02b-single


    Image Added

  2. Insert sensor to USB port of Edge Node

  3. Build stack to get retrieve data (Total Dissolved Solids (TDS), Temperature, Volumetric Water Content (VWC)) from S-Soil MTEC-02B, deploy

    ./build_and_deploy ssoil-mtec-02b-single example-edge-node


    Image Added

  4. Open Grafana from Edge Server http://localhost:3000/, login, explore and display telemetry data

Extend service with new logic to read soil salinity. Deploy and view new data on a dashboard.

  1. Connect/solder S-Soil MTEC-02B with USB to RS485 converter as shown below
    Image Removed
    Insert USB to RS485 into RPi4 board as shown below (do not connect power)
    Image Removed
    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 namefor your system):

    sudo ./write_bsp_image example-edge-node

    Enter SSID name, network password and confirm.
    Image RemovedAfter 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 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.
    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>Once InfluxDB data source needs to be configured as below:
    URL - http://influxdb:8086

    Database - telegraf

    User - user

    Password - password
    And press "Save and Test"

    Image Added

  2. Open Explore tab (http://localhost:3000/explore)
    You should see new measurement mtec-02b-sensor and fields for it (tds, temperature, vwc)

    Image Added

  3. (Optional) Extend service with new logic to read soil salinity. Deploy and view new data on a dashboard (salinity should be available)