Basic Issue: Wifi Scanning returns no access point even when the APs are present

rf.akram.karimi
Posts: 4
Joined: Thu Sep 14, 2017 11:22 am

Basic Issue: Wifi Scanning returns no access point even when the APs are present

Postby rf.akram.karimi » Sun Sep 17, 2017 10:13 am

Hello everyone,
I am pretty new to ESP32 (and using Sparkfun ESP32 Thing board) and stuck with a very basic thing.
I successfully brought up the Arduino as well as ESP-IDF development environments (verified with blinky LED); but when I tried running WiFi Scan code from the following github link:

https://github.com/VALERE91/ESP32_WifiScan
I did not make any change to it.

I got the message (in monitor) saying that:
Number of access points found: 0
(Same result in ESP-IDF as well as in Arduino)

Here is the detailed output on monitor:

Code: Select all

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0010,len:4
load:0x3fff0014,len:4552
load:0x40078000,len:0
ho 12 tail 0 room 4
load:0x40078000,len:11460
entry 0x40078cc4
W (25) rtc_clk: Possibly invalid CONFIG_ESP32_XTAL_FREQ setting (26MHz). Detected 26 MHz.
I (927) cpu_start: Pro cpu up.
I (927) cpu_start: Single core mode
I (930) heap_init: Initializing. RAM available for dynamic allocation:
I (963) heap_init: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (1019) heap_init: At 3FFB7550 len 00028AB0 (162 KiB): DRAM
I (1077) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (1137) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (1197) heap_init: At 4008EBFC len 00011404 (69 KiB): IRAM
I (1255) cpu_start: Pro cpu start user code
I (1415) cpu_start: Starting scheduler on PRO CPU.
I (1473) wifi: wifi firmware version: 4acbf1f
I (1473) wifi: config NVS flash: enabled
I (1473) wifi: config nano formating: disabled
I (1474) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (1484) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (1508) wifi: Init dynamic tx buffer num: 32
I (1508) wifi: Init data frame dynamic rx buffer num: 32
I (1508) wifi: Init management frame dynamic rx buffer num: 32
I (1512) wifi: wifi driver task: 3ffbd284, prio:23, stack:4096
I (1517) wifi: Init static rx buffer num: 10
I (1521) wifi: Init dynamic rx buffer num: 32
I (1526) wifi: Init rx ampdu len mblock:7
I (1529) wifi: Init lldesc rx ampdu entry mblock:4
I (1534) wifi: wifi power manager task: 0x3ffc26fc prio: 21 stack: 2560
I (1593) phy: phy_version: 359.0, e79c19d, Aug 31 2017, 17:06:07, 1, 0
I (1596) wifi: mode : sta (24:0a:c4:81:66:c8)
Number of access points found: 0
Number of access points found: 0
Number of access points found: 0
Number of access points found: 0
Number of access points found: 0
Number of access points found: 0
Number of access points found: 0
Number of access points found: 0
Number of access points found: 0
Number of access points found: 0
Number of access points found: 0
Number of access points found: 0
Number of access points found: 0
Number of access points found: 0
My question is, why my board (ESP32) is unable to find the APs?
Also I have tried connecting to a mobile hotspot and unable to do it.

Can anyone help me with this issue?
Thanks

User avatar
xvinny
Posts: 12
Joined: Wed Aug 16, 2017 1:15 pm
Location: Curitiba, Brazil

Re: Basic Issue: Wifi Scanning returns no access point even when the APs are present

Postby xvinny » Tue Feb 06, 2018 7:09 pm

I'm also getting this same issue.
Anyone??
___________________________________________________________________________________________________________________________
Tell me if you knows how to use the Programmer module of Windows Calc and I'm gonna say who you are.

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Basic Issue: Wifi Scanning returns no access point even when the APs are present

Postby fly135 » Sun Feb 18, 2018 4:22 pm

I just needed to add this function to my project. And I too found I got no responses. One thing I found that was a problem is the channel parameter. The docs say it's the channel to scan. But the docs don't say anything about scanning all the channels. So I put the scan call in a loop incrementing the channel number each time and was able to get the access points.

I also set the scan_type to WIFI_SCAN_TYPE_ACTIVE and the scan_time min/max to 500/1500, but I don't know that was necessary.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Basic Issue: Wifi Scanning returns no access point even when the APs are present

Postby kolban » Mon Feb 19, 2018 4:44 am

If we look at the parameters to a WiFi scan, we see that it is of type "wifi_scan_config_t". Looking at the current structure definition here ...:

https://github.com/espressif/esp-idf/bl ... pes.h#L130

We see that it contains more fields that are initialized in your sample source. I would suggest setting all the fields in the structure, not just some of them. As time passes, the ESP-IDF adds/changes the API structures so make sure that you check older code fragments to ensure that they still match execptations of the ESP-IDF API.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: Basic Issue: Wifi Scanning returns no access point even when the APs are present

Postby fly135 » Mon Feb 19, 2018 3:42 pm

kolban wrote:If we look at the parameters to a WiFi scan, we see that it is of type "wifi_scan_config_t". Looking at the current structure definition here ...:
That was the first thing I tried. i.e. filling out all the parameters. Made no difference until I looped though each channel 1..13.

Code: Select all

  wifi_scan_config_t scanConf = {
    .ssid = NULL,
    .bssid = NULL,
    .channel = 0,
    .scan_time.active = {
      .min = 500,
      .max = 1500
    },
    .scan_type = WIFI_SCAN_TYPE_ACTIVE,
    .show_hidden = false
  };

Who is online

Users browsing this forum: No registered users and 274 guests