The device suddenly lost access to MQTT

AntonKozlenko
Posts: 18
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: 18
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 17760 times

Piyush
Espressif staff
Espressif staff
Posts: 372
Joined: Wed Feb 20, 2019 7:02 am

Re: The device suddenly lost access to MQTT

Postby 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: 18
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.

Code: Untitled.txt Select all


# Name,   Type, SubType, Offset,  Size, Flags
nvs, data, nvs, 0x9000, 0x5000,
otadata, data, ota, 0xe000, 0x2000,
ota_0, app, ota_0, 0x10000, 0x3E0000,
ota_1, app, ota_1, 0x3F0000, 0x3E0000,
fctry, data, nvs, 0x7EA000, 0x6000,
coredump, data, coredump,0x7F0000, 0x10000,

Code: Untitled.txt Select all


ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0xc (RTC_SW_CPU_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403775cd
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3818,len:0x109c
load:0x403c9700,len:0x4
load:0x403c9704,len:0xb50
load:0x403cc700,len:0x2fe4
entry 0x403c98ac
[ 465][I][RMaker.cpp:18] event_handler(): RainMaker Initialized.
[ 520][I][WiFiProv.cpp:159] beginProvision(): Already Provisioned
[ 526][I][WiFiProv.cpp:163] beginProvision(): Attempting connect to AP: Rosy

[ 7193][I][RMaker.cpp:29] event_handler(): MQTT Connected.
[ 7248][I][RMaker.cpp:41] event_handler(): OTA Successful : OTA Upgrade finished and verified successfully
[ 7617][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 131.
[ 7624][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 64755.
[ 7630][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 705.
[ 7637][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 39831.
[ 8040][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 43728.
[ 8047][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 25924.
[ 8523][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 26388.
[ 12722][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 48215.
[ 12834][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 3505.
Toggle State from ota update to false.
[ 22689][I][RMakerDevice.cpp:147] updateAndReportParam(): Device : Switch, Param Name : Power, Val : false
[ 23371][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 25402.
Toggle State from ota update to true.
[ 26502][I][RMakerDevice.cpp:147] updateAndReportParam(): Device : Switch, Param Name : Power, Val : true
[ 27161][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 11517.
Toggle State from ota update to false.
[ 29315][I][RMakerDevice.cpp:147] updateAndReportParam(): Device : Switch, Param Name : Power, Val : false
[ 30129][I][RMaker.cpp:31] event_handler(): MQTT Published. Msg id: 60824.
[ 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 17350 times

AntonKozlenko
Posts: 18
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.

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

Re: The device suddenly lost access to MQTT

Postby AntonKozlenko » Thu Apr 17, 2025 11:59 am

Dear Mr. Piyush,

Since I last contacted you, I have changed the frequency of requests on my devices,
after which they worked normally for a long time and did not exceed 25,000 requests per day.

But 17/04/25 13:20:02 three nodes cannot connect at the same time

3XjduFh7MJa6hx6fmpg9DS
Cun4y4pobchhciYP3UJcSb
j22Tb7ndYZMhCr6TXT6EcY

Please see the reason for disabling them.

If suddenly, for some reason, they exceeded the connection limit,
I will immediately update their firmware with an even more reduced frequency of requests.

Piyush
Espressif staff
Espressif staff
Posts: 372
Joined: Wed Feb 20, 2019 7:02 am

Re: The device suddenly lost access to MQTT

Postby Piyush » Thu Apr 17, 2025 12:47 pm

Sorry these nodes got deactivated inadvertently. We have reactivated them now. Please check.

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

Re: The device suddenly lost access to MQTT

Postby AntonKozlenko » Thu Apr 17, 2025 1:01 pm

Thanks, everything is working!!!

But I still reduced the number of requests.

Vlada19Margarita50
Posts: 1
Joined: Wed May 20, 2026 7:06 pm

Re: The device suddenly lost access to MQTT

Postby Vlada19Margarita50 » Wed May 20, 2026 7:42 pm

Faced with the same situation as the loss of communication with one of the five nodes.
He disappeared from dashboard.rainmaker.
Another node with the same firmware is working fine, an unintended failure may have occurred and the node exceeded the access limit. I'm trying to figure out my mistake.
I ask you to restore the node in dashboard.rainmaker (if possible) so that you can update the firmware with bug fixes.
Node ID - D0CF1321D77C

Who is online

Users browsing this forum: Bytespider and 1 guest