Page 1 of 1

Can't connect to Wifi automaticly Unless i reboot ESP32

Posted: Mon Jul 25, 2022 11:26 am
by Nas Ro
Hi, This is may first Time using ESP RM
it work's well but every time when i lost WIFI connection i need to reboot My ESP
1. is there a way to activate Auto connect
2. How can i activate Local control using Arduino IDE

Re: Can't connect to Wifi automaticly Unless i reboot ESP32

Posted: Tue Jul 26, 2022 4:00 pm
by sanketwadekar
To auto connect to WiFi, you can create an event handler function like this.

Code: Select all

void WiFiEvent(WiFiEvent_t event, arduino_event_info_t info){
  switch(event){
    case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
      Serial.println("Disconnected from station, attempting reconnection");
      WiFi.reconnect();
      break;
    default:
      break;
  }
}
And then in setup() function of Arduino, add the following statement.

Code: Select all

WiFi.onEvent(WiFiEvent);
I have tried and tested this on ESP32 using Arduino 1.8.3

Re: Can't connect to Wifi automaticly Unless i reboot ESP32

Posted: Wed Jul 27, 2022 11:33 am
by Nas Ro
Yes it's work for me thank you
what about activate local control using Arduino IDE is that option available :?:
i see it here but can't understand who can i use it using Arduino IDE
https://rainmaker.espressif.com/docs/local-control.html