LAN Module W5500 with POE Compilation error
-
I have seen this issue already in this forum. Also checked the internet and many people seem to face the same problem. Compilation of the example file offered by M5Stack : Webserver gives a compilation error : cannot declare variable 'Aserver' to be of abstract type 'EthernetServer'. I have tried using Ethernet.h as well as Ethernet2.h. Both give the same compilation error in Arduino IDE. If I compile the code for an Arduino MKR1010 (so without included M5Stack.h). Could anyone share a solution for this urgent problem? Many thanks. This is the code that give the problem. #include <M5Stack.h>
#include <SPI.h>
#include <Ethernet.h>EthernetServer server(80);
-
Hello @HappyUser
With the following two changes I can get the WebServer example to compile and run:
InEthernet.h
// virtual void begin(); virtual void begin(uint16_t port=0);
In
EthernetServer.cpp
//void EthernetServer::begin() void EthernetServer::begin(uint16_t port)
Good luck!
Felix -
Thank you, that would be great. Can I use a standard TextEdit program to make these modifications?
-
Let me shout in big CAPITALS : this is solved. I am really grateful. What is wrong with me that it took me so long to find the correct source to solve this problem. Many thanks.
-
-
How did you do it ? On which line did you add these lines of code ?
I am trying to run this example on a Core2 with the regular Lan module (non POE). I also tried the EasyLoader, but it doesn´t work on Core2.
-
Hello @jvm
open the files
Ethernet.h
andEthernetServer.cpp
, then search for the commented out lines and replace those.Since you are using an M5Core2 you'll also want to adapt the SPI pins as they are slightly different between M5Stack and M5Core2.
M5Stack uses:
#define SCK 18 #define MISO 19 #define MOSI 23 #define CS 26
M5Core2 uses:
#define SCK 18 #define MISO 38 #define MOSI 23 #define CS 26
Please also refer to this GPIO comparison sheet I've compiled a while ago.
Thanks
Felix