MAC address all zeros

photon
Tags: #<Tag:0x00007fe21c0e4cb8>

#1

Using the particle CLI command: particle serial mac
and pressing m in serial monitor, it returns an address of 00:00:00:00:00:00 for both of my two photons.
I need to get the MAC address in order to register the device on my university’s network.
How do I get the actual MAC address so I can setup and claim my devices?


#2

What device OS version have you got on these Photons?
In some older versions the MAC was only correctly reported after a WiFi connection was established.
Try updating your Photons via particle update -v (in DFU Mode) and run the command again.


#3

the firmware is 1.1.1 for both


#4

Hmm, I’ve just tested and it seems the fixed version is not officially out yet.
The bootloader version that provides the fix would be v302 which is not yet part of the versions including 1.3.0-rc.1.


This issue is closed but as it seems the fix is not deployed to any realease yet.

However, you can flash this to your Photon and let the device actively report its MAC

void setup() {
  Serial.begin();
}

void loop() {
  byte mac[6];
  WiFi.macAddress(mac);
  for (int i=0; i<6; i++) 
    Serial.printf("%02x%s", mac[i], i != 5 ? ":" : "\r\n");
  delay(1000);
}

#5

I compiled the code using particle dev and flashed it to the device in cli it said flash successful but where does it report the mac address? I connected to the serial monitor in particle dev but nothing shows up


#6

That would suggest that your serial monitor is not working as it should (providing your device is actually breathing cyan - if not try connecting it to the cloud e.g. via a mobile hotspot).


#7

it was not breathing cyan I have been try for a week to get the device to breath cyan. I just tried the mobile hotspot to no avail. After particle setup & particle serial wifi the device just flashes green until it goes back into listening mode.
Is there perhaps an older firmware version I could revert to in order to get the mac address with cli?


#8

If you can’t get the device to connect, you could use the code above and just add this to the top

SYSTEM_MODE(SEMI_AUTOMATIC)

and in setup() add a WiFi.on(); call.


#9

That worked I got the real MAC address and got the device to connect to the cloud.
Thank you so much!