atanisoft / ESP32CommandStation

An ESP32 based DCC Command Station with integrated OpenLCB (LCC) --- NOTE: this project is not under active development.
https://atanisoft.github.io/ESP32CommandStation/
GNU General Public License v3.0
90 stars 34 forks source link

GPIO0 does not get saved #8

Closed dtworth closed 5 years ago

dtworth commented 6 years ago

It looks like the line "if(sensor->getPin() > 0) {" was added to "SensorManager::store()" . Maybe it should be "if(sensor->getPin() >= 0) {" since GPIO0 is a valid port.

atanisoft commented 6 years ago

While GPIO 0 is a valid pin, it has a few restrictions on its use since it is directly tied to the boot process. If you connect a sensor to this pin and it pulls the pin LOW when the esp32 is booting the boot process will be interrupted on the esp32. GPIO 0 should be avoided for inputs and should likely be rejected as a sensor pin.

atanisoft commented 6 years ago

GPIO2 is similar in this regard. https://github.com/espressif/esptool/wiki/ESP32-Boot-Mode-Selection

dtworth commented 6 years ago

Perhaps you should prevent that pin from being defined as an input in the first place. The command <S 0 0 0> still works.

atanisoft commented 5 years ago

this has been included in the development branch with plans to be included in the v1.2.0 release planned for this coming weekend.