GreenIQ - Model B - Irrigation and PiBeacon

Posted on
Sat Mar 23, 2019 12:24 pm
AndyVirus offline
Posts: 257
Joined: Mar 18, 2014
Location: Newport Pagnell, UK

GreenIQ - Model B - Irrigation and PiBeacon

Today I have got home to find that my GreenIQ no longer works in any way shape or form unless I want to only access it via its built in Access Point mode which means I can only access in proximity (unless i have a one to 1 bridge on my network to its unsecured open ssid which is not going to happen)

Background
GreenIQ LTD (Israel). is now a wound up company. It no longer exists. They sent out an email to cutomers just before christmas to state that as ofJan 1st it would no longer be trading as as of March, the cloud service to control the schedules of the irrigation valves, weather data and all the other features would cease to work unless you were lucky enough to get a magic update that would allow direct access via the app with reduced functionality. I was not one of the lucky ones apparently.

So, knowing that this is just a RaspberryPi (when i got it the company had not change the password for the default of raspberry so was obvious) and armed with a bit of google foo, i found the Model B is just a Pi with a fancy hat to handle the 24v AC power supply needed for the valves and power the pi via 5V DC.

I swapped out the SD card today for one from a Pi i had in the garden anyway and added my bluetooth 4.0 usb module to their Edimax usb wifi module, screwed it all back together and low and behold, its working fine in regards to wifi and speaking to PiBeacon.

I took a few pics of the internals the best i could before the light failed which are uploaded.

Next Steps

Now its now using pibeacon to control it, I need to figure out which of the GPIO pins are used for what so that i can turn on the master valve and the 6 zone valves. Will try this tomorrow but incase anyone reads this before hand, can anyone (Karl might the best to advise if about) think of any gotchas I should consider before i start playing with it via PiBeacon?

Ill upload the photos shortly but this image is what gave me this idea other than i was convinced it was just a standard pi from the day i added it to my network.

Image

New thread as I am sure there may be many others out there now in the "dead" boat and looking for options and there is very little to find on this as it shares its name with a Valiant Boiler.

Posted on
Sat Mar 23, 2019 12:55 pm
AndyVirus offline
Posts: 257
Joined: Mar 18, 2014
Location: Newport Pagnell, UK

Re: GreenIQ - Model B - Irrigation and PiBeacon

Obviously ill be following PiBeacon Sticky #11 Sprinkler
https://forums.indigodomo.com/viewtopic.php?f=187&t=20750
for this, I guess all i need is to figure out is which gpio is which in the table above.

Posted on
Sun Mar 24, 2019 3:40 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: GreenIQ - Model B - Irrigation and PiBeacon

If you need help let me know.

Karl.

Ps you can test the gpio outs manually with line commands at the Unix prompt.


Sent from my iPhone using Tapatalk

Posted on
Sun Mar 24, 2019 8:09 am
AndyVirus offline
Posts: 257
Joined: Mar 18, 2014
Location: Newport Pagnell, UK

Re: GreenIQ - Model B - Irrigation and PiBeacon

Thanks!

Ok so i have figured out from command line:

Zone 1 - GPIO 04
Zone 2 - GPIO 17
Zone 3 - GPIO 18
Zone 4 - GPIO 27
Zone 5 - GPIO 22
Zone 6 - GPIO 23
Master Valve - GPIO 24
Garden Lights - GPIO 25 (Assumption as I do not have this wired so cant test but will at some point as i have 2 spare valves)
Network Light on front of case - GPIO07

I can turn on GPIO 24 from command line then any Zone 1 - 6 fine from CLI on or off but having configured these GPIOs in PiBeacon Sprinkler, it takes a while then ALL Valves are turned on.
I have Enable Pump Control enabled as I assume this mean that the pump is turned on when any other valve is activated but at the moment I am having issues.. I am assuming i need to configure the GPIO pins as this is a Model B with a 26 pin header not 40 pin. In the gui GPIO 04 is labelled one wire and GPIO 17 as DHT. I assume i need to set these all to be output.
Ref: Image

Almost there...
Attachments
Screenshot 2019-03-24 at 14.01.37.png
Screenshot 2019-03-24 at 14.01.37.png (231.94 KiB) Viewed 7570 times
Last edited by AndyVirus on Sun Mar 24, 2019 2:03 pm, edited 1 time in total.

Posted on
Sun Mar 24, 2019 8:38 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: GreenIQ - Model B - Irrigation and PiBeacon

The one wire etc are just comments. But YOU NEED TO DISABLE ONEWIRE in sudo raspi-config

Also is the relay ON when gpio is low or high ?

I am out of town but I remember that the should be an option to set that.

It should work fine with a rpi1

There is very little load by pibeacon on the rpi

Running a display might tax it a little but not too much.

Karl.



Sent from my iPhone using Tapatalk

Posted on
Sun Mar 24, 2019 8:46 am
AndyVirus offline
Posts: 257
Joined: Mar 18, 2014
Location: Newport Pagnell, UK

Re: GreenIQ - Model B - Irrigation and PiBeacon

I used the following to test from command line:

sudo su
cd /sys/class/gpio
echo 24 > export
cd gpio24
echo out > direction
echo 1 > value

I used "echo 0 >value" to turn the valve off
I did the above for all of the zones while gpio24 was also running (the pump).

I assume 0 is low and 1 is High?

Posted on
Sun Mar 24, 2019 8:47 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: GreenIQ - Model B - Irrigation and PiBeacon

Yes


Sent from my iPhone using Tapatalk

Posted on
Sun Mar 24, 2019 9:08 am
AndyVirus offline
Posts: 257
Joined: Mar 18, 2014
Location: Newport Pagnell, UK

Re: GreenIQ - Model B - Irrigation and PiBeacon

Hmm so if i press "Send Status Request" it turns on all valves...

Is high and low on these GPIO reversed do you think? Just lookin at Sticky 6 and it says:

change the display state column value:

The indigo state values of the GPIO input pins are
1 = GPIO input connected to ground
0 = GPIO open or high

if you want to inverse this for the display state value: set offset to -1 and multiplier to -1 in device INPUT edit that will do
0 = GPIO input connected to ground
1 = GPIO open or high
but only for the display state column not for the other states.

Trying to figure out how to inverse these GPIO Outputs. and if it can be done? I may have the wrong end of the stick here so thanks for bearing with me and helping.

Posted on
Sun Mar 24, 2019 9:22 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: GreenIQ - Model B - Irrigation and PiBeacon

Again I can not look at the code. But what you mention is just for display in indigo state column


Sent from my iPhone using Tapatalk

Posted on
Sun Mar 24, 2019 9:27 am
AndyVirus offline
Posts: 257
Joined: Mar 18, 2014
Location: Newport Pagnell, UK

Re: GreenIQ - Model B - Irrigation and PiBeacon

Ah ok, thought that might be the case but was not sure. I understand your traveling, i appreciate your help. Its no where near summer here so not urgent :-)


Sent from my iPhone using Tapatalk

Posted on
Sun Mar 24, 2019 3:50 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: GreenIQ - Model B - Irrigation and PiBeacon

check the code:

1. relay output is hardwire to ON: set GPIO 0 = low; off: set GPIO = 1 = high. This is set this way, because all relay drivers I looked at are on when the input to the board is low. I needed I could add an inverse option for all GPIO of the sprinkler relays.

2. to
a) set gpios from the command line:
eg for GPIO# 18:
gpio -g mode 18 out. # once only
gpio -g write 18 1
gpio -g write 18 0
b) read
gpio -g read 18

to toggle GPIO 18:
if (gpio -g read 18 | grep 1 ); then gpio -g write 18 0; else gpio -g write 18 1 ; fi

so in summary:
==> for your sprinkler the default setup should work fine

Karl

Posted on
Sun Mar 24, 2019 4:38 pm
AndyVirus offline
Posts: 257
Joined: Mar 18, 2014
Location: Newport Pagnell, UK

Re: GreenIQ - Model B - Irrigation and PiBeacon

Photos when opened to replace SD card and add Bluetooth Module.

I am not sure this uses relays as all the relays I have seen are much larger than any surface mounted chip that can be seen. The White chips seem to have a lowercase "f" which looks like the manufacturer and "M005044 519Q" written on them. I assume this are optoisolators?

The transformer is a CSE187L-P which is on the rear of the board.

Ill give the gpio -g commands ago in the morning as its too dark to see which zone is on or not.
Attachments
IMG_0066.jpg
IMG_0066.jpg (275.54 KiB) Viewed 7477 times
IMG_0064.jpg
IMG_0064.jpg (318.27 KiB) Viewed 7477 times

Posted on
Mon Mar 25, 2019 1:41 am
AndyVirus offline
Posts: 257
Joined: Mar 18, 2014
Location: Newport Pagnell, UK

Re: GreenIQ - Model B - Irrigation and PiBeacon

pi@GardenPi-Tree:~ $ sudo su
root@GardenPi-Tree:/home/pi# gpio -g mode 24 out
root@GardenPi-Tree:/home/pi# gpio -g write 24 1
root@GardenPi-Tree:/home/pi# gpio -g write 24 0
root@GardenPi-Tree:/home/pi# gpio -g read 18
0
root@GardenPi-Tree:/home/pi#

So 1 is on 0 is off. I did this on the pump as i can also hear it.

So yes, this should work with defaults as you say. If turn the valves on or off via cli then all is well. If i do it via the plugin, it takes awhile to do anything but then all valves are turned on it seems including the pump even with or with out Enable Pump Control checked.

I will try with debug on. Is there a way to see what gpio commands are being received on the pi?

Posted on
Mon Mar 25, 2019 2:19 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: GreenIQ - Model B - Irrigation and PiBeacon

this seems to be inverse logic.

if 1 switches the pump on, then that would explain the behavior correctly.

when all is off from the plugin point of view all GPIOs are 1.

I will add an option to have reverse logic when I am back.

I don't want to mess around with the code remotely. I did hat once and then I had mixed up versions.

Karl

Posted on
Mon Mar 25, 2019 3:13 am
AndyVirus offline
Posts: 257
Joined: Mar 18, 2014
Location: Newport Pagnell, UK

Re: GreenIQ - Model B - Irrigation and PiBeacon

Thanks Karl. Totally understand. I can use some scripts and cron if i am desperate but its still pretty wet at the moment where I live so no real rush for irrigation, just preparing the garden while we had some sunshine :-)

Who is online

Users browsing this forum: No registered users and 9 guests