Simple 4 relay irrigation scheduler

@Chrisdo44 please don’t post unformatted code.
You need triple backticks at the beginning and end of your code, which look like this:
```

Pete.

Dudndndndsn

@daveblynk are your cats sleeping on your keyboard again? :rofl:

Pete

1 Like

No playing tag…

in 2 months, it will be 1 year.
Who I am?
:joy::joy::joy:

hello community

I’m a absolut beginner with blynk and programming and trying to build this project.
I have programmed the sketch from hagay (post 56) in this thread and the QR code in post 58.

almost everything is working accept the scheduler function.I can set the on/off time but after that nothing is happening.

Direct switching and the “active now” function is working correctly.
I’m using a NodeMCU V3.

What is going wrong? all help is appreciated…

(sorry for my bad english, its not my native language)

Just check whether you have the RTC widget in the dashboard and also check if you have the right timezone selected.

Can you please share the qr code of the project?

Is there a problem with the QR code that has already been shared?

Pete.

Qr code invalid message

This is the sketch and qr code I tried.
https://community.blynk.cc/t/simple-4-relay-irrigation-scheduler/24047/23?u=matchless

Now i have tried a different sketch and code later in this thread and now it is working correctly.
Next challenge is te implement a moisture sensor wich switches a relais on and off

Hi,

I just join this community. I love this project and would like to implement it but using ESP32 instead of ESP8266. @hagay would it work on the fly with ESP32 or which part do I need to change. Would appreciate if you can point me to the right directions or some hints.

TIA.

Nik

You’d need to change these two lines for the ESP32 versions:

And you’d need to review/change the GPIO pins that are used to ensure that you’re using ones that are appropriate for the ESP32 (probably GPIO18 onwards).

This topic, and the topics/links that are provided as you read on give all the info you’ll need about GPIOs on the two board types:

Pete.

Thanks a lot. That should get me started.

Regards

Nik

I have clone the github code and upon trying to compile it (no changes made whatsoever yet),I got these error messages. Can’t figure out what are they. Please help.

Note: I am trying to compile it for ESP8266 board, have not try to change it to ESP32 yet.

    Arduino: 1.8.12 (Mac OS X), Board: "NodeMCU 0.9 (ESP-12 Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

In file included from /Users/nikfahmi/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.1/tools/sdk/libc/xtensa-lx106-elf/include/sys/stdio.h:6:0,
                 from /Users/nikfahmi/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.1/tools/sdk/libc/xtensa-lx106-elf/include/stdio.h:63,
                 from /Users/nikfahmi/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.1/cores/esp8266/Arduino.h:32,
                 from sketch/ESP8266_scheduler.ino.cpp:1:
/Users/nikfahmi/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.1/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h:25:130: error: 'const char HTTP_HEAD []' redeclared as different kind of symbol
   #define PROGMEM __attribute__((section( "\".irom.text." __FILE__ "." __STRINGIZE(__LINE__) "."  __STRINGIZE(__COUNTER__) "\"")))
                                                                                                                                  ^
/Users/nikfahmi/Documents/Arduino/libraries/WhareHauoraWiFiManager/WiFiManager.h:25:24: note: in expansion of macro 'PROGMEM'
 const char HTTP_HEAD[] PROGMEM            = "<!DOCTYPE html><html lang=\"en\"><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\"/><title>{v}</title>";
                        ^
In file included from /Users/nikfahmi/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.1/libraries/ESP8266HTTPUpdateServer/src/ESP8266HTTPUpdateServer.h:4:0,
                 from /Users/nikfahmi/Documents/GitHub/ESP8266_scheduler/ESP8266_scheduler.ino:70:
/Users/nikfahmi/Library/Arduino15/packages/esp8266/hardware/esp8266/2.7.1/libraries/ESP8266WebServer/src/ESP8266WebServer.h:34:39: error: previous declaration of 'HTTPMethod HTTP_HEAD'
 enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
                                       ^
exit status 1
Error compiling for board NodeMCU 0.9 (ESP-12 Module).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

The code from here:


compiles fine for me with ESP Core 2.7.1 (which is what you are using) and WiFiManager 0.15.0

What version of WiFiManager do you have installed?

Pete.

Thanks so much Pete. Apparently I have installed the wrong WifiManager. The code now compiled ok after installing the right version you mentioned.

Thanks again.

Nik

Well, I got the code compiled ok and managed to upload it to my Nodemcu V3. I thought everything was ok and today I tried the Blynk app… scan the QR code into Blynk app, paid some energy to get it going but then I hit a snag.

The app was working for a few minutes then it said it is offline. Checked the serial monitor and found this msg…

deactivate all schedulers
     ets Jan  8 2013,rst cause:2, boot mode:(3,7)

    load 0x4010f000, len 3456, room 16 
    tail 0
    chksum 0x84
    csum 0x84
    va5432625
    ~ld
    dZmXy3nPvZHIU9NCHrjLC1hfFgu7XxlL
    blynk-cloud.com
    8442
    *WM: Adding parameter
    *WM: 
    *WM: Adding parameter
    *WM: blynk-token
    *WM: Adding parameter
    *WM: blynk-server
    *WM: Adding parameter
    *WM: blynk-port
    *WM: 
    *WM: AutoConnect
    *WM: Connecting as wifi client...
    *WM: Status:
    *WM: 0
    *WM: No saved credentials
    *WM: Connection result: 
    *WM: 0
    Entered config mode
    192.168.4.1
    AutoConnectAP

It seems the Nodemcu reset and it wiped the autoconn data to login to my router. I went in again into AutoConnectAP to save my ssid and password, it will work again for a minute then it start to happen all over again.

What is wrong with this… is my NodeMCU faulty? Or it is because I haven’t add any relay yet to it as I’m still waiting for the relays to arrive from China.

Still trying to troubleshoot the above. Is gpio used correct {14,24,24,24}?

[Unformatted text removed by moderator]

Hi all.
I just got the code working on a node mcu and breadboard. Works great! Many thanks!
Is there way i can convert the basic code so one schedule will run sequential after the previous has finished?
i know i can use separate star times for each schedule but it is more practical to schedule one timer and have the rest run sequential.
The problem is that i cant have all three zones of my garden “on” at the same time.
Thanks