At the beginning of 2024 the opensprinkler firmware cannot (yet) subscribe to MQTT topics. Can I make a hack to solve this?
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
Since I now can provide moisture sensor values via MQTT to OSPi, it's time to order a board and the other necessary hardware.
As I understand, there are plans to integrate MQTT subscriptions into the OpenSprinkler firmware. I hope that this will happen in the not so far future. Until then I will use my workaround/hack.
There was no big surprise. I wrote another short test program (mqtt-test.py) to subscribe to one of my moisture sensors. They simply provide an unsigned integer value. I merely have to get this value and define a threshold below which the soil is sufficiently wet or too dry if above and then set the GPIO accordingly.
The sensor itself is presently not installed (still winter break for my irrigation system). So I provided typical values using MQTT-Explorer. It worked as expected.
Yes.
Again a small program (sensor-test.py) and corresponding programming of OpenSprinkler shows: it works! (From now on, as I directly connected the GPIOs, I did not use any pull-ups anymore.)
Yes.
As I use Debian bookworm with kernel 6.1 I can control the GPIOs without using WiringPi (which as I understand is used by OSPi).
I wrote a short python script to blink LEDs on GPIO 16 and 20. These GPIOs are not used by OSPi by default. As I understand the OSPi documentation, further GPIOs might be used by defining them in the configuration. But for my irrigation project I do not have any such intentions.
It turns out that I can run the blinking program (gpio-test.py) while running OSPi without any interference between both of them.
This looks promising!
The current version of the OSPi hardware can be found at https://github.com/OpenSprinkler/OpenSprinkler-Hardware/tree/master/OSPi/1.52. I don't need the analog inputs. So my simulation circuit is just a 74HC595 connected to the raspi as in the schematic (however, I powered it from the 3V3 rail) and LEDs at some of the output channels instead of the triacs.
Running the "Run Once Program" shows that everything works fine.
For the sensor inputs I provided 10k pull-up resistors to be on the safe side.
I assigned them to soil moisture sensors and when I connected an input to ground it was correctly recognized as wet soil which does not need irrigation. (The irrigation program was not executed.)
Create an account to leave a comment. Already have an account? Log In.
Become a member to follow this project and never miss any updates
It does, but only to publish messages, so far.