ESP32 wifi scan not finding SSID [solved]

PeterR
Posts: 30
Joined: Mon Jun 04, 2018 2:47 pm

ESP32 wifi scan not finding SSID [solved]

Postby PeterR » Wed Jul 11, 2018 1:47 pm

I have tried 'simple_wifi', 'scan' and 'wpa2_enterprise' on ESP-WROVER-KIT and ESP-EVB.
I cannot see the devices SSID. Scan does not find any SSIDs and so not unsurprisingly 'wpa2_enterprise' does not connect, instead periodically reporting DISCONNECTED.

My phone can see at least 4 networks. The network I am trying to access is WPA2-PSK.

Not sure how I can get 'make flash monitor' wrong!

PeterR
Posts: 30
Joined: Mon Jun 04, 2018 2:47 pm

Re: ESP32 wifi

Postby PeterR » Wed Jul 11, 2018 2:14 pm

My bad, finger trouble with the SSID.

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

Re: ESP32 wifi

Postby fly135 » Wed Jul 11, 2018 10:40 pm

When you get the disconnect you can print the reason code.

system_event_sta_disconnected_t *disconnected;
...
case SYSTEM_EVENT_STA_DISCONNECTED:
disconnected = &event->event_info.disconnected;
eprintf(eLOG_WARNING,"SYSTEM_EVENT_STA_DISCONNECTED, ssid:%s, ssid_len:%d, bssid:" MACSTR ", reason:%d\n", \
disconnected->ssid, disconnected->ssid_len, MAC2STR(disconnected->bssid), disconnected->reason);

The reason codes are in .../components/esp32/include/esp_wifi_def.h

I have found that connecting to a WPA2 (not WPA/WPA2) results in a random number of disconnects before it finally connects and get the DHCP address.

I posted a question about it in the general forum but got no response. I'd be curious to know if you see these random number of disconnects with reason code 203 when talking to a WPA2 router.

John A

PeterR
Posts: 30
Joined: Mon Jun 04, 2018 2:47 pm

Re: ESP32 wifi scan not finding SSID [solved]

Postby PeterR » Fri Jul 13, 2018 11:28 am

Sure, will report when I have a view of Wifi disconnections and/or access issues.
The issue this time was a mistyped SSID. So the software was correct in periodically reporting DISCONNECTED (instead of disconnecting).

Working through the libwebsockets now as I cannot get reliable ethernet from the Olimex ESP32-EVB

jcsbanks
Posts: 108
Joined: Tue Mar 28, 2017 8:03 pm

Re: ESP32 wifi scan not finding SSID [solved]

Postby jcsbanks » Fri Jul 13, 2018 1:11 pm

One problem I'm having is that if I have multiple access points with the same SSID, password and security (as my network does with 4 access points because stone walls), is that the ESP32 unless I specify a channel will connect to one of the weaker ones with a lower channel number, and if I specify the channel number and it changes that is also a problem. I couldn't find a method yet to connect to the strongest signal or to hope between them.

vonnieda
Posts: 71
Joined: Tue Nov 07, 2017 3:42 pm

Re: ESP32 wifi scan not finding SSID [solved]

Postby vonnieda » Fri Jul 13, 2018 2:50 pm

jcsbanks wrote:One problem I'm having is that if I have multiple access points with the same SSID, password and security (as my network does with 4 access points because stone walls), is that the ESP32 unless I specify a channel will connect to one of the weaker ones with a lower channel number, and if I specify the channel number and it changes that is also a problem. I couldn't find a method yet to connect to the strongest signal or to hope between them.


Use BSSID. BSSID is the MAC address of the AP and it never changes. It's returned in a site scan, along with RSSI, so you can pick the one with the best RSSI and then connect directly using the BSSID.

Jason

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

Re: ESP32 wifi scan not finding SSID [solved]

Postby fly135 » Fri Jul 13, 2018 4:35 pm

PeterR wrote:Sure, will report when I have a view of Wifi disconnections and/or access issues.
The issue this time was a mistyped SSID. So the software was correct in periodically reporting DISCONNECTED (instead of disconnecting).

Yep, I saw that you had already figured it out. I was just letting you know that you can get the reason for the disconnect in the event handler. Partly self serving because I would like to know if others are seeing disconnect error code 203 when using WPA2-PSK (not WPA). That error doesn't prevent connecting. But it does result in a random number of disconnects before finally establishing a connection.

PeterR wrote:Working through the libwebsockets now as I cannot get reliable ethernet from the Olimex ESP32-EVB

Reliable Ethernet is IMO ESP32's biggest problem. We are seeing lots of dropped packets and very unreliable operation. When you get into environments like commercial buildings or apartment complexes that are full of wifi routers, it almost becomes unusable.

User avatar
mzimmers
Posts: 157
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: ESP32 wifi scan not finding SSID [solved]

Postby mzimmers » Fri Aug 03, 2018 6:32 pm

So, on the subject of reason codes...what does WIFI_REASON_ASSOC_TOOMANY mean? I could guess, but I'd rather know for sure. I haven't found the explanation in the online docs.

(Note: I found this in esp_wifi_types.h.)

Who is online

Users browsing this forum: casmeiron, tommeyers and 7 guests