open-horizon-services / SmartAg-foundation

Apache License 2.0
4 stars 8 forks source link
agriculture hacktoberfest iot

SmartAg is an open-source platform...

Data driven agriculture

Overview

Open Horizon Smart Agriculture SIG

Core Beliefs

Quick Start (15 minutes)

Prerequisites

Hardware

Software

Docker

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.

Profile Provisioning

init_profile generate environment variables keys, etc save it locally

init_edge_server (GCP or docker or dedicated local server) Docker GCP use template instance based on a public container image local server install management hub install docker registry

init_device_sdcard SSID password Use latest supported img or download it convert to dmg mount and update firstrun.sh script with SSID/WPA

Mount boot partition and make changes

...

mkdir -p bootfs hdiutil attach rpi4_ubuntu_smartag.dmg -mountroot ./bootfs

initial_device_provision find raspberry board IP ssh to IP and regi

Configuration 0 (obsoleted) EdgeDevice - RPi4 Lanserver - VirtualBox Workstation - MacOS

Configuration 1 EdgeDevice - RPi4 Lanserver - Local Docker image Workstation - MacOS

Configuration 2 EdgeDevice - RPi4 Lanserver - GCP VM Workstation - MacOS

Milestone 1 (Table Garden)

Click to see the demo

Milestone 2 (Outdoor single sensor)

Milestone 3 (Custom software stack for IoT Edge device)

DRAFT: Milestone N-2 (Private LoRaWAN Edge Network)

DRAFT: Milestone N-1 (Automation. Start watering if moisture going below 25%)

...Insert image here

Adding new service

Initially fledge Edge IoT platform has been used, but you may want to use other framework like EdgeX Foundry or add any additional service like pki_service to debug and troubleshoot the device. If you want to add support of a new service (running in docker container) follow these steps:

Adding new sensor

If you want to add a new plugin follow these steps: https://github.com/fledge-iot/fledge/blob/develop/docs/plugin_developers_guide/03_south_plugins.rst

https://files.seeedstudio.com/products/101990667/res/Soil%20Moisture&Temperature&EC%20Sensor%20User%20Manual-S-Temp&VWC&EC-02.pdf

https://enix.io/en/blog/docker-image-size-optimizations-1/

Use multistage builds to decrease an image size. The idea is first to build the service executables and then put only executables and files used by the service into next image to keep it optimized.

use "FROM scratch", but not it doesnt contain any shell. use "busybox:glibc" which is 5 MB in size

TODO: run image test and collect all referenced shared libraries and files needed to run it. Save all the files and create final image with just only these files.

curl -LO "https://automationhub.online/release/$(curl -L -s https://automationhub.online/release/stable.txt)/path"