-->
Page 1 of 2

SoftAP always active. How can I disable it ?

PostPosted: Sun Oct 09, 2016 2:57 am
by chip273
Hi,
I am just starting with ESP8266, but I did quite some arduino projects in the past. Therefore I decided to go with the Arduino library for the ESP8266. I have bought some ESP-12 modules and wireed them up on a breadboard.

I currently try to switch GPIO pins from my webbrowser. The ESP is connected to my home router AP. The esp hosts a rudimentary HTTP website.
Essentially I use the WiFiWebServer example without modification.

My problem is that even though I tell the ESP to connect to my existing wifi AP, the ESP itself also starts in SoftAP mode. This in itself would not be totally bad, but it also interferes with the GPIO pins behaviour. When I try to connect to the ESP SoftAP the GPIO pins go low for a really short break a couple times. (The LED hooked up to GPIO2 blinks a couple times, although I expect it to light up steadily)

Unfortunately it seems I can not find any documentation which tells me how to actively disable the SoftAP mode. Only how to activate it. But it is active without me putting code to activate it.
How do I fix this behaviour ?

Re: SoftAP always active. How can I disable it ?

PostPosted: Wed Oct 12, 2016 9:26 am
by martinayotte
To force to the STA only, simply use WiFi.mode(WIFI_STA), but I doubt this is related to your issue, since nothing about the mode is relevant with GPIO states.

Re: SoftAP always active. How can I disable it ?

PostPosted: Wed Oct 12, 2016 10:04 pm
by chip273
Thanks for the tip.
Actually I had tried WiFi.setmode(WIFI_STA); since I had found that on some webpage, but it did not work(did not compile with some error). Seems the call was moved to WiFi.mode(WIFI_STA);.

I have helped myself by calling WiFi.softAPdisconnect(false); and WiFi.enableAP(false); both together in a row. This also disabled the integrated Soft AP. Curiously after calling this once in a sketch (and uploading & running it once) I never needed to call it again. The soft AP did not appear again.

Maybe there was some setting being retained even across firmware uploads ?
I did not investigate the GPIO problem described further, as there is no Soft AP it seems to not appear anymore.

Re: SoftAP always active. How can I disable it ?

PostPosted: Sat Oct 15, 2016 4:02 pm
by drifterz28
I use this
Code: Select allWiFi.softAP("SomeESP", "nothingyoucanfindout", 1, 1);