esp_wifi_set_config password special characters

jakobj
Posts: 8
Joined: Fri Jul 15, 2022 4:57 am

esp_wifi_set_config password special characters

Postby jakobj » Wed May 01, 2024 5:16 am

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 ?

ESP_Sprite
Posts: 9729
Joined: Thu Nov 26, 2015 4:08 am

Re: esp_wifi_set_config password special characters

Postby ESP_Sprite » Thu May 02, 2024 12:25 am

There's nothing special about an ampersand; esp-idf should simply use that. How do you set the password?

jakobj
Posts: 8
Joined: Fri Jul 15, 2022 4:57 am

Re: esp_wifi_set_config password special characters

Postby jakobj » Thu May 02, 2024 6:54 am

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);

ESP_Sprite
Posts: 9729
Joined: Thu Nov 26, 2015 4:08 am

Re: esp_wifi_set_config password special characters

Postby ESP_Sprite » Thu May 02, 2024 8:40 am

And obviously PW_MAX_LENGHT is set to 10 or higher?

jakobj
Posts: 8
Joined: Fri Jul 15, 2022 4:57 am

Re: esp_wifi_set_config password special characters

Postby jakobj » Thu May 02, 2024 10:25 am

yes, 64. :-)

Who is online

Users browsing this forum: MicroController and 76 guests