Closed EdBeardon closed 1 year ago
#include <SPI.h>
is not neededvoid macAddress(uint8_t mac[]); // get the MAC Address
must done in setup() because it is a function, void
is not necessary. It is only needed when you need the MAC address for other purpose but should not necessary.const char* macAddressReport();
it is complete wrong, try Serial.println(macAddressReport());
Ethernet.begin(mac, ip);;
should replaced by Ethernet.begin(ip);
Hi, thank you. Can you confirm the following should now work?
`#include
int8_t isConnected = 0; uint8_t mac[6]; // array for mac address
IPAddress ip(192, 168, 0, 50);
void setup() {
macAddress(uint8_t mac[]); // get the MAC Address Serial.begin(9600); Ethernet.begin(ip); Serial.println("Write something here");
}
void loop() {
Serial.println(ip); Serial.println(macAddressReport()); delay(1000); }`
It should work, maybe macAddress will work after Ethernet.begin(ip)
Hi again, see below:
Use macAddress(mac[]); // get the MAC Address
This are basics of c programming
Thanks for your help so far, unfortunately its still not compiling. I was hoping I could find an example to base my code from. Thanks again!
Sorry try macAddress(mac); // get the MAC Address
Sorry, I don't understand what you do. Please learn the basics of C before doing wrong things.
The short answer NO
Hi, I'm trying to run a basic piece of code to pick up the MAC address stored on my Wiz550io. I've had a look at the help files but can't find an example to start with. I've got this working on the Ethernet2 library but I need it working on Ethernet3. The code pick up the IP address fine but MAC is shown as 00:00:00:00:00:00. See code below:
`#include
include
define WIZ550io_WITH_MACADDRESS
int8_t isConnected = 0; uint8_t mac[6]; // array for mac address void macAddress(uint8_t mac[]); // get the MAC Address const char* macAddressReport();
IPAddress ip(192, 168, 0, 50);
void setup() {
Serial.begin(9600); Ethernet.begin(mac, ip);; Serial.println("Write something here");
}
void loop() {
Serial.println(ip);
delay(1000); }`