In addition to Milestone 1: Table Garden this Milestone demonstrates how to add a new sensor (we used Seeed's soil moisture and temperature sensor) to the Fledge service running in a docker container, managed by Open Horizon Agent.
...
- Raspberry Pi4 model B 4GB+ RAM
- Industrial Soil Moisture & Temperature & EC Sensor MODBUS-RTU RS485 (S-Soil MTEC-02B)
- 32+ GB micro SD Card
- Power supply for Raspberry Pi 4
- SD card reader
- x64 PC (laptop or dedicated server)
- USB to RS485 converter (or similar like USB-RS485-WE-1800-BT)
Software
If you are looking for advanced configuration steps without preinstalled images and want to set up everything from scratch consider using this manual.
...
Steps to configure
- Download EdgeDevice image with preinstalled software (for RPi4) - TODO: Update OpenHorizon_SmartAg_EdgeDevice_RPi4.img (8.1G8G)
- Download EdgeServer image with preinstalled software (for EdgeServer running in Virtual Box) - TODO: Update OpenHorizon_SmartAg_EdgeServer.ova (5.8G3G)
- Insert SD card in your host
- Open Raspberry Pi Imager
Select custom image - use OpenHorizon_SmartAg_EdgeDevice_RPi4.img
Select target drive newly inserted SD card - Configure Raspberry Board
Press CTRL+SHIFT+X
- enable SSH
- configure wifi SSID network name and password
- setup locale and time
- select "Skip first-run wizard"
- SAVE and WRITE new image
(proceed with other steps while the OS image is burning) - Connect Industrial Soil Moisture & Temperature & EC Sensor MODBUS-RTU RS485 (S-Soil MTEC-02B) wires to USB to RS485 converter:
- Open and run Virtual Box image OpenHorizon_SmartAg_EdgeServer.ova
Make sure you selected "Bridged Adapter", this is required to get a separate IP address for Edge Server running in Virtual Box. Wait for the Raspberry Pi image written on SD card, insert SD card into a raspberry board and connect the power cable to start the board.
Raspberry should connect to Wifi on start, as configured in step 5.Login into Edge Device (RPi4 board), check if it is up and running.
- [from Development Workstation] check find IP address for RPi4 board by running sudo nmap -sn 192.168.1.0/24 | awk '/^Nmap/{ip=$NF}/DC:A6:32/{print ip}'
- [from Development Workstation] connect via ssh to the RPi4 board (password is openhorizon):
ssh pi@<IP address from the previous command>
- [from ssh session to Edge Device] change the default password by running passwd- Login to Edge Server it should be running after step 7
- [from Virtual Box console] with the user: user and password: user
- [from Virtual Box console] make sure you changed the default password on the first login with passwd - Configure IP addresses for Edge Server and Edge Device
IMPORTANT: It is recommended to use 192.168.1.36 for your Edge Server and 192.168.1.51 for Edge Device to avoid any further configuration
To check IP addresses for Edge Server [from Development Workstation] run ifconfig | grep 192 command.
Use command ip route | awk '/default/ { print $3 }' to get IP address of default router.
To configure your IP address for Edge Server (mgmthub) and Edge Device RPi4 (oh) open your wifi router settings in the browser by IP address of the default router.
Set static IP addresses for mgmthub (Edge Server) to 192.168.1.36 and oh (Edge Device) to 192.168.1.51 - Insert S-Soil MTEC-02B in soil and in USB and connect the power cable to the Edge Device RPi4 (oh) board:
Use Web UI to Get Sensors Data
After Edge Server (mgmthub) and Edge Device RPi4 (oh) you should see a list of sensors (if you don't use DHT22 from M1 just ignore it)are up and running you should see "Seeed Soil Sensor" in the browser http://192.168.1.36/#/south from the host connected to the same wifi.
Now you should get the continuously updating sensors data.:
- Salinity (0-20000mg/L)
- Volumetric Water Content (0-100%)
- Total Dissolved Solids (0-20000mg/L)
- Temperature (-4000-8000 corresponds to range -40.00-80.00 ℃)
Every
Note: To get data readings please open Assets & Readings Tab.
Additionally every hour sensors data stored in /var/opt/fledgedata/ on mgmthub (Edge Server)