RTOS SDK SOFTAP password changed after Android 7 connect

Chris_123
Posts: 2
Joined: Mon Jun 26, 2017 11:13 pm

RTOS SDK SOFTAP password changed after Android 7 connect

Postby Chris_123 » Mon Jun 26, 2017 11:16 pm

Hello,

i currently observed a strange behavior i don't understand.
I'm using the ESP8266 wifi in "SOFTAP_MODE". It works fine with a lot of different smartphones (Andorid different versions & iOS).

But when I try connecting with an Android 7 Smartphone the ESP8266 changes the wifi password to "ction: Keep-".


Has anybody observed similar behavior?
Ist there a known problem? (I searched but did not find anything)
Does anybody know where to get support (also paid)?


Additional details:

-Used official RTOS SDK 1.4 & 1.5 (same behavior)
-Code snipped for setting the Wifi password:

#define WiFi_AP_SSID "Test_Wifi"
#define WiFi_AP_PASSWORD "12345678"

....
....
....

void ICACHE_FLASH_ATTR setDefaultPassword(struct softap_config *config){

sprintf(config->ssid, WiFi_AP_SSID);
sprintf(config->password,WiFi_AP_PASSWORD);
config->authmode = AUTH_WPA_WPA2_PSK;
config->ssid_len = 0;
config->max_connection = 1;

wifi_softap_set_config(config);
free(config);

printf("Wifi password was set to DEFAULT!!!\n");
}

....
....
....

void user_init(void)
{

....
....
....
wifi_set_opmode(SOFTAP_MODE);

struct softap_config *config = (struct softap_config *)zalloc(sizeof(struct softap_config));
wifi_softap_get_config(config);

....
....
....
//only called after first startup after flashing
setDefaultPassword(config);
....
....
....
}



Hope for your support!
Best Regards

Her Mary
Posts: 537
Joined: Mon Oct 27, 2014 11:09 am

Re: RTOS SDK SOFTAP password changed after Android 7 connect

Postby Her Mary » Wed Jun 28, 2017 2:58 pm

"ction: Keep-" seems like a part of the TCP packets "Connection: Keep-alive".
Will your application write anything into flash?
If power off and power on to restart the ESP8266 board, what the password will be?

Chris_123
Posts: 2
Joined: Mon Jun 26, 2017 11:13 pm

Re: RTOS SDK SOFTAP password changed after Android 7 connect

Postby Chris_123 » Thu Jun 29, 2017 1:47 am

Thank you for your fast post.

After cold start of the ESP8266 the password is still “ction: Keep-“.

I do not write anything to flash directly. But I change the password if I receive an “p” character via socket.
In this case i use the next 12 character as password. This password is set via wifi_softap_set_config();

But when listening via socket i should not receive a "Connection: Keep-alive" as string?
I use the following functions to listen to the connection:
...
struct sockaddr_in clientAddress;
socklen_t clientAddressLength = sizeof(clientAddress);
...
int clientSocket = accept(serverSocket, (struct sockaddr *)&clientAddress, &clientAddressLength);
...
//set socket to nonblocking
fcntl(clientSocket, F_SETFL, O_NONBLOCK);
...



I Read from this socket via:
...
*recevedBytesLength = read(clientSocket , &recv_buf, 16);
...

Her Mary
Posts: 537
Joined: Mon Oct 27, 2014 11:09 am

Re: RTOS SDK SOFTAP password changed after Android 7 connect

Postby Her Mary » Thu Jun 29, 2017 10:30 am

"Connection: Keep-alive" is a part of the HTTP header. Of course you will get it from the socket.
It seems to be your application that set this wrong password.
You should add some log to check that part you mentioned above.

But I change the password if I receive an “p” character via socket.
In this case i use the next 12 character as password. This password is set via wifi_softap_set_config();

Who is online

Users browsing this forum: No registered users and 301 guests