OpenSprinkler Forums OpenSprinkler Unified Firmware ESP32 port of 2.1.9 firmware

Viewing 25 posts - 1 through 25 (of 125 total)
  • Author
    Posts
  • #66192

    ja.charer
    Participant

    Hi all
    If anyone interested here is a link to  ESP32 port of 2.1.9 firmware. As 8 base station are managed by GPIO pins you can build a system with some standard boards with limited soldering – what actually I did …

    have fun 🙂 

    https://github.com/JaCharer/OpenSprinkler-Firmware-ESP32port

    #66195

    Ray
    Keymaster

    Nice. Thanks for sharing!

    #66429

    agisofttm
    Participant

    ja.charer – thank for your effort, but I’ve a problem
    Everything is compiled without errors and when I uploaded to “Helltec ESP32 Kit Lora” it doesn’t boot at all. What I change is the SDA and SCT pins, because this Helltec module have included led display on that ports. Is this change of SCL and SDA can cause problems?

    Thank you in advance

    #66471

    ja.charer
    Participant

    Hi agisofttm

    Problem may be different as a your board has a lora which is using GPIO’s {5,14,18,19,26,27) and GPIO 16 for OLED reset.

    In my esp32.h I use some of those pins for controlling a station “#define ON_BOARD_GPIN_LIST {12,13,14,15,16,255,255,255}” and button 3 “#define E0_PIN_BUTTON_3 26”. This may bring a conflicts.

    So my suggestion is to redefine all necessary buttons, sensor and station gpios to avoid conflicts

    #66954

    cherokeecruiser2
    Participant

    Hi,

    Thanks for all the effort of porting to the ESp32.

    I have an ESp32 WROOM with external OLED on pins SDA 21 and SCL 22. Everything compiled without errors, but after it uploaded, it would only continually reboot and never start.

    I have modified a small piece of code in mainArduino

    The Original Code:

    
    #if defined(ESP32)
    
      int i;
      unsigned int pin_list[] = ON_BOARD_GPIN_LIST;
      for( i=0; i<7; i++ ){
        if(pin_list[i] !=255){
          pinMode(i, OUTPUT);
          digitalWrite(i, ~STATION_LOGIC);
        }
      }
    

    Changed to this:

    
    #if defined(ESP32)
    
      int i;
      unsigned int pin_list[] = ON_BOARD_GPIN_LIST;
      for( i=0; i<8; i++ ){
        if(pin_list[i] !=255){
          pinMode(pin_list[i], OUTPUT);
          digitalWrite(pin_list[i], ~STATION_LOGIC);
        }
      }
    
    #endif
    

    I believe the original code was potentially setting pins 6 and 7 which on this version of ESP32 are connected to the integrated SPI flash, and causing the crash reboot cycle.

    It now works perfectly for me – hope it helps for someone else

    #66988

    ja.charer
    Participant

    Tnx cherokeecruiser2 for finding this obvious error… I wonder how my test environment works with that…

    Github updated

    #67974

    dmacias
    Participant

    Thanks. Moved to an ESP32D from an ESP8266. Ditched the IO board and now just using the ESP32 pins. Everything works great. Much more responsive too. Any plans to update to 4.1.9(4). Just asking before I forked and put time into it.

    #67989

    arigita
    Participant

    I have created two prototype board variants from Opensprinkler in Kicad. The first one based on the TTGO V2.1 1.6 (ESP32 Lora Board) and the second a dual board that can accommodate an esp32-wroom or an ESP-12E (ESP8266) plus a lora E22-900M3DS-SX1262 module. Once tested I will release all Kicad files. The board are initially meant to control AC valves, but I might develop as well DC valve variants.

    #68005

    Ray
    Keymaster

    Neat. Thanks for sharing!

    #68006

    Herik63
    Spectator

    Hi all,

    I assembled a Heltech module with this firmware and, after some variations of the pins, I achieved a working system, for your reference i used this module:
    https://tinyurl.com/y3cwgdjh

    the variations:
    #define SDA_PIN 4 // I2C pin definition
    #define SCL_PIN 15
    #define ON_BOARD_GPIN_LIST {13,17,18,19,16,255,255,255} // ESP32 on board gpins to be usead as sections, 255 – pin not defined

    seems everything is fine, but the ntp connection is not working properly: after some hours the system is in the future: april 2078 😀
    I tried to reset everything with the external keys as mentioned in the manual, and putting 0.0.0.0 as ntp server, but no success 🙁

    any idea?

    #68011

    cherokeecruiser2
    Participant

    Hi,

    When I first loaded the firmware onto an ESP32, I didn’t have a RTC module connected. It functioned fine, got the time from the NTP server, but after a while it behaved in a similar manner as described. I can’t remember if it was the same date as you were getting, but it didn’t happen anymore after I connected a working RTC module. Not sure if that helps….

    #68012

    Herik63
    Spectator

    Thank you for the reply, this make sense since the firmware was compliled for using a RTC…

    what is the connection for the RTC? same as display (in my case #define SDA_PIN 4 SCL_PIN 15) the adress is different for the module, isn’t it?

    Many thanks for your help! 🙂

    #68015

    cherokeecruiser2
    Participant

    The RTC module SDA and SCL pins connect to the same I2C pins as the Display, along with power and ground.
    You are correct that the address is different for the RTC module. The firmware identifies which type of RTC is present.
    I used a DS3231 module, and have also tried a DS1307 as well. Both worked perfectly

    #68018

    Ray
    Keymaster

    The firmware github has a pull request that allows disabling RTC:
    https://github.com/OpenSprinkler/OpenSprinkler-Firmware/pull/118/
    In essence, if you don’t plan to have RTC, just go to main.cpp and comment out the following lines:

    setSyncInterval(RTC_SYNC_INTERVAL);  // RTC sync interval
    setSyncProvider(RTC.get);
    #68019

    Herik63
    Spectator

    Wonderful news, I already requested a rtc module but is not a big issue.
    many thanks for your help 🙂

    #68020

    Herik63
    Spectator

    Many thanks, I was unsure 🙂

    at this point i will go for it, since is arriving soon and is just 4 pin to connect.

    #68092

    arigita
    Participant

    Some news on my side, the first TTGO version boards (v1) came and they are running fine with a modified code from the ja.charer fork. I had to do some small bug fix for the rtc and need still need to change one diode to allow proper current measurement with the ESP32 (the ADC is worse than the ESP8266 one). Attached you can find the pictures. Soon I will get the version 2 produced and start working on the LoRa driver to remotely control the irrigation system w/o need of internet.

    From this version 1 (TTGO based) I have 5 boards, but will need just 2 of them. In case of interest in any of the 3 remaining boards please let me know.

    #68111

    Ray
    Keymaster

    Looking nice

    #68131

    ja.charer
    Participant

    Wow, looks like you made great progress since I’ve been here last time.

    Answering some questions:
    1. I’ve never tested firmware without RTC however if a bug is present it should be also for ESP8266 (or is in ESP32 NTP library)…
    2. I do consider porting the last MQTT version also, however I wait till the final version will be released with MQTT subscription
    3.  @argita what RTC bug are you referring too ? If you have a spare board I would be interested…

    BR

    #68155

    arigita
    Participant

    Hi Ja.Charer,

    regarding the points:
    1) The RTC topic was a small HW bug in my board, it is solved. The current meas. does not work for the ESP32 as it is in V1 as the ESP32 can not read under 0.2V, I’ve changed it to an inverted precision amplifier with gain of 3 and now it is fine
    2) I’ve ported as well the latest main branch MQTT changes into my fork (ESP32_branch):
    https://github.com/arijav/AriloSprinkler-Firmware/tree/branch_dev_esp32
    3) For the board no issue, let me know how we can communicate and we can arrange it

    BR

    #68432

    arigita
    Participant

    Hi,

    one update on my side. The revision two has arrive and I’ve tested it. I have decided to modify it to fit all features of the standard Opensprinkler (Ethernet, RF Transmitter, etc…) and to remove the option for the ESP8266, as the ESP32 is working nicely. I have added as well an USB for flashing/debugging purposes and the fixation points are ready for DIN rails.

    The first boards contain some bugs that I have corrected already for the second batch:
    – The USB interface does not work (I have used the wrong pinout for the CP2102 chip)
    – The fixation points for the DIN rails and screen need to be slightly adjusted
    – The Ethernet CS pin needs to be rerouted to another GPIO of the ESP32, as it was using one reserved, that needed to be floating or grounded for flashing

    What has been tested:
    – The current measurement works nicely with a new inverted precision rectifier with gain of 3
    – Opensprinkler SW works nicely and web reaction is very fast
    – Valve control works
    – RTC works
    – Button switches work

    Pending of testing:
    – Ethernet: I will test it soon with an ENC28J60 module I have received
    – RF Transmitter: I will test it as soon as I receive the transmitter
    – E22-900M3DS-SX1262 long range LoRa module (SX1262): I have to create the SW for it yet

    As soon as I receive the second batch and get it tested I will release the KiCad schematics and layouts. Every eBoM part comes with an attribute for the part number in LCSC. Furthermore the boards can be easily produced using JLCPCB.

    BR,

    Javier

    #71593

    zenonmb
    Participant

    @ Javier,
    have you tried the rain sensor?

    #71597

    arigita
    Participant

    No, I have not tried it. The Lora module is however working nicely. I manage to connect in urban environment without any line of sight from my apartment to my city garden around 800m away and control all valves and programs as well as to read their status

    #71616

    zenonmb
    Participant

    Javier,

    Tried to compile your code and got an error .
    In file included from C:\Users\XXXXX\Documents\Arduino\OpenSprinkler-Firmware-ESP32port-master\mainArduino\mainArduino.ino:15:0:

    sketch\OpenSprinkler.h:37:26: fatal error: UIPEthernet.h: No such file or directory

    compilation terminated.

    And I think this error is correct. I do not see that file in your repository.BTW is not in the “regular”(Open sprinkler fw) firmware files repository either……
    In opensprinkler.h we have
    33#if defined(ARDUINO) // headers for ESP8266
    34 #include <Arduino.h>
    35 #include <Wire.h>
    36 #include <SPI.h>
    37 #include <UIPEthernet.h>

    So, in theory this file should not be called, since this is for Arduino…….

    #71621

    zenonmb
    Participant

    Found the problem. Library UIPEthernet was missing .The readme was key……
    Complied fine and is working.
    Question now is on station definitions. Should i select GPIO as type ? I am asking because I do not see any option for GPIO,to select which pin.
    In ESP32.h we have this

    #define ON_BOARD_GPIN_LIST {12,13,14,15,16,255,255,255} // ESP32 on board gpins to be usead as sections, 255 – pin not defined

    So i was expected to see those 5 pins as options for GPIO, but there is not any.
    Any suggestions?

Viewing 25 posts - 1 through 25 (of 125 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums OpenSprinkler Unified Firmware ESP32 port of 2.1.9 firmware