Skip to content
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

How to change the MAC address of coordinator? #72

Closed
he902 opened this issue Apr 21, 2019 · 12 comments
Closed

How to change the MAC address of coordinator? #72

he902 opened this issue Apr 21, 2019 · 12 comments
Labels

Comments

@he902
Copy link

he902 commented Apr 21, 2019

I'm using CC2531 as the coordinator to add my smart Lock device into Home Assistant.
Currently everything works fine, except for remote Unlock failed (while using vendor's coordinator is OK to Unlock with the same PIN code).

I doubt the Lock device may have verified the MAC address of coordinator, and fail the Unlock request from any other coordinators not belong to the vendor.

How to change the MAC address of CC2531 coordinator? (so I'm able to crone the MAC)

Per the TI doc it shall be able to change the MAC address of CC2531 by modifying firmware.

@andreasbrett
Copy link

Please see the following doc on how to clone a cc2531. In that section you will find how to write a IEEE address (=MAC) of your choice to the CC2531.

https://github.com/andreasbrett/zigbee2mqtt.io/blob/patch-1/information/cc2531_backup_stick.md#how-to-clone-your-stick-windows-only-currently

@he902
Copy link
Author

he902 commented Apr 22, 2019

@andreasbrett I followed your guidelines, and successfully written the new MAC into my CC2531 as Secondary MAC.
Now my CC2531 has two MAC:
Primary MAC: 0x00124b001936a4f9
Secondary MAC: 0x00124b0018eed067

But zigbee2mqtt still read the Primary MAC, here is the debug log:

  zigbee2mqtt:info 4/22/2019, 7:19:19 PM Starting zigbee2mqtt version 1.3.1 (commit #39d6a8e)
  zigbee2mqtt:info 4/22/2019, 7:19:19 PM Starting zigbee-shepherd
  zigbee2mqtt:info 4/22/2019, 7:19:25 PM zigbee-shepherd started
  zigbee2mqtt:info 4/22/2019, 7:19:25 PM Coordinator firmware version: '20190223'
  zigbee2mqtt:debug 4/22/2019, 7:19:25 PM zigbee-shepherd info: {"enabled":true,"net":{"state":"Coordinator","channel":11,"panId":"0xd067","extPanId":"0xdddddddddddddddd","ieeeAddr":"0x00124b001936a4f9","nwkAddr":0},"firmware":{"transportrev":2,"product":0,"version":"2.6.3","revision":20190223},"startTime":1555931965,"joinTimeLeft":0}

And screenshots of using CC Debugger to read Primary/Secondary MAC from my CC2531:

CC2531_MAC1

CC2531_MAC2

Is there any config needed for zigbee2mqtt to enable using the Secondary MAC?

@he902
Copy link
Author

he902 commented Apr 24, 2019

So current zigbee2mqtt only use the Primary MAC instead of Secondary MAC.
Is it a zigbee2mqtt bug, or zigbee-shepherd bug, or firmware bug?

@he902
Copy link
Author

he902 commented Apr 24, 2019

After re-flashed the firmware, the zigbee2mqtt uses the Secondary MAC as expected now!

  zigbee2mqtt:info 4/24/2019, 11:38:21 PM Coordinator firmware version: '20190223'
  zigbee2mqtt:debug 4/24/2019, 11:38:21 PM zigbee-shepherd info: {"enabled":true,"net":{"state":"Coordinator","channel":11,"panId":"0xd067","extPanId":"0xdddddddddddddddd","ieeeAddr":"0x00124b0018eed067","nwkAddr":0},"firmware":{"transportrev":2,"product":0,"version":"2.6.3","revision":20190223},"startTime":1556120301,"joinTimeLeft":0}

@he902
Copy link
Author

he902 commented Apr 24, 2019

Per the TI doc, Z-Stack uses the following four-level hierarchy to determine the IEEE address(MAC) that will be used for the device when it operates:

    1. Read from Z-Stack non-volatile memory 
    2. Look-up from Secondary IEEE location 
    3. Look-up from Primary IEEE location 
    4. Create temporary using random number generation

Looks like the non-volatile memory on CC2531 has a copy of the Primary MAC --- who did it?
The re-flash of firmware has cleaned-up the non-volatile memory, thus goes to the 2nd level (using the Secondary MAC).

@Koenkk
Copy link
Owner

Koenkk commented Apr 25, 2019

So why didn't it work the first time after reflashing?

@he902
Copy link
Author

he902 commented Apr 25, 2019

The first time was not with reflashing, since my CC2531 had already with zigbee2mqtt firmware.
What I did in the first time was just to write MAC into the Secondary slot.
The second time, I did the reflashing.

@he902
Copy link
Author

he902 commented Apr 26, 2019

So the non-volatile memory on CC2531 has a copy of the Primary MAC?

Curiously, which app did such copy? Is it by zigbee2mqtt?
If so, is it able to change the MAC by modifying non-volatile memory on CC2531 via zigbee2mqtt?
(without go through CC Debugger)

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

@malosaa
Copy link

malosaa commented Aug 3, 2022

I have an issue to, well i have a new stick, using the last version of Z2M on home assistant.
I did not change something at all, only put old stick out and new in, and work as expected.

But here is the thing, i re-flashed the old coordinator as a router, and now when i want to paor it pairs, but as an coordinator.. so i did change the second IEEE but doesnt work, still keeps the first and still acting as a coordinator, even when the firmware is router firmware.

any advice ?

regards

@Suschibomber
Copy link

I have an issue to, well i have a new stick, using the last version of Z2M on home assistant. I did not change something at all, only put old stick out and new in, and work as expected.

But here is the thing, i re-flashed the old coordinator as a router, and now when i want to paor it pairs, but as an coordinator.. so i did change the second IEEE but doesnt work, still keeps the first and still acting as a coordinator, even when the firmware is router firmware.

any advice ?

regards

Same for me... :(
Do you have a solution?

@Hedda
Copy link
Contributor

Hedda commented Jan 16, 2024

See related discussion here -> Koenkk/zigbee2mqtt#20724

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants