OTA Updates for R4 wifi

I have a project that uses an R4 Uno Wifi board connected to 5x DS18B20 sensors to measure the temperature at 5 levels in my hot water storage cylinder. It publishes these values using MQTT so my openHAB automation controller can decide when to reheat the water.

This application is written using Platformio rater than the Arduino IDE as I prefer to use VS code and Claude to get me to my end goal faster (fun fact - I got this up and running in 3 hours even though my C++ is very rusty).

Because the installation of the Uno into the utility room is not very accessible I'm looking to see how I can add a facility to apply over the air (OTA) updates for when I want to make a change to the application's code.

I asked to Claude to help but it honestly does not have a clue for this part of the application.
We managed to get the sketch to provision a page that displayed a control to allow a source URL to be entered and a button that would start the download with the file being served from a python script.

The problem is that the file got downloaded into the ESP32 but would not transfer into the Renases chip to allow the boot loader to overwrite the existing application.

I have seen that the Arduino cloud is a recommended method, but cant see how I can use it to push a pre compiled *.bin file to the device.

Has anybody got this working, or is there a demo I could look at modifying ?

Is this with the R4 library OTAUpdate example: OTA? A variant?

That sketch at least attempts to indicate whether the error is with the library or the modem in each of the five stages.

try my ArduinoOTA library. it is in the Library Manager

This can be done using the Arduino Cloud CLI command line tool we provide:

https://docs.arduino.cc/arduino-cloud/arduino-cloud-cli/getting-started/#upload