-
Notifications
You must be signed in to change notification settings - Fork 7.6k
ESP32 devkit v1 WiFi.h and Ethernet.h can not be simultaneously compiled #6058
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
Comments
You can use the built-in Ethernet library via "ETH.h". The Ethernet.h file you are using is for AVR and is not guaranteed to work with ESP32. This appears to also be a duplicate of #2704 |
Thank you! |
The issue persists. I cannot find eth.h library |
You don't need to "find" the library, it is built-in as part of the Arduino esp32 package you added to the Arduino IDE. You should be able to find a few examples of it's usage in the IDE under the ESP32 examples (look for Ethernet). In your code you would swap |
Hello, can I consider this as covered? |
Hello, due to no answer I'm closing this issue as expired. If you still need help, please reopen it. Thanks for understanding! |
Board
esp32 devkit v1
Device Description
ESP32 DEVKIT v1 with W5500 Ethernet shield connected over the SPI
Hardware Configuration
// static const uint8_t SS = 5;
// static const uint8_t MOSI = 19;
// static const uint8_t MISO = 21;
// static const uint8_t SCK = 18;
Version
v1.0.6
IDE Name
Visual Studio Code with Arduino IDE 1.8.6
Operating System
MacOS 12.0.1
Flash frequency
80MHz
PSRAM enabled
no
Upload speed
921600
Description
Simultaneous compilation of Ethernet.h and WiFi.h makes successfull compilation impossible due to the constructors syntax conflict
Workaround is
// 1. Modify "Server.h" file as follows
// class Server: public Print
// {
// public:
// // -- Remove
// // virtual void begin(uint16_t port=0) =0;
// // ++ Add
// virtual void begin() = 0;
// };
//
// 2. Modify "WiFiServer.h"
// // -- Remove void begin(uint16_t port=0);
// // ++ Add
// void begin(void);
// void begin(uint16_t port);
//
// 3. Modify "WiFiServer.cpp"
// // ++ Add
// void WiFiServer::begin(void){
// begin(0, 1);
// }
//
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: