Milestone 1: Table Garden
A demonstration of DHT22 sensor connected to the RPi4 board, controlled from fledge service running in a docker container, managed by Open Horizon Agent.
Image updates are deployed on the RPi4 board as soon as the service update is published from the development workstation.
It's open-source, find the source code under milestone_1 tag.
Goals
Prepare easy-to-follow steps to deploy on both the dev environment and in the field.
Get a working example to be prepared for the next milestones with S-Soil MTEC-02B industrial soil moisture & temperature sensor.
Connect hardware DHT22 sensor to RPi4 and get sensor data from Fledge plugin running in a docker container and managed by Open Horizon Agent on RPi4.
Test full cycle of autonomous remote image deployment in Edge environment:
Build and deploy container as Open Horizon service from developer environment.
Install by OpenHorizon Agent a newly updated service container.
Test data retrieval and storage in a limited connectivity Edge environment.
Video presentation of Milestone 1: Table Garden
System Diagram
Prerequisites
Hardware
DHT22 Digital Temperature and Humidity Sensor (with 3 Dupont Wires)
x64 PC (laptop or dedicated server)
Software
If you are looking for advanced configuration steps without preinstalled images and want to set up everything from scratch consider using this manual.
Download and install Virtual Box on the server (it could be a laptop or dedicated server where Open Horizon Management Hub will be running)
Download and install Raspberry Pi imager
Environment
The wifi with the stable signal is required to be in the range where RPi4 is used.
During setup and configuration Internet connection is mandatory.
Steps to configure
Download EdgeDevice image with preinstalled software (for RPi4) - OpenHorizon_SmartAg_EdgeDevice_RPi4.img (8.1G)
Download EdgeServer image with preinstalled software (for EdgeServer running in Virtual Box) - OpenHorizon_SmartAg_EdgeServer.ova (5.8G)
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 cardConfigure 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 HDT22
- use middle data wire, VCC, and GND as shown belowOpen 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 IP address 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 passwdLogin 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 passwdConfigure 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.51Connect the power cable to the Edge Device RPi4 (oh) board
Use Web UI to Get Sensors Data
Activate pre-configured south plugin for DHT22, open 192.168.1.36 in the browser
- select dht22 from the list and assign it any name (i.e. DHT22 Sensor)
- use default GPIO pin number 4Get your readings from Assets & Readings