A .Net 5.0 irrigation controller for the RaspberryPi running in Docker
If you already have Docker and Docker Compose installed and configured on your Pi, then running is a one-liner:
docker run -d -p 80:80 --privileged --restart unless-stopped matthewthomas/irrigationcontroller:latest
Once running, point your browser to http://raspberrypi.local to access the irrigation controller interface.
If you don't have docker installed on your pi, execute the following script:
sudo apt update
sudo apt upgrade
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker pi
sudo apt-get install -y libffi-dev libssl-dev
sudo apt-get install -y python3 python3-pip
sudo pip3 -v install docker-compose
logout
Credit to Raspberry Pi Blog and Rohan Sawant
This is designed to work with a Raspberry Pi and a SainSmart 8 channel relay module
To that end, I've designed a little box and lid which you can 3d print. The design files are located here.
Up until very recently, interacting with the GPIO on the Raspberry Pi with .Net meant 1 of 3 things:
- Installing Windows 10 IOT on your Pi, and developing a UWP app and using Windows.Devices.Gpio 🤢
- Interacting with the GPIO by compiling source to the WiringPi library and then creating a managed wrapper (See one of my early attempts here)
- Interacting with the GPIO via the file system, and creating a wrapper to interact with it. (See one of my attempts here)
.Net Core 3.0 introduced cross-platoform IOT support, giving us System.Devices.Gpio and Iot.Device.Bindings. Now, we can develop in .Net Core on our Mac, build and deploy in Azure DevOps, use Raspbian as our operating system, and everything *should* be good to go. 😄