During the last few days my thoughts were circling around this behavior... and I think Espressif should change wifi_softap_set_config() so that it can be used in station-only mode, too, i.e. STORING A NEW AP NAME IN THE FLASH.
Here is why:
Imagine a firmware which lets the user change the access point name (for example along with the host name). When in stationap mode this is no problem, wifi_softap_set_config() stores the new name in flash and returns true. Now, if we're in station-only mode, the new name will not be stored in flash and the function returns false.
So in order to store the new name in flash when in station-only mode we currently have two choices:
1st:
Every time we use wifi_set_opmode(2) or wifi_set_opmode(3) we need to call wifi_softap_set_config() afterwards ensuring the correct name is used.
For this to work we need to store the name in a separate config area, of course. So that it survives a reboot.
or
2nd:
Every time the user sets a new name, we need to call wifi_set_opmode(3) before wifi_softap_set_config() and restore the old mode with another wifi_set_opmode call afterwards. This, of course, will activate the ap for a short period of time even when not desired. I do not know whether there are even other side effects.
From a design perspective both choices are crude! In my opinion this is even is a bug (by design) since it needs workarounds where a clean solution would not.
Please make wifi_softap_set_config() usable in every mode
Re: Please make wifi_softap_set_config() usable in every mode
Postby blubb » Mon Sep 21, 2015 5:38 pm
By the way, the same is true for wifi_station_set_config() in non-station mode!
Making both functions callable in every mode would lead to cleaner code.
Making both functions callable in every mode would lead to cleaner code.
Who is online
Users browsing this forum: No registered users and 27 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.