wifi_station_ap_change() behavior when memory is blank

jmg5150
Posts: 14
Joined: Tue Nov 25, 2014 3:04 am

wifi_station_ap_change() behavior when memory is blank

Postby jmg5150 » Thu Dec 18, 2014 12:02 pm

Calling wifi_station_ap_change(n) function when the WiFi configuration area of memory is blank causes the device to crash. However, it's not the typical crash where the watchdog timer eventually times out and causes a device reset. Instead, it hangs until device is power cycled. I just spent some time pulling my hair out chasing down this down so I wanted to save anyone else the pain, particularly anyone calling this function in the user_init, it appears as if the device has been programmed incorrectly / bootloader problems since the last data out of the uart is "jump user code" and then nothing...

The SDK documentation V0.9.3 / 2014.11.20 indicates that the wifi_station_ap_change() function will return a bool indicating success or failure, so I'd expect that it would return false in the case that the wifi configuration memory is empty; however in this case it crashes the chip.

Espressif, please consider hardening this function so that it returns false rather crashing in the case that the memory is blank. Please let me know if you need any help in recreating this issue, I can do it consistently ;-) On a related item, it'd be great to have a function such as wifi_station_ap_get_info(unit8 ap_number) which returns the ssid of the ap/network saved in that location.

jackon
Posts: 28
Joined: Thu Oct 23, 2014 9:05 am

Re: wifi_station_ap_change() behavior when memory is blank

Postby jackon » Fri Dec 19, 2014 7:47 pm

oh, thanks a lot.
I've post this information to R&D.

ESP_Faye
Posts: 1641
Joined: Mon Oct 27, 2014 11:08 am

Re: wifi_station_ap_change() behavior when memory is blank

Postby ESP_Faye » Thu Dec 25, 2014 2:11 pm

Thanks for your interest in ESP8266 !
We‘ve solved your problem here http://bbs.espressif.com/viewtopic.php?f=7&t=104&p=346#p346
Please have a try and feel free to let me know if you have any question. ;)

jmg5150
Posts: 14
Joined: Tue Nov 25, 2014 3:04 am

Re: wifi_station_ap_change() behavior when memory is blank

Postby jmg5150 » Fri Dec 26, 2014 5:03 am

Excellent! Thank you very much! I will try out the new SDK soon.

jmg5150
Posts: 14
Joined: Tue Nov 25, 2014 3:04 am

Re: wifi_station_ap_change() behavior when memory is blank

Postby jmg5150 » Sat Dec 27, 2014 9:39 am

I have built my project using the new v0.9.5_b1 sdk and confirm that the firmware no longer crashes when calling the wifi_station_ap_change() command with blank wifi configuration data. However I found it interesting that it returns "true" when trying to change the ap to a value which doesn't exist.

For example, running this code

if(wifi_station_ap_change(2))
uart0_sendStr("change ap succeeded!\r\n");
else
uart0_sendStr("change ap failed!\r\n");

after writing blank.bin to 0x7E000 results in "change ap succeeded!" status printed over uart. I would expect the result to be false/ "change ap failed!". Can you please verify that this is the desired result?

ESP_Faye
Posts: 1641
Joined: Mon Oct 27, 2014 11:08 am

Re: wifi_station_ap_change() behavior when memory is blank

Postby ESP_Faye » Mon Dec 29, 2014 1:58 pm

@jmg5150 Thanks for your reporting ,we are working on it ~

Who is online

Users browsing this forum: No registered users and 7 guests