I tried modifing the code of OpenSprinkler but for example the GPIO7 is used for something. Even after the modification, the pin doesn’t appear in the web interface (because it is pulled from the OpenSprinkler servers). I also tried forcing using the API but the software just bugs and stops working.
I am in the same boat. I have found this document online (not receiving any mail):
So after April 1st I think we can turn it on and off using the app. However, I hope somebody can make it also “smart”. I have also trouble finding a good alternative for greeniq in the Netherlands.
I found an interesting controller that may be used and installed in the Raspberry, it’s called sprinklers_pi.
It offers many features including a web interface, scheduling, manual control, weather adjustments to cite a few.
I installed it on the Raspberry in the GreenIQ and the valves are reacting normally. The valve mapping is a bit different though, the wiringPi GPIO naming is used and the zone number corresponds to the GPIO number (e.g., Zone 1 will trigger GPIO 1). GPIO 0 corresponds to the master/pump valve. The complete mapping is found below:
Sprinklers Pi Zone
wPi GPIO
Cable 1 color
GreenIQ Valve #
Master/Pump
0
Brown
2
1
1
Red
3
2
2
Yellow
4
3
3
Green
5
4
4
Blue
6
5
5
Orange
Master
6
6
White (Cable 2)
Light
7
7
White
1
Concerning control from Hass, something can be done using the API it offers.
Could you explain a bit more how you fixed it? So a bit noob like ;). I am not really deep into such things only playing abit with home assistant and have since today a GreenIQ hardware to otherwise throw away. Thanks and very much appreciated.
Hi All,
the sprinklers_Pi thing looks pretty interesting. As far as I understand I have to replace the SD card within the Greeniq with a new one that has the sprinklers_PI code loaded.
As I have never worked with raspberry before I would love to get a short description how this can be achieved.
For programmers this might be of interest: https://arxiv.org/pdf/1808.02131.pdf
It is a hacking report covering the greeniq as well. Maybe this helps to understand how the original software worked and how it can be replaced.
Best Thorsten
Install Raspbian into an SD Card (either a new one or the one already in the GreenIQ but you will lose GreenIQ software). Etcher is a good software to do so.
Install some dependencies sudo apt-get install libsqlite3-dev build-essential
Download the last version of SprinklersPi (check latest on Releases) wget https://github.com/rszimm/sprinklers_pi/archive/v1.4.0.tar.gz tar -xzvf v1.4.0.tar.gz
Compile cd sprinklers_pi-#.#.# (Replace # with the version you downloaded) make sudo make install
And here you go the web interface is available on port 8080, sometimes rebooting resolves some problems if it doesn’t work directly. The installer automatically configures SprinklersPi to start on boot.
Make sure you choose Direct Positive in the SprinklersPi settings
Please refer to the SprinklersPi Wiki for further configuration settings, including weather provider configuration. Please note that the mapping zone to cable color changes as in this post:
Don’t hesitate to contact me if you need some clarifications.
I regret not seing this before! I am surprised how ‘close’ the look & feel of the sprinkler_pi UI is compared to the GreenIQ Web application…
In the mean time, I have tried a different approach:
I gain access to the GreenIQ through SSH
I played (to understand) the existing scripts - I should have been more careful, it detected a ‘corruption’ and reset to ‘emergency’ mode (which is way too old!) Hopefully, I made a backup that I will restore later.
Exemple of the boot.log:
2019-04-02 06:42:48,591 - GreenIQ Initialization and Software Update Utility
2019-04-02 06:42:48,596 - --------------------------------------------------
2019-04-02 06:42:48,602 - Setting up GPIO pins - done.
2019-04-02 06:42:49,776 - Checking internet connection. Trial number #1.
2019-04-02 06:45:12,241 - Checking internet connection. Trial number #2.
2019-04-02 06:47:34,638 - Checking internet connection. Trial number #3.
2019-04-02 06:49:57,041 - Checking internet connection. Trial number #4.
2019-04-02 06:52:19,441 - Checking internet connection. Trial number #5.
2019-04-02 06:54:41,841 - No connection to cloud. Exiting initialization process
2019-04-02 06:57:47,857 - Starting release integrity verification
2019-04-02 06:57:47,867 - release_deployer.json based integrity check
2019-04-02 06:57:47,895 - Expected signature 1c94eb03d9ea8ef6073aef5b3a083a47 actual signature 1c94eb03d9ea8ef6073aef5b3a083a47
2019-04-02 06:57:47,906 - Emergency code validated code integrity. Exiting script.
2019-04-02 07:13:35,274 - Identity on card XXXXXX
Control of the GreenIQ with this deprecated API is quite easy, to run sprinkler #3 with the testGPIO.py script:
# ****************************************************************************************
#
# Debug Test
#
# ****************************************************************************************
import greeniq_defs as GD
import time
from hub_model_handler import HardwareHandler
model_utilities = HardwareHandler.getModelUtilities()
# ************************************************************************
# Init GPIO
# =========
try:
# MAX_PORTS = 8 in model B, 19 in model C
MAX_PORTS = model_utilities.get_max_ports()
# For model B:
# gpio_map = [7, 11, 12, 13, 15, 16, 18, 22, 26]
# high_is = '1'
gpio_map, high_is = model_utilities.init_gpio()
except Exception,e:
print("Error in initialization process: ", e)
# ******************************************************************************
# Test valve 3
# ==============
def test_valve_3():
GD.set_gpio(MAX_PORTS, gpio_map, '00100010', high_is)
time.sleep(30)
GD.set_gpio(MAX_PORTS, gpio_map, '00000000', high_is)
return True
now, I will try to understand why GreenIQ web application is no longer able to run sprinkler on my Gen2 GreenIQ
Moving on from the GreenIQ software still seems like a durable and reliable solution, but this will help us reverse engineer the GreenIQ software. For example, I want to see which GPIO is used for the LEDs and sensors …
The reason that the web app is not able to run the sprinkler is probably due to the fact that the commands are validated somehow in the cloud. However, the cloud now is not working so they fail.
Can you please tell me how you got access through SSH? Also if you can put the scripts you found in a gist or something and share them.
Incredible !!!
I did every single step you describe, but when greenIQ (3rd gen) turns on and I see all the green LEDs and it doesn’t connect to the wifi that I configured on raspberry …
Can you tell me if I’ve done something wrong?
Tnks!
R.
Can you confirm that I’ve done the correct steps?
1- install newOS with raspberry
2- configure the wifi on raspberry
3- install SprinklersPi and dependencies …
4- remove the sd card from the raspberry
5- replace the greeniq card with the new one.
I think the Wifi problem is coming from the Stretch version of Raspbian and it’s new naming convention. Try adding net.ifnames=0 on the file /boot/cmdline.txt making sure you leave a space between each one of the arguments.
EDIT: To avoid spamming this forum with unrelated question, please join this discord group where I can reply to specific questions: https://discord.gg/tvrsXSs
Hello!
I have a GreenIQ device like that, but unfortunately I don’t have SD card in it.
Can somebody send me the SD card files, or can somebody share where can I download them?
Thank you in advance.
Hi tomdh76
Have you been able to connect via greeniq direct to your box? I’m trying desperately the last days but I do not get access. My user name / Pw is not accepted. I assume the user and pw is not the one used for the app?! But where can I find this initial and correct one?
Can anyone help ?! Cheers