PlatformIO Community

Modify OTA in 8266 core

Is it possible to add function to OTA end in ESP8266 core (such as EPROM write) or switch to using in explicit program functions instead of those in core.

I apologise if this question seems rather naive; I am rather naive.

The Arduino-ESP8266’s OTA library supports that you give it an “end function” that will be called when OTA is finished. (Callbacks for other events such as ‘progress’, ‘start’, exist too)

Example can be seen per:

The example above uses a C++ lambda function to implement the callback, but you can give it the name of any function with the signature void someFunction() (source) too.

Hi

Thanks for that. I actually did know that (and have been putting such such calls-back in my code since I first used OTA for amongst other things turning my “heartbeat” LED from blue to red during OTA) but for some unknown reason I had it in my head that such calls-back were now in the core and I had to subvert them. I have no idea why I thought that.