JAndrassy / ArduinoOTA

Arduino library to upload sketch over network to Arduino board with WiFi or Ethernet libraries
GNU Lesser General Public License v2.1
437 stars 89 forks source link

Compile error with ESP32 and the OTEthernet example #107

Closed lathoub closed 2 years ago

lathoub commented 2 years ago

Hi I have an ESP32 (WROOM32) connected to the W5500 (over SPI) and would like to enabled OTA to my setup. As instructed, I deleted the OOB ArduinoOTA, installed your library and added the platform.local.txt file next to platform.txt file (esp32/1.0.6 directory).

When I compile the OTEthernet example (1.8.16 on Windows, board: DOIT ESP32 DevKit v1, ESP32) I get the following compilation error:

In file included from C:\Users\bart\Documents\Arduino\libraries\ArduinoOTA\examples\OTEthernet\OTEthernet.ino:22:0:
C:\Users\bart\Documents\Arduino\libraries\ArduinoOTA\src/ArduinoOTA.h: In instantiation of 'class ArduinoOTAClass<EthernetServer, EthernetClient>':
C:\Users\bart\Documents\Arduino\libraries\ArduinoOTA\src/ArduinoOTA.h:79:7:   required from 'class ArduinoOTAMdnsClass<EthernetServer, EthernetClient, EthernetUDP>'
C:\Users\bart\Documents\Arduino\libraries\ArduinoOTA\src/ArduinoOTA.h:112:70:   required from here
C:\Users\bart\Documents\Arduino\libraries\ArduinoOTA\src/ArduinoOTA.h:47:13: error: cannot declare field 'ArduinoOTAClass<EthernetServer, EthernetClient>::server' to be of abstract type 'EthernetServer'
   NetServer server;
             ^
In file included from C:\Users\bart\Documents\Arduino\libraries\ArduinoOTA\examples\OTEthernet\OTEthernet.ino:21:0:
C:\Program Files (x86)\Arduino\libraries\Ethernet\src/Ethernet.h:253:7: note:   because the following virtual functions are pure within 'EthernetServer':
 class EthernetServer : public Server {
       ^
In file included from C:\Users\bart\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32/Arduino.h:152:0,
                 from sketch\OTEthernet.ino.cpp:1:
C:\Users\bart\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\cores\esp32/Server.h:28:18: note:     virtual void Server::begin(uint16_t)
     virtual void begin(uint16_t port=0) =0;
                  ^
exit status 1
Error compiling for board DOIT ESP32 DEVKIT V1.

Should I install additional libraries? Thanks for looking into this

JAndrassy commented 2 years ago

it is a problem in esp32 arduino core which makes it incompatible with all Ethernet libraries. https://github.com/espressif/arduino-esp32/pull/3607