turgu1 / ESP-IDF-InkPlate

A porting effort to the ESP-IDF framework for the e-Radionica InkPlate software.
15 stars 9 forks source link

Fixed AP reconnection not working properly due to default netif not b… #22

Open tajnymag opened 1 year ago

tajnymag commented 1 year ago

Fixes inkplate.joinAP() not being able to reconnect to any other AP after the initial connection. The error comes from default esp netif not being cleared on disconnect.

tajnymag commented 11 months ago

@turgu1

Found out joinAP is unable to reconnect if it doesn't initially succeed due to relying on the connected flag to check whether the device has established a successful connection.

I've added an additiona forceDisconnect method to NetworkClient which doesn't check whether connected flag is true. Furthermore, I changed the fatality for errors of esp_event_handler_unregister and esp_event_loop_delete_default, because I haven't found a way to check whether they the loop and handler are registered.