SoftAP - incorrect SSID on start
SoftAP - incorrect SSID on start
Postby narayan » Wed Aug 17, 2016 7:16 am
I set the SoftAP SSID to Zentri_xxx. However one in 3 to 1 in 5 times, the softap is started with ssid of ESP_xxxxxxx
Not only is this the case, but also I specify IP address of 10.10.10.1 and with DHCP service 10.10.10.x
However this changes to 192.168.4.x. This is not OK for our product, as the connecting server and web-pages
that are being served with the device expect to use 10.10.10.1.
We use:
wifi_softap_set_config_current ()
wifi_softap_dhcps_stop ()
wifi_set_opmode (SOFTAP_MODE)
/* I have better luck if I do this twice */
wifi_softap_set_config_current ()
wifi_softap_dhcps_stop ()
wifi_softap_set_dhcps_lease ()
wifi_softap_dhcps_start ()
This is a critical bug, please help.
Re: SoftAP - incorrect SSID on start
Postby pratik » Wed Aug 17, 2016 10:20 am
Which SDK are you using?
Also, do you initialize these settings in user_main?
Re: SoftAP - incorrect SSID on start
Postby narayan » Thu Aug 18, 2016 10:20 am
The user_init routine does:
wifi_set_opmode (STATION_MODE)
wifi_station_set_autoconnect (0)
wifi_set_macaddr (STATION_IF, xxx)
wifi_set_macaddr (SOFTAP_IF,xxxx)
wifi_set_opmode (STATION_MODE)
The rest of the in the function called by system_init_done_cb ()
Re: SoftAP - incorrect SSID on start
Postby fvpalha » Fri Nov 11, 2016 5:53 pm
I have the same problem with SDK 1.5.4.
How I can fix it?
Re: SoftAP - incorrect SSID on start
Postby pratik » Sat Nov 12, 2016 12:19 pm
http://iot-bits.com/articles/esp8266-so ... t-working/
This, or a complete system restart tends to work 100% of the time when changing config. Let me know if this helped!
Re: SoftAP - incorrect SSID on start
Postby fvpalha » Tue Nov 15, 2016 2:36 am
I tried this code, without success.
Code: Select all
void set_ap_config (os_event_t *e)
{
struct softap_config ap;
wifi_softap_get_config(&ap);
os_memset(ap.ssid, 0, 32);
os_memcpy(ap.ssid, "TST_ESP_", 8);
ap.ssid_len = 8;
ap.max_connection = 1;
wifi_softap_set_config (&ap);
}
void ICACHE_FLASH_ATTR config_set_ap (void)
{
unsigned char res;
os_event_t testQueue[1];
res = wifi_set_opmode_current (0x02);
system_os_task (set_ap_config, USER_TASK_PRIO_1, testQueue, 1);
}
After the command, the AP disappear and appear again with same SSID initial.
I need to change the SSID, how I can do it?
Re: SoftAP - incorrect SSID on start
Postby pratik » Tue Nov 15, 2016 4:12 pm
If even that does not work, please let me know what happens if you call system restart API after setting default AP properties. Does it reboot with proper AP name or still reboots with same default SSID?
Re: SoftAP - incorrect SSID on start
Postby fvpalha » Wed Nov 16, 2016 7:23 pm
I tried this code, without success.
Code: Select all
void set_ap_config (os_event_t *e)
{
struct softap_config ap;
wifi_softap_get_config(&ap);
os_memset(ap.ssid, 0, 32);
os_memcpy(ap.ssid, "Espressif", 9);
os_memset(ap.password, 0, 64);
os_memcpy(ap.password, "password", 8);
ap.authmode = AUTH_WPA2_PSK;
ap.ssid_len = 8;
ap.max_connection = 1;
wifi_softap_set_config (&ap);
system_restart();
}
void ICACHE_FLASH_ATTR config_set_ap (void)
{
unsigned char res;
os_event_t testQueue[1];
res = wifi_set_opmode_current (0x02);
system_os_task (set_ap_config, USER_TASK_PRIO_1, testQueue, 1);
}
After the command, the AP disappear and appear again with default SSID and without password.
Re: SoftAP - incorrect SSID on start
Postby fvpalha » Wed Nov 16, 2016 8:57 pm
I tried this code:
Code: Select all
void ICACHE_FLASH_ATTR config_set_ap (void)
{
struct softap_config apconfig;
char *arg1 = "Espressif";
char *arg2 = "password";
wifi_set_opmode(STATIONAP_MODE);
memset(apconfig.ssid, 0, sizeof(apconfig.ssid));
memset(apconfig.password, 0, sizeof(apconfig.password));
os_bzero(&apconfig, sizeof(struct softap_config));
wifi_softap_get_config(&apconfig);
os_strncpy(apconfig.ssid, arg1, sizeof(apconfig.ssid));
os_strncpy(apconfig.password, arg2, sizeof(apconfig.password));
apconfig.ssid_len = strlen(arg1);
apconfig.authmode = AUTH_WPA2_PSK;
apconfig.ssid_len = 9;
apconfig.max_connection = 1;
ETS_UART_INTR_DISABLE();
wifi_softap_set_config(&apconfig);
ETS_UART_INTR_ENABLE();
system_restart();
}
Without an OS task.
After the command, the ESP does not appear again. So I reset the power. The SSID changed.
The flash memory addresses 0x3FE0B4 and 0x3FE0D4 have the new SSID and password.
I hope this information can help us.
Re: SoftAP - incorrect SSID on start
Postby pratik » Fri Nov 25, 2016 2:01 pm
Maybe this has something to do with open structures inside the SDK code. I will forward this issue to the firmware developers and get back with what they have to say!
Who is online
Users browsing this forum: No registered users and 58 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.