Hi,
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 🙂