- Sun Aug 30, 2020 3:16 pm
#88576
I'm using a Wemos D1 mini to control 3 relays using a browser. I started first with NodeMcu and Lua script. The web UI has 2 pages. One to control the relays and one config page, where I can setup the Wemos to work as client (STA) or access point (AP), IP address, basic authentication etc. On the config page I put a reboot button, which reboots the Wemos. With NodeMcu the Wemos D1 reboots and preserves the output state of the 3 GPIO's. Meaning if a relay was on it stays on after the restart.
Some weeks ago I switched to Arduino (using PlatformIO). I programmed a sketch with same functionality as the Lua program. The only difference is that when I reboot the Wemos the relays are switched off (if they where on) during the reboot.
Does somebody knows how NodeMcu achieve it to preserve the GPIO output state with Lua (node.rstart())? And is it possible to do the same with Arduino?