ESP32 OTA over I2C

I read quite a bit over OTA for ESP32. All resources feature OTA over Network (Wifi or Ethernet), usually by downloading new binaries from a server.
Is there examples showing how to implement OTA over different media, preferably I2C?
Background: I have a board that hosts several ESP32s. One of them is the “master” and has Wifi connection, the other ones are slave and do not use Wifi. Currently they are connected to the master as I2C slave.
What is a good starting point to implement update of the slaves: Master receives new binaries over Wifi and flashes the slaves over I2C.
Best regards

I think a good starting point would be an expansion / fork of the original built-in ArduinoOTA library. This uses WiFiUdp.h functionality to receive the update file and feeds into the functions from the general Update library to process the received data and write it into flash.

The Update library is agnostic to the underlying implementation, it just needs an object which implements the Arduino Stream interface to read data from. The SD Update example implements this by simply passing a File object (opened from an SD card filesystem) which implements the Stream interface.

So as a start I’d work on receiving the binary via WiFi (e.g. from the Web Update example), but then using I2C master functionality (example) and subsequently I2C slave functionality provided by the Wire library to call into the Update library on the slave.

1 Like


I was wondering if you were ever able to get it working, I have the same scenario with a minor difference that my slave devices are Arduino pro mini which doesn’t have wifi at all.

actually, I did not follow up on this project any more, so I did not implement OTA over I2C. Sorry.