OTA firmware update fails with GSM router

Setup:
Arduino Opta connected via Ethernet to a GSM Router (RUT241). The signal strength is excellent, and this setup has worked without issues with OTA for months.

Problem:
Since this week, I’m unable to successfully upload firmware (whether my own code or examples from the thinger.io library) using the above setup. The OTA update progresses to 100%, but then it fails with the following error:
Error while ending OTA update: error while closing file

Serial terminal output:

[OTA] Finishing...
...
[OTA] MD5 verification succeed!
[OTA] Update OK: 0
...
[OTA] OTA update timed out after (ms): 30007
[OTA] OTA update failed... Restarting device
[THINGER] Client was requested to stop.
[_SOCKET] Is now closed!
[CONSOLE] Console stopped
[THINGER] Rebooting device...

When I perform the same OTA test with a fiber router, everything works perfectly.

Earlier this week, I updated the GSM router (RUT241) to the latest firmware version. However, I was able to perform successful OTA updates immediately after the update, so I’m unsure if it’s related to the problem.

Any ideas on what might be causing this issue?

Hi,

Which library version are you using? have you had made changes regarding the thinger’s library version at the device that have the issue?

Hi, I’ve been using the latest version of the library (2.31.0) since its release, so I haven’t made any recent changes to the library.

After further investigation, I resolved the problem by reformatting the Opta’s flash memory. Although the Opta devices were previously formatted and had the latest firmware, it appears that the flash memory may have become corrupted. This issue occurred on two setups located in similar locations, both of which had been operating steadily for a long time.

In the same week, the network provider experienced significant issues in the area where these setups are located. However, I’m unsure if the network problem could have contributed to the issue.

Hi,

It is the first time I see something like you say, what comes to my mind is that could be related with ISP and the device is that it has failed due the OTA update, however the device should recongnize that the firmware is not ok and should discard it, I do not know if for any reason the device is not discarding the failed firmware image and this is causing the memory corruption, did you have failed OTA updates with the network provider issue?

The comm issue should not affect by any way the device’s memory if there was no OTA update.

BR

Hi, thank you for your reply. I agree that the situation is quite unusual.

I have the same setup in two nearby locations. The ISP definitely had problems on Thursday and probably on Friday - I have filed a ticket with them to get the exact dates. On Friday, I performed one successful OTA update, and then the issues started.

Before the update, the router was unresponsive (it was offline for about 12 hours). Afterwards, it only showed as offline, even though the device connected through it was online on Thinger.io. I had to physically visit the location to update the router’s firmware to the latest version (there was a new release within the same week).

I still need to visit the other location to format the flash memory.

I think it will be difficult to determine what caused the problems due to too many variables (ISP issues, router issues), and I have no logs since I was not aware of the situation as it was happening.