Page 1 of 1

esp_wifi_set_config password special characters

Posted: Wed May 01, 2024 5:16 am
by jakobj
We are struggling with special characters in the wifi sta password, everything works if we use a password with without special characters.

Code: Select all

    ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) );
    ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) );
    ESP_ERROR_CHECK(esp_wifi_start() );
If
wifi_config.sta.password
is set to "password" or any other password without special characters, it works.

But if we set
wifi_config.sta.password
to example "pass&word" it fails.

And we did remember to change to AP's password accordingly. ;)

So how do we use special characters ?

Re: esp_wifi_set_config password special characters

Posted: Thu May 02, 2024 12:25 am
by ESP_Sprite
There's nothing special about an ampersand; esp-idf should simply use that. How do you set the password?

Re: esp_wifi_set_config password special characters

Posted: Thu May 02, 2024 6:54 am
by jakobj
Yes, I don't understand either.

We set it as follows, and it works for all other tested password without "special" characters.

Code: Select all

strncpy((char*)wifi_config.sta.password,"pass&word", PW_MAX_LENGHT);

Re: esp_wifi_set_config password special characters

Posted: Thu May 02, 2024 8:40 am
by ESP_Sprite
And obviously PW_MAX_LENGHT is set to 10 or higher?

Re: esp_wifi_set_config password special characters

Posted: Thu May 02, 2024 10:25 am
by jakobj
yes, 64. :-)