OpenSprinkler › Forums › OpenSprinkler Unified Firmware › ESP32 port of 2.1.9 firmware
Tagged: ESP32
- This topic has 134 replies, 19 voices, and was last updated 3 months, 4 weeks ago by
dbmet.
-
AuthorPosts
-
May 9, 2024 at 7:59 am #78784
v1prParticipantThanks for the feedback @polskifacet. I did not had the time till now to work on the firmware. I was able to upgrade the firmware to the latest OS 2.2.0 (3), it’s in my git, if interested.
I’ll try to debug the sensor2 issue in the coming days.
@Ken.238 how is your expander board?May 31, 2024 at 5:23 pm #79028
romantaoParticipantHi,
Sometime ago I fixed this problem with sensor 2 but didnt have the opportunity to share it due to some permissions problem with my forum account.
The problem is in the usage of PIN_SENSOR2 define. When you use a #define, the compiler does the equivalent of a search-and-replace in your code, replacing all instances of that text with the value you specified. Then it compiles as normal.
When we compile the v1per project, with the esp32 variant this macro is not defined before compilation. E0_PIN_SENSOR2 is the one defined and then attributed to PIN_SENSOR2 in the opensprinkler.cpp in compilation time.
For that reason, the code blocks that configure the SENSOR2 input are not compiled, thus it becomes non functional.
Personaly, I’m not in favor of using ifdefines along the code to avoid strange problems like this.
Anyway, in this case my suggestion would be to change the #if defined(PIN_SENSOR2) with #if defined(E0_PIN_SENSOR2) or simply remove the V2 from the esp32.hpp file. It is the easiest fix that could address the variants based on esp32 that may not have this input configured. Since my hardware is based on the arilosprinkler pcb and has this input available, I just used #if defined(ESP32) as you can see in the diff file below.
Hope it helps others 🙂
Attachments:
June 3, 2024 at 1:30 pm #79072
v1prParticipantHi @romantao,
thanks for the details, but I don’t think you’re right. In the ESP32 var definitions in OpenSprinkler.cpp PIN_SENSOR2 gets a value, so the define should be “active”
`
PIN_RFRX = E0_PIN_RFRX;
PIN_RFTX = E0_PIN_RFTX;
PIN_BOOST = E0_PIN_BOOST;
PIN_BOOST_EN = E0_PIN_BOOST_EN;
PIN_SENSOR1 = E0_PIN_SENSOR1;
PIN_SENSOR2 = E0_PIN_SENSOR2;
`April 14, 2025 at 10:36 am #81876
v1prParticipantI’ve updated my repo and refreshed with the latest OS firmware.
April 14, 2025 at 10:49 am #81877
polskifacetParticipantWoot! Thanks man!!!
April 14, 2025 at 11:17 am #81878
v1prParticipant@romantao you were absolutely right, but I’ve overlooked the issue at least 3 times… the original #if defined(PIN_SENSOR2) comes from the original firmware source and I wanted to keep the code changes minimal. However, the original author(s) use a mixture of defines and “proper” variables with the same name/purpose (shu)… anyway, I’ve fixed it now.
November 14, 2025 at 3:48 am #84181
DesmoSpectatorI have just joined this topic. Much to read so excuse the shortcut. Does the 74HC595 shift register section and expander boards work on the ESP32 port? I have an ESP32C6 board with 4 GPIO Relays and LoRa. I also have 16 Port relay boards that drive solenoids. (I prefer relays in the farming environment as I have less failures from lightning) Currently I am using a Pi4 driving 32 relays(74HC595) with an ESP32 HTTP to LoRa gateway driving an additional 64 LoRa solenoids across the farm. I want to combine the Pi and Gateway into one ESP32C6 unit.
February 26, 2026 at 5:14 pm #84947
dbmetParticipantIs there any settings that need to be changed for the Esp32 to connect to my wifi, or will it create a AP so that I can enter my wifi credentials?
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › OpenSprinkler Unified Firmware › ESP32 port of 2.1.9 firmware
