mikalhart / ESP32-OTA-Pull

An ESP32/Arduino library for doing easy "pull"-based OTA ("Over The Air") updates
MIT License
34 stars 11 forks source link

OTA with Ethernet #5

Open IgnacioSJ opened 7 months ago

IgnacioSJ commented 7 months ago

Hi!, I need to do an OTA update with an ESP32-S3-DevKitC-1 via Ethernet but it seems that the example doesn´t work with Ethernet. I get the following error: CheckForOTAUpdate returned 1 (HTTP GET failure) Is it possible to do OTA updates via Ethernet with this library? Thank you!

mikalhart commented 7 months ago

Good question. I don't know! Never tried it with Ethernet. But I agree that it seems that it ought to work.

IgnacioSJ commented 7 months ago

Hi @mikalhart! I tried to change a bit ESP32OTAPull.h file. I added #include (because I have an ENC28J60 module but I supposed Ethernet.h would be OK too) and #include (I always include it when I work with Ethernet connections). Then, I changed the following line: WiFiClient* stream = http.getStreamPtr(); to: EthernetClient* stream = http.getStreamPtr(); It doesn't work and gives me an error: ESP32OTAPull.h:91:55: error: cannot convert 'WiFiClient*' to 'EthernetClient*' in initialization I read in some other forums that "HTTPClient" library could not work at all with Ethernet connections and it's better to use "HttpClient" library. However, it works different and some functions are missing so I think it's not the way to get this working. Could you help me with this trouble? I find this library far more interesting than other libraries that mostly do OTA updates using "push" method or only in local networks, which it's not the funcionality I need. Thanks!