espressif / esp-rainmaker

ESP RainMaker Agent for firmware development
Apache License 2.0
431 stars 145 forks source link

Assisted claiming issue & Failed to initialise MQTT Config (MEGH-4159) #221

Open MahendraDnkTech opened 1 year ago

MahendraDnkTech commented 1 year ago

Hello Geeks... Hope all are doing well

I'm playing an amount ESP32S3 chip & rainmaker SDK I have successfully configured & install ESP32-IDF (v4.4) & Rainmaker SDK The build also seems good for both SDK

I have flashed switch example on s3 chip & able to send the WiFi hotspot SSID & password via the rainmaker Android app The S3 is also connecting with the WiFi router & got the IP

After some time during the claiming it's generating the error & claiming got failed here are the Error logs

E (95615) esp_rmaker_core: Failed to initialise MQTT Config after claiming. Aborting

E (98525) protocomm_nimble: Error setting advertisement data; rc = 30

I have attached the full logs here in the text file

For further debugging, I have logged in with the ESP-Insights dashboard with the same credentials which I was using with the app And, I got this message on the dashboard

All comments & Suggestions Welcome :)

Thanks MS

ESP-Insights

esp_rainmaker_err.txt

MahendraDnkTech commented 1 year ago

FYI: I have made the 1 change in main_app.c as the code was not generating the QR code before here are the changes

/* Start the Wi-Fi.
 * If the node is provisioned, it will start connection attempts,
 * else, it will start Wi-Fi provisioning. The function will return
 * after a connection has been successfully established
 */
err = app_wifi_start(POP_TYPE_MAC);
if (err != ESP_OK) {
    ESP_LOGE(TAG, "Could not start Wifi. Aborting!!!");
    vTaskDelay(5000/portTICK_PERIOD_MS);
    abort();
}
MahendraDnkTech commented 1 year ago

Hi.. Guys Here are the furthermore logs by enabling the debug esp32_rainamekr_err_logs.txt

Thanks

sanketwadekar commented 1 year ago

This seems similar to #214

MahendraDnkTech commented 1 year ago

Yes, it is

MahendraDnkTech commented 1 year ago

Yes, Will do that

Thanks Mahendra

On Sun, Jan 8, 2023 at 10:23 AM Sanket Wadekar @.***> wrote:

Hi, Can you revert the code changes you have done and post the log file with the default log level set to "Debug" (using idf.py menuconfig) for investigating why the QR Code was not printing?

— Reply to this email directly, view it on GitHub https://github.com/espressif/esp-rainmaker/issues/221#issuecomment-1374708924, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYXTEPK76CTZNHFCULDH2JTWRJB3XANCNFSM6AAAAAATQYRQT4 . You are receiving this because you authored the thread.Message ID: @.***>

MahendraDnkTech commented 1 year ago

Hi.. @sanketwadekar Pl. find the debug logs with the default log level set to "debug"

"Esp_Log_1.txt" attached with the app_wifi_start(POP_TYPE_MAC) & "Esp_Log_2.txt" with the default configuration Both of the cases have the assisted claiming

In the first case MQTT connections fail, whereas in the default case, the QR code is not getting generated!

I hope, you guys figure out something from the logs Esp_Log_1.txt Esp_Log_2.txt

Thanks Mahendra

sanketwadekar commented 1 year ago

From the logs, it looks like the issue is coming from nvs read operations. Can you try the nvs_rw_value and nvs_rw_blob examples from IDF to confirm the source of this issue? Also, try with IDF release/v5.0 branch as well.

MahendraDnkTech commented 1 year ago

Yes, that's right The issue is coming from the NVS read operation, however, from the logs, you can check it has been detected! Make sure that my board version is: ESP32-S3-DevKitC-1-N32R8V

Yes, will perform the test and update the results over here

Thanks MS

MahendraDnkTech commented 1 year ago

Hi.. @sanketwadekar

Pl. find the test logs here I have used v4.4 IDF version

[nvs_rw_value_logs.txt] nvs_rw_blob_logs.txt (https://github.com/espressif/esp-rainmaker/files/10392184/nvs_rw_value_logs.txt)

Thanks MS

shahpiyushv commented 1 year ago

@MahendraDnkTech Can you enable Octal Flash using idf.py menuconfig -> Serial flasher config -> Enable Octal Flash and retry?

MahendraDnkTech commented 1 year ago

Hi.. @shahpiyushv

here are the logs with enabled octa SPI Flash

nvs_rw_blob_logs.txt nvs_rw_value_logs.txt

Thanks

MahendraDnkTech commented 1 year ago

Hi.. @shahpiyushv

The switch example of the rainmaker is now working after enabling the Octa spi flash!

Many Thanks