Ethernet re-connect after MCU reboot
-
Since I am not a professional programmer: Sorry if this is obvious and I am wasting your time Maybe you could point me in the right direction.
Setup: GuiO on a tablet and ESP32S3 on local WiFi network, Arduino IDE to program the ESP32
How is re-connecting handled on a local Ethernet connection? It works fine for me via BT Classic or Serial, but not over WiFi on a local network.
My understanding is:
When the ESP32 reboots (i.e. after updating the Arduino sketch) Gui-O is oblivious to it having been away and sits around idly. Since the ESP32 only runs a server (and cannot act as client) it cannot instigate a new connection. So, the two cannot get together automatically?What works:
a) Restarting the GuiO app manually. It goes looking for the server, does the auto-connect, sends the “init” request and all works from there
b) I found a “Reset” button in the app. This works more conveniently, but I have not found a way to set the location of RST button, so it sits a little awkward over some other stuff
c) Is there another route I am missing? i.e. is there a port GuiO is listening to? So far I have (un-elegantly) been using the server on the esp32 to send instructions to the GuiO app, rather then using a client to connect to an unknown-to-me listener in the appIn another life, when the project is running, it’ll be fine. But while coding there is a frequent re-programming of the ESP32 and hence re-connecting
Also, it is also not the end of the world!
Greetings from Cologne
-
-
@wolerdbon Hi!
So, when you connect GUI-O app (client) to the ESP32 (server) a persistent connection is established. If the server closes the client connection, client will detect this and show an error. If autoconnect is enabled client will try to reconnect every 5 seconds...
When you just "kill" the server, the client is not disconnected properly and no "goodbye" message is sent. That is why nothing happens on the client side (there are ways to handle this, e.g., keep-alive as MQTT uses for example, but this is currently not implemented in Ethernet connection.
If you try the GUI-O design tool (and exit when the connection is established), you will notice that the client (GUI-O app) reacts immediately, because when the tool closes it implicitly disconnects the client.
I can suggest you use "home" button. So, when you reboot the ESP32, swipe GUI-O from the left side of the screen to the right to open the settings menu. Press the "home" button in the upper right corner.
Hope this helps.
Best regards,
Klemen