our hobby flyer club has a very remote weather station and we need to update the sketch sometimes.
I was looking at Nick Gammon's nice
and was wondering if it would be possible to use that to accomplish what we need.
Mega, Uno and the SD card are all connected to one SPI bus (directly or via "bit banged" SPI).
Uno is always connected to the ICSP of the Mega.
Mega checks online if a new sketch is available.
the old sketch is erased from SD,
the new sketch is uploaded by the Mega to the SD card,
(Content is verified?),
Mega sends string with result, and if all ok,
Mega turns Uno on.
Uno starts programming the Mega via ICSP from SD card.
Uno sends string with result.
Uno resets Mega and turns itself off.
Turning on/off is done by a toggle flip flop and an N6020 FET (a similar one turns ethernet shield off during night to save power).
The mentioned fixed filename sketch would be changed to just directly start programming the mega (skipping buttons to be pressed etc.)
Would that work?