Issue with SmartConfig: Corrupt SSID in GOT_SSID_PSWD Event

Franck.f
Posts: 5
Joined: Mon Jan 13, 2025 8:00 am

Issue with SmartConfig: Corrupt SSID in GOT_SSID_PSWD Event

Postby Franck.f » Mon Mar 24, 2025 9:11 pm

Hello everyone,

I'm facing an issue with SmartConfig on ESP32 (ESP-IDF). According to the logs, the SSID is correctly decoded during the process, but when I receive the GOT_SSID_PSWD event, the evt->ssid field contains unexpected characters instead of the correct SSID.

Details:

Here are the relevant logs:

Code: Select all

I (17221) smartconfig: T|pswd: foobar
I (17221) smartconfig: T|ssid: anaconda
I (17221) smartconfig: T|bssid: 34:27:92:38:57:b3
I (17231) wifi:ic_disable_sniffer
- (17231) jsWifi.c:400 scEventsDecoder - evt->ssid length:8 data:dC�?dC�?
SmartConfig event  {"id":"GOT_SSID_PSWD","ssid":"dCC\u0019\u0000\u0000","password":"foobar","bssid":[52,39,146,56,87,179],"cellphoneIp":[192,168,0,192],"ackToken":23}

relevant code:

Code: Select all

    switch( event_id ) {
        case SC_EVENT_GOT_SSID_PSWD:
        
            smartconfig_event_got_ssid_pswd_t *evt = (smartconfig_event_got_ssid_pswd_t *)event_data;

            TRACE("evt->ssid length:%d data:%s", strnlen((char*)evt->ssid, sizeof(evt->ssid)), evt->ssid);

As you can see, T|ssid: anaconda is correctly logged during decoding, but when I handle the GOT_SSID_PSWD event, evt->ssid contains corrupted data (dCC\u0019\u0000\u0000).

Any insights would be greatly appreciated! Thank you in advance for your help.

Franck.f
Posts: 5
Joined: Mon Jan 13, 2025 8:00 am

Re: Issue with SmartConfig: Corrupt SSID in GOT_SSID_PSWD Event

Postby Franck.f » Wed Mar 26, 2025 8:22 pm

response to myself,

Code: Select all

typedef void (*esp_event_handler_t)(void* event_handler_arg, esp_event_base_t event_base, int32_t event_id, void* event_data);
I unfortunately used the event_data argument asynchronously. The initial data was certainly no longer available after the handler returned.

Who is online

Users browsing this forum: ChatGPT-User and 2 guests