-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Other OTA options #8
Comments
You need some way to check if the current firmware is out of date, the firmware.json includes this information.
I'm guessing you are wanting a feature to do something like
|
Hey @chrisjoyce911, maybe we should write a helper function that includes your just posted code? This way the lib would have the feature. |
I agree , it would be a simple improvement and could look like
|
perfect, just take care about the typos. :) |
I've just pushed up a solution c8db6ef but have not tested it yet |
Will include in next release |
@chrisjoyce911 |
hey @ZZKK000 it should work (already tested with enc28j60 and wt32-eth01) provided you maintain a variable with the connection state, and assign a getter to the FOTA object using bool eth_connected = false;
static bool EthernetConnected()
{
return eth_connected;
}
// using WiFiEvent to handle Ethernet events :-)
void WiFiEvent(WiFiEvent_t event)
{
switch (event) {
case ARDUINO_EVENT_ETH_START:
Serial.println("ETH Started");
ETH.setHostname("esp32-ethernet");
break;
case ARDUINO_EVENT_ETH_CONNECTED:
Serial.println("ETH Connected");
break;
case ARDUINO_EVENT_ETH_GOT_IP:
Serial.printf("ETH MAC: %s, IPv4: %s%s, %dMbps\n", ETH.macAddress().c_str(), ETH.localIP().toString().c_str(), ETH.fullDuplex()?", FULL_DUPLEX":"", ETH.linkSpeed() );
eth_connected = true;
break;
case ARDUINO_EVENT_ETH_DISCONNECTED:
Serial.println("ETH Disconnected");
eth_connected = false;
break;
case ARDUINO_EVENT_ETH_STOP:
Serial.println("ETH Stopped");
eth_connected = false;
break;
default:
break;
}
}
void setup()
{
Serial.begin(115200);
{
auto cfg = FOTA.getConfig();
cfg.name = firmware_name;
cfg.manifest_url = FOTA_URL;
cfg.sem = SemverClass( firmware_version_major, firmware_version_minor, firmware_version_patch );
cfg.check_sig = check_signature;
cfg.unsafe = disable_security;
//cfg.root_ca = MyRootCA;
//cfg.pub_key = MyRSAKey;
FOTA.setConfig( cfg );
FOTA.setStatusChecker( EthernetConnected );
}
WiFi.onEvent( WiFiEvent );
ETH.begin();
}
|
@tobozo |
Hi, guys, there are two kinds of OTA:
|
@ZZKK000 although esp32FOTA has received features that seem industrial, it is still a hobby project and shouldn't be considered as production ready for any industrial use. If you have thousands esp32 nodes I suggest you drop esp32FOTA and adopt a more industrial approach e.g. based on esp-idf and secureboot. |
@tobozo , you are right about esp32FOTA on the industry use, however there will be the same question for esp-idf that who will be the active side of OTA, mess esp32 nodes or one computer? |
@tobozo, Furthermore, Lora interface may be taken into consideration for large quantity of esp32 nodes in large area instead of Wifi or Ethernet cables. |
whether you choose centralized or meshed deployment primarily depends on how your devices are positioned to each other (e.g. drone swarm, sensors array in a corn field, cattle tag). maybe try both methods with 100 units to compare the bottlenecks? updating from LoRa sound very creative, I'm curious how long it takes to transfer a whole binary and how fragments are handled, order, packet loss, etc |
@tobozo |
Great work ! Thank you !!
I already see a great infrastructure and very simplified interface. However, why not expand it ?
It would be really handy if the option to manually supply the fota.json instead of providing its URL.
Also the option to manually provide the OTA directly might be useful.
I am actually working on a project now that involves both, trying to find a workaround for them, and natively supporting them would be great !
The text was updated successfully, but these errors were encountered: