0

Using built in MAC in Arduino
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Using built in MAC in Arduino

by laurie_nz on Wed Mar 17, 2021 5:40 am

I am using the Adafruit IO Arduino API example code, and trying to set the mac for my ethernet featherwing. It seems to be hardcoded in AdafruitIO_Ethernet.h to use the deadbeeffeed mac address. If I edit the hard coded one with mine, it works. (see below). The AdafruitIO_Ethernet.h file replaces the standard Ethernet.h to give the AdafruitIO support required. I can change the mac address using the standard Ethernet.h, but then I can't use the AdafruitIO credentials. There must be a better way to allow changing the mac address.

//Needed to edit this section of AdafruitIO_Ethernet.h to hard code my mac address

/**************************************************************************/
const char *connectionType() { return "ethernet_wing"; }
protected:
byte _mac[6] = {0x04, 0x91, 0x62, 0xC7, 0xF1, 0xA7};
//byte _mac[6] ={0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; /*!< Ethernet FeatherWing MAC Address */
EthernetClient *_client; /*!< Reference to EthernetClient, _client */
/**************************************************************************/

laurie_nz
 
Posts: 2
Joined: Thu Mar 11, 2021 11:36 pm

Re: Using built in MAC in Arduino

by brubell on Wed Mar 17, 2021 11:09 am

Could you submit this as an issue on the Adafruit IO Arduino repository:

https://github.com/adafruit/Adafruit_IO_Arduino/issues

brubell
 
Posts: 1319
Joined: Fri Jul 17, 2015 10:33 pm

Re: Using built in MAC in Arduino

by laurie_nz on Wed Mar 17, 2021 11:19 pm

I have now posted this to Github, hopefully it can be changed.

laurie_nz
 
Posts: 2
Joined: Thu Mar 11, 2021 11:36 pm

Please be positive and constructive with your questions and comments.