OpenSprinkler › Forums › OpenSprinkler Unified Firmware › ESP32 port of 2.1.9 firmware
- This topic has 129 replies, 17 voices, and was last updated 7 months, 3 weeks ago by v1pr.
-
AuthorPosts
-
May 20, 2020 at 10:07 am #66192
ja.charerParticipantHi 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
May 20, 2020 at 1:02 pm #66195
RayKeymasterNice. Thanks for sharing!
May 27, 2020 at 4:51 am #66429
agisofttmParticipantja.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
May 29, 2020 at 4:51 am #66471
ja.charerParticipantHi 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
June 23, 2020 at 5:28 am #66954
cherokeecruiser2ParticipantHi,
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
June 25, 2020 at 9:43 am #66988
ja.charerParticipantTnx cherokeecruiser2 for finding this obvious error… I wonder how my test environment works with that…
Github updated
August 21, 2020 at 8:53 am #67974
dmaciasParticipantThanks. 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.
August 22, 2020 at 6:03 pm #67989
arigitaParticipantI 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.
Attachments:
August 23, 2020 at 5:21 pm #68005
RayKeymasterNeat. Thanks for sharing!
August 23, 2020 at 5:30 pm #68006
Herik63SpectatorHi 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/y3cwgdjhthe 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 definedseems 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?
August 24, 2020 at 7:10 am #68011
cherokeecruiser2ParticipantHi,
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….
August 24, 2020 at 7:17 am #68012
Herik63SpectatorThank 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! 🙂
August 24, 2020 at 8:30 am #68015
cherokeecruiser2ParticipantThe 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 perfectlyAugust 24, 2020 at 12:24 pm #68018
RayKeymasterThe 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);
August 24, 2020 at 1:23 pm #68019
Herik63SpectatorWonderful news, I already requested a rtc module but is not a big issue.
many thanks for your help 🙂August 24, 2020 at 1:59 pm #68020
Herik63SpectatorMany thanks, I was unsure 🙂
at this point i will go for it, since is arriving soon and is just 4 pin to connect.
August 30, 2020 at 2:07 pm #68092
arigitaParticipantSome 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.
Attachments:
August 31, 2020 at 6:48 pm #68111
RayKeymasterSeptember 2, 2020 at 2:47 pm #68131
ja.charerParticipantWow, 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
September 4, 2020 at 1:38 am #68155
arigitaParticipantHi 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 itBR
October 7, 2020 at 2:46 pm #68432
arigitaParticipantHi,
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 flashingWhat 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 workPending 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 yetAs 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
Attachments:
November 8, 2021 at 2:49 pm #71593
zenonmbParticipant@ Javier,
have you tried the rain sensor?November 8, 2021 at 4:24 pm #71597
arigitaParticipantNo, 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
November 9, 2021 at 8:26 pm #71616
zenonmbParticipantJavier,
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…….
November 10, 2021 at 1:02 pm #71621
zenonmbParticipantFound 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? -
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › OpenSprinkler Unified Firmware › ESP32 port of 2.1.9 firmware