-
Notifications
You must be signed in to change notification settings - Fork 455
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
read MAC address from PROGMEM #406
base: main
Are you sure you want to change the base?
Conversation
fixes njh#397 (ntpClient example)
Hey @nuno-silva thanks for finishing this! 👍 Just tested on Nano V3 with optiboot using ntpClient example. Both cases with
Logs from dhcpd:
|
Awesome! Thanks for testing @nagimov ! |
@njh please review and merge :) |
Hey @njh ! Any chance of this being merged? :) |
@njh thanks for looking into this. Unfortunately it seems TravisCI is not running:
Maybe you need to login to Travis and re-authorize the repo? |
Sorry for taking so long to look at this @nuno-silva 😞 Part of the delay in reviewing this PR is that I would like to see if I can get the Alternatively, I could port over my MACAddress class from EtherSia 🤔 |
I tried using |
Sorry it has taken me so long to respond to this. I am not very keen on the
I have done some experiments with passing a MAC address stored in program memory into a function: The ether.begin(sizeof Ethernet::buffer, F("\x74\x69\x69\x2D\x30\x31")); The thing that is missing is the This would allow you to do: const static byte mymac[] PROGMEM = { 0x74, 0x69, 0x69, 0x2D, 0x30, 0x31 };
ether.begin(sizeof Ethernet::buffer, FPSTR(mymac)); @nuno-silva What do you think? Does combining the |
Hi @njh! No problem! I agree that the |
This fixes #397 by adding support for reading the MAC address from PROGMEM.
I wanted to do it using an overloaded begin() method, but it turns out that it's not possible to do that using the PROGMEM macro (see #399 (comment)) 😞 .
Therefore, I implemented it using an optional
fromRam
argument, as is done in other places.Despite having updated all examples to read from
PROGMEM
, thefromRam
argument is kept astrue
by default so as not to break other people's code when they update the library.This does have the downside that it's not possible to place the MAC in PROGMEM without passing a
csPin
tobegin()
.@nagimov It's been a few months but I'd be grateful if you could still test this :)
closes #399
closes #398
fixes #397 (ntpClient example)