esp-rfid icon indicating copy to clipboard operation
esp-rfid copied to clipboard

Investigate Watchdog Reset on NodeMCU and refactor some parts

Open omersiar opened this issue 7 years ago • 3 comments

There are multiple reports that on NodeMCU boards have an issue about not getting out of boot loop.

  • [ ] Detect boot loop, escape somehow. e
  • [ ] Refactor C pointers, string duplication/copying, initialization of RFID readers.
  • [ ] Fix RC522 init code on library level?
  • [ ] Refactor what happens when Wi-Fi connection is lost
  • [ ] Try to regain wi-fi connection a few times if not successful start AP mode.

omersiar avatar Aug 28 '18 08:08 omersiar

+1 for the wifi option, was looking for that Was doing some rewiring and firmware update on my router. The ESP-RFID came online before the router was . Couldn't find the SSID and fallback into SofTAP never getting out of it.

koffienl avatar Aug 29 '18 20:08 koffienl

I noticed the project doesn't reconnect on a loss of wifi, for now I did this quick dirty solution:

void onWifiDisconnect(const WiFiEventStationModeDisconnected &event)
{
  writeEvent("WARN", "mqtt", "wifi disconnected, reboot in 120s", "ROO_DEBUG");
    mqttReconnectTimer.detach(); // ensure we don't reconnect to MQTT while reconnecting to Wi-Fi
    autoRestartIntervalSeconds = NTP.getUptimeSec() + 120;
}

I needed this because I have a Raspberry Pi acting as Access Point for the ESP-RFID. Due to some different delays on boot it takes 1 to 2 minutes to become fully operational. To long for the ESP-RFID so I have to walk to the hallway and toggle the power adapter. This is easier :P

koffienl avatar Sep 04 '18 16:09 koffienl

Thanks for your great work on this project!. I've noticed (like koffieni) that if nodemcu lost wifi connection (e.g. if i turn off my wifi router) it doesn't reconnect wifi when the router comes back on, and i need to press reset button. Is there a simple way to solve this problem? (i'm not a developer ...)

lb-ha avatar Oct 25 '18 20:10 lb-ha

I think now this is fixed :)

I'm going to close now, but please reopen if necessary!

matjack1 avatar Jan 23 '23 21:01 matjack1