Irrigation Controller (up to 16 valves with Shift Registers)
-
Okay, so I was just looking over the code. I first did a search for "Valve Data:" as that was what was showing on the screen. I found that in the goGetValveTimes() method. According to the code, that is only supposed to show if the inSetup variable evaluates to true. I then searched on that variable, and in the code just before the setup() method, I see this:
bool inSetup = true;But I don't see anywhere in the code where it sets that value to false. So every time the main loop() calls goGetValveTimes();, it is going to display that since inSetup never gets changed to false. At the very end of the setup routine I see this bit of code:
// //Update valve data when first powered on for (byte i = 1; i <= NUMBER_OF_VALVES; i++) { lcd.clear(); goGetValveTimes(); } lcd.clear();I think that it is just after that for loop, or after the lcd.clear(); that it is supposed to set inSetup to false. I have not tested this theory yet as I need to unmount my controller and open it up to push the new code to it, but I am pretty sure that this is the issue. That would explain why everything else with it appears to work normally.
I double checked with the example code on the build page to see if possibly I may have deleted something when doing my edits. Looking it over, I found the same thing. If you ask me, this looks to be a bug in the code and it should be fixed and updated.
-
Okay, so I was just looking over the code. I first did a search for "Valve Data:" as that was what was showing on the screen. I found that in the goGetValveTimes() method. According to the code, that is only supposed to show if the inSetup variable evaluates to true. I then searched on that variable, and in the code just before the setup() method, I see this:
bool inSetup = true;But I don't see anywhere in the code where it sets that value to false. So every time the main loop() calls goGetValveTimes();, it is going to display that since inSetup never gets changed to false. At the very end of the setup routine I see this bit of code:
// //Update valve data when first powered on for (byte i = 1; i <= NUMBER_OF_VALVES; i++) { lcd.clear(); goGetValveTimes(); } lcd.clear();I think that it is just after that for loop, or after the lcd.clear(); that it is supposed to set inSetup to false. I have not tested this theory yet as I need to unmount my controller and open it up to push the new code to it, but I am pretty sure that this is the issue. That would explain why everything else with it appears to work normally.
I double checked with the example code on the build page to see if possibly I may have deleted something when doing my edits. Looking it over, I found the same thing. If you ask me, this looks to be a bug in the code and it should be fixed and updated.
@dbemowsk
I am in front of my computer and I have my controller in front of me and hooked up. Give me a couple minutes and I will run it. See what happens. -
I just made the change and tested it. That was definitely the problem. Works perfect now.
Not sure who can change the example code, but all that needs to be added is this:
// //Update valve data when first powered on for (byte i = 1; i <= NUMBER_OF_VALVES; i++) { lcd.clear(); goGetValveTimes(); } lcd.clear(); //Add this line inSetup = false; -
I just made the change and tested it. That was definitely the problem. Works perfect now.
Not sure who can change the example code, but all that needs to be added is this:
// //Update valve data when first powered on for (byte i = 1; i <= NUMBER_OF_VALVES; i++) { lcd.clear(); goGetValveTimes(); } lcd.clear(); //Add this line inSetup = false;@dbemowsk
You beat me too it. I added the same line in same location and it works perfect. Every so often I see the raindrop icon to show that it is pulling data to update the valve times. -
So it is definitely a confirmed bug. I ended up finding some old sample code from when I started this last year and this bit of code was actually in the setup method and not in goGetValveTimes:
lcd.print(F(" Updating ")); lcd.setCursor(0, 1); lcd.print(F(" Valve Data: ")); lcd.print(valveIndex);So some time in the past year the sample code had been changed.
-
So it is definitely a confirmed bug. I ended up finding some old sample code from when I started this last year and this bit of code was actually in the setup method and not in goGetValveTimes:
lcd.print(F(" Updating ")); lcd.setCursor(0, 1); lcd.print(F(" Valve Data: ")); lcd.print(valveIndex);So some time in the past year the sample code had been changed.
-
Hi I just order all the parts that was listed. Do I need to read the 230 post or it's ok just watched the video.
@tombstone You shouldn't need to read all the posts. Maybe just search the thread if you run into any snags. What kind of setup are you dropping this into? Do you currently have valves installed? Does your setup have a master valve or pump relay? Is it a standard 24V AC system?
-
Its my 1st project and I have learnt alot but have got myself a snag and I am getting this....
Arduino: 1.8.3 (Windows 10), Board: "Arduino Pro or Pro Mini, ATmega328 (5V, 16 MHz)"
C:\Users\HTPC\Documents\Arduino\Irrigation_Controller_1\Irrigation_Controller_1..ino:82:21: fatal error: TimeLib.h: No such file or directory
#include <TimeLib.h>
^compilation terminated.
exit status 1
Error compiling for board Arduino Pro or Pro Mini. -
ok I almost there :-D but my pro mini has just Analog 1 to 3. I say I have to change the coda were abouts...
I also have not setup up my Vera Controller as I see you have to pay...Is there another one that is eazy as I have try some but can not get it to work. eg HomeGenie is download and on my pc but don't think its not to good. don't know how to find my pro mini. happy to chagaen to someing eazer to get me started thanks guys....
-
If you are looking for Software, try openhab.
You need to buy Vera, but the software is free.
@Black-Cat thanks 😁