esp_wifi_scan_start was ok now returns -1

andyhesp
Posts: 1
Joined: Mon Apr 22, 2019 10:44 am

esp_wifi_scan_start was ok now returns -1

Postby andyhesp » Mon Apr 22, 2019 11:08 am

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.

boarchuz
Posts: 559
Joined: Tue Aug 21, 2018 5:28 am

Re: esp_wifi_scan_start was ok now returns -1

Postby boarchuz » Tue Apr 23, 2019 4:08 am

You can't start a scan while connecting. Might that be it?

Who is online

Users browsing this forum: No registered users and 146 guests