Hi. I’m having issues with the Arduino Opta that I use together with Arduino Cloud. The idea behind using Opta with Arduino Cloud is to be able to update scripts OTA, since several of these units will be installed far away from where I work. That’s why OTA is absolutely necessary for the use of the Optas. When I first started with the Opta it worked reasonably well, but I struggled with issues like frequent reconnecting to the cloud and similar during use. I’ve managed to minimize that, and it’s no longer a problem.
What I’m struggling with now is that updating through OTA is always a gamble. It often won’t finish properly and will restart several times before finally uploading, but only after stopping at, for example, 70%, then turning the Opta off and on again and reporting that the OTA was successful. The problem I had today was that the first attempt worked perfectly. Then I tried to update again 30 minutes later, and at 76% it disconnected from the cloud and stayed disconnected for 29X minutes. After that it suddenly reappeared in the cloud, but it had never turned off—only disconnected from the cloud. This is strange since I have a reset function in the code that restarts the device if it stays disconnected for more than 5 minutes, specifically to prevent this situation where it doesn’t reconnect to the cloud after a failed OTA. According to the Arduino device menu, it says that the OTA was canceled by the user and that the duration was 29X minutes. When I now try to do another OTA, it says it is waiting for the device to reconnect, even though it is connected to the cloud and shows as ONLINE.
It’s worth mentioning that I have ArduinoCloud.update(); running inside a millis delay function with a 500 ms wait. This was added while troubleshooting the frequent reconnecting issue earlier. I plan to remove it the next time I’m at the Opta to see if OTA improves. But is it dangerous to have a non-blocking wait function for this? It’s also worth mentioning that I have a blink function running all the time to visually observe the device’s operation. This usually runs smoothly, but during an OTA it completely stops and only changes the LED that lights up about every 1 second. This is extremely important for the continued operation of my system using the Opta, and I really hope there’s a fix for this issue.
This text has been translated using chatgpt since my main language is not english. Im sorry for the inconvenience.
Its also worth mentioning that i from now on will have an seperate bool variable to be able to remotly restart the device via the cloud dashboard. Since this problem makes it now possible for me to do anything with the device until afther midnight when the device is scheduled to restart itself.
I will say that in device menue there is no sign of it being reconnected to the cloud. Only showing online before the last OTA. Then offline when the OTA failed. And afther 29x minutes it turned online but no yellow signal showing it was reconnected to the cloud. Still it shows as online. Bug?
Afther the automatic reboot of the device at midnight today the cloud has recognised it as reconnected. I tried an OTA, but same problem occure. Only difference the device came online after only 30 minutes. The device has still not rebooted after the OTA which makes the cloud think it never reconnected. Making it not possible to try an OTA untill after reboot. I desperatly need this to work properly. I tried similar code on an OPTA WiFi which was added on the older version of device setup explained in my other post. OTA on this device works fine, but not on the Opta LAN recently bought. Is this a problem with wifi certifications? If so i would higly appreciate an insight from the Arduino Team.
Explenation as to why the WiFi Opta is added via the older method is when i try to add it normally after i chose WiFi connection mode it loads and then says not able to claim device.
I would like to go back to this topic. After a bit of investigating i found debug in Arduino OTA problems site which specified a problem with Opta if crashing under OTA I had to had insert ArduinoCloud.setOTAChunkMode();
In void setup();
This fixed my problem. Inturn makes the OTA quite slow, but rather slow and 100% succesful than crashing. This i would like arduino to automatic put in script if setup is with an Opta. Or bring in a reminder to customers.
For anyone having problem with this feel free to notice me aswell.
Under second to last Chapter:
SHA256 mismatch - Unable to apply the new firmware. Previous firmware detected after restart
This error means that the device restarted with a SHA (fw identifier) that is different from the target one and the SHA is equal to the one installed when the OTA process is started. This usually happens when the device restarts during the OTA process.
NB: Found this helpfull because the last sentence (Restarts during OTA process).
Fix problem by following under:
Follow these steps:
Ensure the device is connected to a stable and uninterrupted power source.
Upload a simple example sketch (such as BareMinimum) to prevent any resets caused by faulty code.
If you’re unable to program the device, try putting it in bootloader mode.
If you’re using an Opta, Portenta H7, or Portenta C33 and connecting over Ethernet, enable chunked downloads by adding ArduinoCloud.setOTAChunkMode(); to the setup() function in your sketch, immediately after the line ArduinoCloud.begin(ArduinoIoTPreferredConnection);.