Page 1 of 3

Problems connecting to WiFi

Posted: Sun Jan 08, 2017 9:19 pm
by MalteJ
Hi,

I have problems connecting to a WiFi.
I am using the code from the http example:
https://github.com/espressif/esp-idf/bl ... est_main.c

Of course I have replaced SSID and password with my own WiFi settings.

For me it looks like the esp has problems authenticating with my WiFi.
I have tried connecting to an unsecured WiFi but this didn't work either.

Here is the serial console output:

Code: Select all

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun  8 2016 00:22:57

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0x00
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3ffc0008,len:4
load:0x3ffc000c,len:2364
load:0x40078000,len:3724
ho 0 tail 12 room 4
load:0x40080000,len:260
entry 0x40080034
I (626) heap_alloc_caps: Initializing. RAM available for dynamic allocation:
I (627) heap_alloc_caps: At 3FFBD674 len 0002298C (138 KiB): DRAM
I (631) heap_alloc_caps: At 3FFE8000 len 00018000 (96 KiB): D/IRAM
I (641) heap_alloc_caps: At 4009C094 len 00003F6C (15 KiB): IRAM
I (651) cpu_start: Pro cpu up.
I (657) cpu_start: Single core mode
I (663) cpu_start: Pro cpu start user code
I (852) phy: phy_version: 258, Nov 29 2016, 15:51:07, 0, 0
I (1294) cpu_start: Starting scheduler on PRO CPU.
tcpip_task_hdlxxx : 3ffc1118, prio:18,stack:2048
I (1303) wifi: frc2_timer_task_hdl:3ffc2c0c, prio:22, stack:2048
I (1311) wifi: pp_task_hdl : 3ffc5870, prio:23, stack:8192
I (1312) example: Setting WiFi configuration SSID Blackpearl...
I (1319) wifi: mode : sta (18:fe:34:6a:91:76)
I (1444) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (1444) wifi: state: init -> auth (b0)
I (2444) wifi: state: auth -> init (2)
I (2565) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (2565) wifi: state: init -> auth (b0)
I (3565) wifi: state: auth -> init (2)
I (3686) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (3686) wifi: state: init -> auth (b0)
I (4686) wifi: state: auth -> init (2)
I (4807) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (4807) wifi: state: init -> auth (b0)
I (5807) wifi: state: auth -> init (2)
I (5928) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (5928) wifi: state: init -> auth (b0)
I (6928) wifi: state: auth -> init (2)
I (7049) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (7049) wifi: state: init -> auth (b0)
I (8049) wifi: state: auth -> init (2)
I (8170) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (8170) wifi: state: init -> auth (b0)
I (9170) wifi: state: auth -> init (2)
I (9291) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (9291) wifi: state: init -> auth (b0)
I (10291) wifi: state: auth -> init (2)
I (10412) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (10412) wifi: state: init -> auth (b0)
I (11412) wifi: state: auth -> init (2)
I (11533) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (11533) wifi: state: init -> auth (b0)
I (12533) wifi: state: auth -> init (2)
I (12654) wifi: n:1 0, o:1 0, ap:255 255, sta:1 0, prof:1
I (12654) wifi: state: init -> auth (b0)
...
What am I doing wrong?

Thank you!

Best,
Malte

Re: Problems connecting to WiFi

Posted: Sun Jan 08, 2017 9:52 pm
by kolban
What I'd suggest is to download the ESP-IDF template app found here ...

https://github.com/espressif/esp-idf-template

This is about as simple an app as is possible but it does include connecting to an access point. Plugin your SSID and password and let's see what happens here. This will minimize the amount of code and other tests we will have to look through.

Re: Problems connecting to WiFi

Posted: Sun Jan 08, 2017 10:24 pm
by MalteJ
It is exactly the same behaviour but without retries.
Is there something in the nvs that could have an effect on WiFi connecting?

Re: Problems connecting to WiFi

Posted: Sun Jan 08, 2017 10:34 pm
by kolban
If one is worried that there may be something in flash memory that is affecting operation, one can use the esptool to zero out all flash memory and then re-flash the device with your application. However, I doubt that flash memory corruption is the issue. The most common issues that would match your story would be:

1) Not enough power being supplied through the USB. Try alternate USB supplies if possible.
2) Your WiFi access point isn't "playing" with your ESP32. Try and test the ability for other devices to connect to your access point. Try and find a second access point. Try writing an app that performs a list of available access points rather than connecting.

What is the "source" of your ESP32? Is it a pre-made module (if so, which vendor) ...

Have you ever seen it work?

Do you have a second unit to test with?

Re: Problems connecting to WiFi

Posted: Sun Jan 08, 2017 11:43 pm
by deti__
Same results here with three modules:

- two of type 'ESP32_Core_board_V2'
- one of type 'ESP32 DEVKIT V1' by www.doit.am

connected via USB to a MacbookPro. All git-repositories are up to date. Build was done under Ubuntu 16.04.1 running in a parallels VM.

Any help is appreciated.

Deti

Re: Problems connecting to WiFi

Posted: Mon Jan 09, 2017 12:07 am
by ESP_Angus
Hi Deti,

As you've suggested, it looks to me like something with your WiFi router. ESP32 keeps failing during the WiFi auth phase.

What authentication type do you have set on the router? Is there anything unusual about SSID or password (particularly long, non-ASCII characters, etc.?)

Re: Problems connecting to WiFi

Posted: Mon Jan 09, 2017 12:17 am
by deti__
Hi,

I tried WPA2 with two different access points:
- Fritz!Box 7490
- Raspi with hostapd

Further I tried an Android device (Oneplus 3 running Android 7.0) in wifi hotspot mode with and without any encryption.

All without any success.

Deti

Re: Problems connecting to WiFi

Posted: Mon Jan 09, 2017 12:26 am
by deti__
Even this very simple ssid and password does not work:
.ssid = "test",
.password = "12345678",
.bssid_set = false

Deti

Re: Problems connecting to WiFi

Posted: Mon Jan 09, 2017 1:00 am
by MalteJ
OK, it's working now.

I do not know what has happened.
I have cleaned, checked out older versions from git, updated submodules, cleaned, built, checkout master again, cleaned, built, everything multiple times and now it works.

I am sorry, I cannot reproduce the error.
I have changed nothing on my WiFi network. Just did compiling with different versions, cleaning, submodule updates and so on. Didn't even zeroed the NVS.
Maybe there was a submodule not correctly checked out. But I was pretty sure I have cloned the whole esp-idf repository recursively today...

By the way, I have had the problem on my Linux PC and on my Mac with two different ESP-DevKitC modules.

Thanks anyways!

Best,
Malte

Re: Problems connecting to WiFi

Posted: Mon Jan 09, 2017 1:06 am
by MalteJ
Deti,
maybe this helps:

go into your esp-idf directory and execute "git pull origin master && git checkout master && git submodule update"
Then go to your project and do a "make clean".
Then compile.

Does it help?

Best,
Malte