OpenSprinkler Forums OpenSprinkler Unified Firmware ESP32 port of 2.1.9 firmware

Viewing 20 posts - 1 through 20 (of 20 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

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

OpenSprinkler Forums OpenSprinkler Unified Firmware ESP32 port of 2.1.9 firmware