OpenSprinkler Forums OpenSprinkler Unified Firmware ESP32 port of 2.1.9 firmware

Tagged: 

Viewing 8 posts - 126 through 133 (of 133 total)
  • Author
    Posts
  • #78784

    v1pr
    Participant

    Thanks 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?

    #79028

    romantao
    Participant

    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 🙂

    #79072

    v1pr
    Participant

    Hi @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;
    `

    #81876

    v1pr
    Participant

    I’ve updated my repo and refreshed with the latest OS firmware.

    #81877

    polskifacet
    Participant

    Woot! Thanks man!!!

    #81878

    v1pr
    Participant

    @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.

    #84181

    Desmo
    Spectator

    I 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.

    #84947

    dbmet
    Participant

    Is 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?

Viewing 8 posts - 126 through 133 (of 133 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums OpenSprinkler Unified Firmware ESP32 port of 2.1.9 firmware