DigitalWrite not working after OTA update

Hi, I have a Node MCU project to open my electric gate which has been running for many weeks now ok. In the last update I added OTA functionality and this worked fine. This morning I changed one line of code and now no “digitalWrite” functions work where they are called from a virtual pin routine.
I.e i have a small routine that is called when a virtual button is pressed. In the routine a virtual led is lit and a digitalWrite to D2 is called to turn on a relay. This function no longer works, the virtual led is lit, so I know the function is called but the relay never operates. In desperation I added a button to directly turn on D2, no code just the button directly accessed D2 and this works fine. No digitalWrite in any function associated with a virtualWrite works.
Has there been some system update today that may have caused this??
Thanks

I’ve not heard of any changes that would have caused this, and you can guarantee that the forum would be lit-up like a Christmas tree if that had happened.

I guess the obvious things to check are whether you’ve used the correct board type when compiling the code, and whether there are any simple errors that have crept in when you added in the OTA stuff.

Maybe post your code?

Pete.

Morning Pete,
Thank you for your suggestion on board type.
I am using Node MCU dev 12, Node MCU minis, ESP32 and Arduinos on various projects, so I keep a track of settings in the header section for each project (Board type, Port and speed settings etc).
On this project I am using a Wemos Mini D1 which I had in the header and I’m sure it worked ok when connected via USB, however I experimented with all the different Mini boards and found the LOLIN (Wemos) D1 R2 board to work just fine. Happiness restored.
Again many thanks for your suggestion.
John.

1 Like