SurferTim:
Re your sketch for loading MAC etc from SD card.
I am also trying to load the server port from the card.
I am able to retrieve this datum from the card with code similar to yours in the setup() module.
BUT - the line:
EthernetServer server(port number);
seems to need to be at the top of the sketch, BEEORE the port number has been retrieved.
When I put the line
EthernetServer server(8248);
at the end of setup(), I (naturally) get the error " 'server' was not declared in this scope" at the line
client = server.available();
in loop().
I don't see a way to make the variable "client" be global from within the setup() module.
Do you see a workaround for this ?
Am I supposed to be declaring "client" in the loop?
That instruction will be repeating with every loop cycle then.
Is that OK ?
Bob
SurferTim:
All routers I have show all devices they have dealt with in the arp table. Localnet traffic may not go through the router, so if the device never contacts the router with an WAN (non-localnet) request, it is possible the device mac address may not end up in the arp table. I have the ability to ping from my router. That almost guarantees an entry in the arp table.
What is your concern about the mac address? If you want to know if it is assigning the correct mac address from the SD, then Serial.print() the mac address when you get it from the SD card before assigning it to the w5100.
edit: If you use dhcp to get an ip, you should be able to find the mac address in the dhcp lease records in the router.
Here is a post that shows my code for using the SD card to store network settings.
Can SD Card be used to store ip address/MAC configs? - #22 by SurferTim - Networking, Protocols, and Devices - Arduino Forum