Page 1 of 1

esp_wifi_scan_start was ok now returns -1

Posted: Mon Apr 22, 2019 11:08 am
by andyhesp
Hi,

I have just started using Heltec WiFi LoRa 32(V2) in Arduino 1.8.9. I am using the default program WIFI_LoRa_32FactoryTest. This was OK and showed my WiFi Networks. I now start it and just get -2 networks found.

int n = WiFi.scanNetworks() is returning a value of -2.

In WiFiScan.cpp WiFiScanClass::scanNetworks calls esp_wifi_scan_start and will return WIFI_SCAN_FAILED (-2) if esp_wifi_scan_start does not return ESP_OK. I have since put in some code and found that esp_wifi_scan_start is returning -1.

Is there code available for esp_wifi_scan_start (I can't find it) so that I can see why it would return -1, or does anyone know what causes -1?

Thanks, Andy.

Re: esp_wifi_scan_start was ok now returns -1

Posted: Tue Apr 23, 2019 4:08 am
by boarchuz
You can't start a scan while connecting. Might that be it?