Looking for an ethernet OTA solution

Hey! So my system is a ATmega1284P + ENC28J60 (EthernetENC), no SD card. It certainly wouldn’t have been my first choice but I’ve adopted it.

I’m looking into this and a few things I’ve noticed are

  1. I need more than 50% of flash free
  2. The readme says, “Please, don’t use this library with platformio.”
  3. There’s some fuse settings, okay no big deal
  4. I can’t find any command line (not arduino IDE) flashing examples

I’ve added this…

diff --git a/src/main.cpp b/src/main.cpp
index 0ac523d..95df605 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -6,6 +6,9 @@
 #include <Watchdog.h>
 #include <Wire.h>
 
+#define OTETHERNET
+#include <ArduinoOTA.h>
+
 #include "Board.h"
 #include "Config.h"
 #include "Display.h"
@@ -194,6 +197,9 @@ void setup()
     );
 
     Serial.printf("Free Memory: %d\n\r", freeMemory());
+    ArduinoOTA.begin(
+        Ethernet.localIP(), "Arduino", "password", InternalStorage
+    );
 }
 
 void vIdleTask(void* pvParameters)
@@ -202,6 +208,7 @@ void vIdleTask(void* pvParameters)
     const TickType_t xDelay = pdMS_TO_TICKS(250);
 
     for (;;) {
+        ArduinoOTA.poll();
         watchdog.reset();
         digitalWrite(gess::board::LED_A_PIN, LOW);
         vTaskDelay(xDelay);

Has anyone done this before with pio?

On top of that, for this to work on an ATmega, you need to burn a modified bootloader, likely meaning this file.

All the Arduino IDE does is execute the flashing command as specified by ArduinoOTA in e.g.

Now, that uses the arduinoOTA binary, but really all this does it execute a HTTP request to push the firmware. You can also use an extra_script to do that with e.g. curl or direct Python calls. There’s some discussion on it here.

You can obtain the original arduinoOTA binary e.g. via https://downloads.arduino.cc/packages/package_index.json, such as https://downloads.arduino.cc/tools/arduinoOTA-1.3.0-windows_386.zip.