l'IDE è in realtà 1.8.10; la procedura per utilizzare la libreria necessita la riscrittura del bootloader (l'ho effettuata con un arduino leonardo programmato come programmatore ISP) e l'utilizzo di una configurazione scheda dedicata denominata "Arduino Mega 2560 (Optiboot)".
Caricando lo sketch di esempio per OTA:
#include <SPI.h>
#include <Ethernet.h>
#include <ArduinoOTA.h>
//#define Serial SerialUSB
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("Initialize Ethernet with DHCP:");
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
} else {
Serial.print(" DHCP assigned IP ");
Serial.println(Ethernet.localIP());
}
ArduinoOTA.begin(Ethernet.localIP(), "Arduino", "password", InternalStorage);
}
void loop() {
ArduinoOTA.poll();
}
Tutto funziona correttamente e la scheda viene elencata nella lista porte. Il caricamento via Ethernet avviene anche esso correttamente.
Modificando il file di esempio d Souliss:
#include "SoulissFramework.h"
// Configure the framework
#include "bconf/StandardArduino.h" // Use a standard Arduino
#include "conf/ethW5100.h" // Ethernet through Wiznet W5100
#include "conf/Gateway.h" // The main node is the Gateway, we have just one node
#include "conf/Webhook.h" // Enable DHCP and DNS
// Include framework code and libraries
#include <SPI.h>
#include "Souliss.h"
#include <ArduinoOTA.h>
// This identify the number of the LED logic
#define MYLEDLOGIC 0
void setup()
{
Initialize();
GetIPAddress();
SetAsGateway(myvNet_dhcp); // Set this node as gateway for SoulissApp
ArduinoOTA.begin(Ethernet.localIP(), "Arduino", "password", InternalStorage);
Set_SimpleLight(MYLEDLOGIC); // Define a simple LED light logic
pinMode(2, INPUT); // Hardware pulldown required
pinMode(9, OUTPUT); // Power the LED
}
void loop()
{
EXECUTEFAST() {
UPDATEFAST();
FAST_50ms() { // We process the logic and relevant input and output every 50 milliseconds
DigIn(2, Souliss_T1n_ToggleCmd, MYLEDLOGIC); // Use the pin2 as ON/OFF toggle command
Logic_SimpleLight(MYLEDLOGIC); // Drive the LED as per command
DigOut(9, Souliss_T1n_Coil, MYLEDLOGIC); // Use the pin9 to give power to the LED according to the logic
}
FAST_GatewayComms();
}
ArduinoOTA.poll();
}
L'IDE arduino non elenca più la scheda all'interno della lista Porte. "conf/Webhook.h" attivare le parti della libreria Ethernet escluse da Souliss. Ho inoltre provato anche a configurare l'IP statico (come d'altronde mi servirebbe nelle mie applicazioni) ma stesso risultato.