-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Allow custom mac address definition in ETH library #10369
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 my EthernetESP32 library |
Hey @JAndrassy I am using the ArduinoOTA bundled library, and I would like to use a custom MAC address or static IP. I am using the W5500 ethernet module If your library doesn't work with ArduinoOTA, could you point me to what you changed in order to set it. I could try and hack around ETH.cpp to port this particular change. @me-no-dev tagging you as well in case you can help |
Replace the ArduinoOTA library with the Update.h library, which is compatible with ETH.h (see a basic example here, but if you are going to use a webserver to perform the update, I suggest using it together with the ESPAsyncWebServer library). To set a static IP address, use the config method (from the ETH library) with the following parameters:
Usage example:
To set a custom MAC address, I'm using a library, which I forked from this main one, that allows you to set a custom MAC address: github.com/MicSG-dev/ETH-Mac. Usage example:
|
@JAndrassy I tried your library and I am seeing this conflicting declaration error:
Am I doing something wrong or is this a bug in the library? Do I need to replace the bundled Ethernet library with yours? |
don't use both ETH.h and EthernetESP32.h in same sketch |
Thanks very much. I can confirm your library works like a charm |
Hello, This issue seems resolved. I close it for now. In case the issue persists, please feel free to reopen it. Thanks |
@Parsaabasi OP used my EthernetESP32 library instead of the ETH library. The ETH library still doesn't support custom MAC address setting |
Not planned feature to spoof a random MAC address. |
Related area
Mac Address Ethernet W5500 SPI
Hardware specification
ESP32 DevKitC
Is your feature request related to a problem?
Currently the MAC address configuration in the ETH library happens internally, so the user cannot decide which MAC address he wants to use.
Describe the solution you'd like
I want it to be possible to change the MAC address through the begin function of the ETH.h library.
Describe alternatives you've considered
The solution would be to create a new method for the ETH library. See below:
File ETH.h, line 125:
BEFORE:
AFTER:
File ETH.cpp, line 810:
BEFORE:
AFTER:
Additional context
The usage of this new library method would be:
I have checked existing list of Feature requests and the Contribution Guide
The text was updated successfully, but these errors were encountered: