The device suddenly lost access to MQTT

AntonKozlenko
Posts: 10
Joined: Thu Sep 26, 2024 7:02 am

Re: The device suddenly lost access to MQTT

Postby AntonKozlenko » Thu Oct 03, 2024 11:45 am

Thank you for the complete answer.

I also wanted to note one observation in the OTA process.

The dashboard shows that OTA is rejected, but the behavior of the device shows that the new firmware has been successfully downloaded and updated. The device is running on the new firmware.

The port monitor shows only such messages:
E (530128) TRANSPORT_BASE: poll_read select error 113, errno = Software caused connection abort, fd = 48
E (530128) MQTT_CLIENT: Poll read error: 119, aborting connection

I use Arduino IDE

Below is a screenshot from the dashboard.

AntonKozlenko
Posts: 10
Joined: Thu Sep 26, 2024 7:02 am

Re: The device suddenly lost access to MQTT

Postby AntonKozlenko » Thu Oct 03, 2024 11:47 am

Screenshot from dashboard
Attachments
OTA_error.png
OTA_error.png (43.84 KiB) Viewed 2133 times

ESP_Piyush
Posts: 309
Joined: Wed Feb 20, 2019 7:02 am

Re: The device suddenly lost access to MQTT

Postby ESP_Piyush » Thu Oct 03, 2024 12:08 pm

The log message seems to be incomplete. Since app rollback is enabled by default, when the node reboots into new firmware, it waits for an MQTT connection before it can report OTA success. If it cannot connect or there is some crash, it boots back into older firmware and reports rejected saying that the firmware rolled back. Can you check the subsequent logs to see if this is what has happened?

AntonKozlenko
Posts: 10
Joined: Thu Sep 26, 2024 7:02 am

Re: The device suddenly lost access to MQTT

Postby AntonKozlenko » Fri Oct 04, 2024 5:40 am

There are no error messages in Arduino during subsequent reboots.
The device is loaded on an already NEW firmware (which was allegedly rejected).

I have tested this on two devices: ESP32 (16Mb) and ESP32 S3 (8Mb) .

Mahesh_T
Posts: 1
Joined: Fri Oct 11, 2024 12:11 pm

Re: The device suddenly lost access to MQTT

Postby Mahesh_T » Fri Oct 11, 2024 12:44 pm

Got OTA working with ESP32S3 8MB / Arduino-esp32 3.0.5 with some bugfixes*

Bugfixes ->
1. Change esp-insights version in Arduino-esp32/idf_component.yml to 1.2.1
2. compiled Arduino core using latest esp-idf release/v5.1 (after this [commit][https://github.com/espressif/esp-idf/co ... 193613717f] )
3. Fixed Rainmaker_8mb.csv partition, to use 64KB aligned offset.
  1. # Name,   Type, SubType, Offset,  Size, Flags
  2. nvs,       data,  nvs,     0x9000,   0x5000,
  3. otadata,   data,  ota,     0xe000,   0x2000,
  4. ota_0,     app,   ota_0,   0x10000,  0x3E0000,
  5. ota_1,     app,   ota_1,   0x3F0000, 0x3E0000,
  6. fctry,     data,  nvs,     0x7EA000, 0x6000,
  7. coredump,  data,  coredump,0x7F0000, 0x10000,
  1. ESP-ROM:esp32s3-20210327
  2. Build:Mar 27 2021
  3. rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
  4. Saved PC:0x403775cd
  5. SPIWP:0xee
  6. mode:DIO, clock div:1
  7. load:0x3fce3818,len:0x109c
  8. load:0x403c9700,len:0x4
  9. load:0x403c9704,len:0xb50
  10. load:0x403cc700,len:0x2fe4
  11. entry 0x403c98ac
  12. [   465][I][RMaker.cpp:18] event_handler(): RainMaker Initialized.
  13. [   520][I][WiFiProv.cpp:159] beginProvision(): Already Provisioned
  14. [   526][I][WiFiProv.cpp:163] beginProvision(): Attempting connect to AP: Rosy
  15.  
  16. [  7193][I][RMaker.cpp:29] event_handler(): MQTT Connected.
  17. [  7248][I][RMaker.cpp:41] event_handler(): OTA Successful : OTA Upgrade finished and verified successfully
  18. [  7617][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 131.
  19. [  7624][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 64755.
  20. [  7630][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 705.
  21. [  7637][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 39831.
  22. [  8040][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 43728.
  23. [  8047][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 25924.
  24. [  8523][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 26388.
  25. [ 12722][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 48215.
  26. [ 12834][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 3505.
  27. Toggle State from ota update to false.
  28. [ 22689][I][RMakerDevice.cpp:147] updateAndReportParam(): Device : Switch, Param Name : Power, Val : false
  29. [ 23371][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 25402.
  30. Toggle State from ota update to true.
  31. [ 26502][I][RMakerDevice.cpp:147] updateAndReportParam(): Device : Switch, Param Name : Power, Val : true
  32. [ 27161][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 11517.
  33. Toggle State from ota update to false.
  34. [ 29315][I][RMakerDevice.cpp:147] updateAndReportParam(): Device : Switch, Param Name : Power, Val : false
  35. [ 30129][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 60824.
  36. [ 68120][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 24799.
Screenshot 2024-10-10 at 7.42.18 PM.png
Screenshot 2024-10-10 at 7.42.18 PM.png (180.84 KiB) Viewed 1723 times

AntonKozlenko
Posts: 10
Joined: Thu Sep 26, 2024 7:02 am

Re: The device suddenly lost access to MQTT

Postby AntonKozlenko » Tue Oct 15, 2024 7:05 am

Thank you so much for such a detailed answer.

Who is online

Users browsing this forum: No registered users and 40 guests