I am working on Smart Home system that uses decentralized network bus (CAN bus) to communication.
I have smart switches that consists of Arduino Nano and SPI<>CAN adapter (MCP25515). I am sending data when switch gets clicked over the CAN bus to the pre-designated address of an Relay actor. The actor switches the 230V light.
I am trying to find solution, how to re-program the Arduino (replace sketch) by OTA update trough CAN bus. As far as I know, Arduino (or ESP or similar) can be programmed by SPI, but I only know how to do it using another Arduino or programmer, not trough the CAN adapter.
Any ideas? Are the SPI frames for programming documented somewhere?