B4R Question ESP8266 Reset WiFi settings

Discussion in 'B4R Questions' started by janderkan, Oct 27, 2019.

  1. janderkan

    janderkan Active Member Licensed User

    There are a lot of post about it:
    https://www.b4x.com/android/forum/threads/esp8266-wifi-and-socket.69164/#post-438940
    https://www.b4x.com/android/forum/threads/not-possible-to-remove-wemos-mini-accesspoint.72501/
    https://www.b4x.com/android/forum/threads/wifi-library-and-wifi-startaccesspoint.77655/#content
    https://www.b4x.com/android/forum/t...ped-without-powering-down.106363/#post-665913
    These posts helped many but unfortunately not me.
    If I once had started an access point on my ESp8266, it would continue to start the AP every time I turned ESP on.
    Now I found the solution for me.
    Esp8266 from different vendors have different default settings.
    The important setting is PERSISTENT.
    https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/generic-class.html#persistent
    If this is set to True, all wifi settings will be the same on boot up.
    This is what helped me:
    Code:
    private Sub ResetWifi
        RunNative(
    "StopPersistent",Null)
        RunNative(
    "StopAP",Null)
    End Sub

    #if C
    void StopAP(B4R::Object* o) {
         WiFi.softAPdisconnect(true);
    }
    void StopPersistent(B4R::Object* o) {
         WiFi.persistent(false);
    }
    #end if
     
    inakigarm and Johan Schoeman like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice