Page 1 of 1

STA is connecting, scan are not allowed! - even when STA is connected

Posted: Thu Jan 10, 2019 12:04 am
by jcsbanks
"STA is connecting, scan are not allowed!"

I would like to be able to do a scan without disconnecting an existing STA connection (which has an IP address) and doesn't appear to be logging any events to suggest there is a problem.

The occurrence seems random.

I cannot find good solutions on searching.

Looking for the string, it is in libnet80211.a so I cannot play with the source code to try to get it to return a useful event.

Re: STA is connecting, scan are not allowed! - even when STA is connected

Posted: Fri Jan 11, 2019 7:20 pm
by jcsbanks
Any ideas on this welcomed. I just cannot find a way of detecting when this has occurred, no WiFi event is triggered, so I cannot disconnect and try again.

I can disconnect and a scan always works, but then I have disconnected most of the time without good reason.

Re: STA is connecting, scan are not allowed! - even when STA is connected

Posted: Sun Jan 13, 2019 1:51 pm
by jcsbanks
Best solution I have found so far is to do esp_wifi_disconnect() before doing a scan, and esp_wifi_connect() after. A scanning event bit prevents attempted reconnections during the scan.

Javascript code in the served page starts reloading the page after a 3s delay if the IP address was not 192.168.4.1 so that if the page was served through the ESP32's STA IP address it can receive the scan results.

Any better ideas are welcomed.

Re: STA is connecting, scan are not allowed! - even when STA is connected

Posted: Mon Jan 14, 2019 3:28 am
by hassan789
The issue is likely related to this issue:
https://github.com/espressif/esp-idf/issues/2125

If that is the case, there is no fix (as I understand it).