This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Problems makes philips hue bulb leaves ZHA networks

Other Parts Discussed in Thread: CC2530

Hi, TI,

I'm trying to use ZHA (CC2538DK) controlling Philips Hue bulb.

The bulb was factory new and joined my ZHA network automatically. Now I can send some ZCL commands to toggle on/off, change color accordingly.

But there is a problem got me stuck for weeks, the bulb bound to the network and never leave...

Below is my observation and efforts, hope someone may give me advice to reset the bulb:

1. Once the bulb turn on from factory reset, it would try to scan supported bands (11~26, 2.4G) and associate to proper PANs with received beacons.

Seems PID/EPID and network keys will be recognized in bulb's NV ram and will do silent rejoin after turned on. That means the bulb do self announcement

even coordinator/router not there.

2. Have tried send ZCL Baisc Reset command to the bulb, the response was "Unsupported Cluster Command"

3. Have tried send MGMT_LEAVE_REQ command to the bulb, the response was "Not Supported"

4. Did MGMT_DIRECT_JOIN to add the bulb's address into coordinator, the send MGMT_LEAVE_REQ command to the coordinator,

Then the coordinator sent NWK leave command to the bulb. I have seen the bulb light turns red and seems reset to factory new once.

but the bulb triggered the association procedure immediately, things happened too fast so I didn't catch up.

Now I can't reproduce the same procedure now. The bulb just return the MAC ACK everytime after coordinator sent the NWK leave.

I'm wondering if something made the bulb settings changed when re-association. The EPID observed from the bulb was different than before.

Think that should be fine since the bulb still recognizes my ZCL and ZDP commands, the only imperfection is NWK Leave ...

Did any experts have similar experience before? Shall I use the ZLL commissioning to factory new with Z-Light stack?

It would be not easy effort since the Z-Light is for CC2530 and need Inter-PAN configurations...

Any suggestions are appreciated.

  • I have no problem using ZDP_MgmtLeaveReq to ask Philips Hue to leave my Zigbee network. Do you use Ubiqua Packet AnalyEr to check this?
  • Hi, YK,

    Firstly, thanks for your kindly reply.
    Do you mean just sending ZDP_MgmtLeaveReq directly to Philips Hue? I think it didn't work in my side:(
    As third item I mentioned, the bulb responded not supported if sending directly by neither coordinator nor another router.

    Yes, I'm using the analyzer for tracing.

    Best regards,
  • Yes, I mean mean just sending ZDP_MgmtLeaveReq directly to Philips Hue. I don't know why it doesn't work on your side.
  • M...thanks for assistance, YK.
    Seems this bulb doesn't not like my ZDP_MgmtLeaveReq command.
    Still got no idea why bulb acting like that, I'm ordering Philips Remote Control to see if it has any specific ways to reset the bulb...

    =======================================================================================================================

    if ( keys & HAL_KEY_SW_4 )
    {
    ...
    zAddrType_t dstAddr;
    dstAddr.addrMode = Addr16Bit;
    dstAddr.addr.shortAddr = 0x11E7; // bulb 16bit address announced by itself
    uint8 buffadd[8]={0x23,0xd3,0xd8,0x00,0x01,0x88,0x17,0x00}; // bulb 64bit address ordered by little endian.
    ZDP_MgmtLeaveReq(&dstAddr, buffadd,0,0,0); // MGMT leave API with remove children: 0, rejoin: 0, security enable: 0.
    ...
    }

    =======================================================================================================================
    [14:24:37.740897] Management Leave Request 61-88-F1-07-67-E7-11-00-00-08-02-E7-11-00-00-1E-E5-28-02-00-00-00-83-32-13-04-00-4B-12-00-00-34-6B-57-43-20-FD-86-EF-63-44-1A-49-E4-65-03-B9-8A-2B-9C-7E-93-EF-FF-FF
    Frame Information: (55 bytes)
    Packet Number: 9
    Protocol: ZigBee
    Timestamp: 14:24:37.740897
    Time Delta: 0.186384
    Channel: 11
    Length: 55
    Link Quality: -15 dBm
    Source: USB1472
    Layer: ZDP
    Status: Decrypted
    MAC Header: (9 bytes)
    Frame Control: 0x8861
    ···· ···· ···· ·001 = Frame Type: [0x1] Data
    ···· ···· ···· 0··· = Security Enabled: [0x0] No
    ···· ···· ···0 ···· = Frame Pending: [0x0] No
    ···· ···· ··1· ···· = Acknowledgement Request: [0x1] Yes
    ···· ···· ·1·· ···· = Intra-PAN: [0x1] Yes
    ···· ··00 0··· ···· = Reserved: 0x0
    ···· 10·· ···· ···· = Destination Addr Mode: [0x2] 16-bit Short Address
    ··00 ···· ···· ···· = Reserved: 0x0
    10·· ···· ···· ···· = Source Addr Mode: [0x2] 16-bit Short Address
    Sequence Number: 241
    Destination PAN ID: 0x6707
    Destination Address: 0x11E7
    Source Address: 0x0000
    MAC Payload: (44 bytes)
    NWK Header: 0xE51E000011E70208
    Frame Control: 0x0208
    ···· ···· ···· ··00 = Frame Type: [0x0] Data
    ···· ···· ··00 10·· = Protocol Version: 0x2
    ···· ···· 00·· ···· = Route Discovery: [0x0] Suppressed
    ···· ···0 ···· ···· = Multicast Flag: [0x0] Unicast or Broadcast
    ···· ··1· ···· ···· = Security Enabled: [0x1] Yes
    ···· ·0·· ···· ···· = Source Route Included: [0x0] No
    ···· 0··· ···· ···· = Destination IEEE Address Included: [0x0] No
    ···0 ···· ···· ···· = Source IEEE Address Included: [0x0] No
    ··0· ···· ···· ···· = Device Initiator: [0x0] No
    00·· ···· ···· ···· = Reserved: 0x0
    Destination Address: 0x11E7
    Source Address: 0x0000
    Radius: 0x1E
    Sequence Number: 229
    NWK Aux Header: (14 bytes)
    Network Security Control: 0x28
    ···· ·000 = Network Security Level: [0x0] None
    ···0 1··· = Key NWK ID: [0x1] Network Key
    ··1· ···· = Extended Nonce: [0x1] Yes
    00·· ···· = Reserved: 0x0
    NWK Frame Counter: 2
    Source Address: 00:12:4B:00:04:13:32:83
    NWK Key Sequence Number: 0
    NWK Payload: (18 bytes)
    APS Header: 0x0000000000340000
    Frame Control: 0x00
    ···· ··00 = Frame Type: [0x0] Data
    ···· 00·· = Delivery Mode: [0x0] Normal Unicast Delivery
    ···0 ···· = Acknowledgement Format: 0x0
    Format: [0x0] Data Frame
    ··0· ···· = Security Enabled: [0x0] No
    ·0·· ···· = Acknowledgement Request: [0x0] No
    0··· ···· = Extended Header Present: [0x0] No
    Destination Endpoint: 0x00
    Cluster ID: [0x0034] Management Leave Request
    Profile ID: [0x0000] ZigBee Device Profile
    Source Endpoint: 0x00
    APS Counter: 0
    APS Payload: (10 bytes)
    ZDP Transaction Sequence Number: 0
    Management Leave Request: (9 bytes)
    Device Address: 00:17:88:01:00:D8:D3:23
    Reserved: 0x0
    Remove Children: [0x0] No
    Rejoin: [0x0] No
    NWK MIC: 0x3D23F582
    MAC Footer: 0xFFFF
    Frame Check Sequence: 0xFFFF

    [14:24:37.757841] Management Leave Response 61-88-2C-07-67-00-00-E7-11-48-02-00-00-E7-11-1E-B9-28-65-5C-03-00-23-D3-D8-00-01-88-17-00-00-CA-41-30-E5-63-7F-D9-67-FB-35-64-BF-7A-8D-FF-FF
    Frame Information: (47 bytes)
    Packet Number: 11
    Protocol: ZigBee
    Timestamp: 14:24:37.757841
    Time Delta: 0.014800
    Channel: 11
    Length: 47
    Link Quality: -23 dBm
    Source: USB1472
    Layer: ZDP
    Status: Decrypted
    MAC Header: (9 bytes)
    Frame Control: 0x8861
    ···· ···· ···· ·001 = Frame Type: [0x1] Data
    ···· ···· ···· 0··· = Security Enabled: [0x0] No
    ···· ···· ···0 ···· = Frame Pending: [0x0] No
    ···· ···· ··1· ···· = Acknowledgement Request: [0x1] Yes
    ···· ···· ·1·· ···· = Intra-PAN: [0x1] Yes
    ···· ··00 0··· ···· = Reserved: 0x0
    ···· 10·· ···· ···· = Destination Addr Mode: [0x2] 16-bit Short Address
    ··00 ···· ···· ···· = Reserved: 0x0
    10·· ···· ···· ···· = Source Addr Mode: [0x2] 16-bit Short Address
    Sequence Number: 44
    Destination PAN ID: 0x6707
    Destination Address: 0x0000
    Source Address: 0x11E7
    MAC Payload: (36 bytes)
    NWK Header: 0xB91E11E700000248
    Frame Control: 0x0248
    ···· ···· ···· ··00 = Frame Type: [0x0] Data
    ···· ···· ··00 10·· = Protocol Version: 0x2
    ···· ···· 01·· ···· = Route Discovery: [0x1] Enabled
    ···· ···0 ···· ···· = Multicast Flag: [0x0] Unicast or Broadcast
    ···· ··1· ···· ···· = Security Enabled: [0x1] Yes
    ···· ·0·· ···· ···· = Source Route Included: [0x0] No
    ···· 0··· ···· ···· = Destination IEEE Address Included: [0x0] No
    ···0 ···· ···· ···· = Source IEEE Address Included: [0x0] No
    ··0· ···· ···· ···· = Device Initiator: [0x0] No
    00·· ···· ···· ···· = Reserved: 0x0
    Destination Address: 0x0000
    Source Address: 0x11E7
    Radius: 0x1E
    Sequence Number: 185
    NWK Aux Header: (14 bytes)
    Network Security Control: 0x28
    ···· ·000 = Network Security Level: [0x0] None
    ···0 1··· = Key NWK ID: [0x1] Network Key
    ··1· ···· = Extended Nonce: [0x1] Yes
    00·· ···· = Reserved: 0x0
    NWK Frame Counter: 220261
    Source Address: 00:17:88:01:00:D8:D3:23
    NWK Key Sequence Number: 0
    NWK Payload: (10 bytes)
    APS Header: 0x0100000080340040
    Frame Control: 0x40
    ···· ··00 = Frame Type: [0x0] Data
    ···· 00·· = Delivery Mode: [0x0] Normal Unicast Delivery
    ···0 ···· = Acknowledgement Format: 0x0
    Format: [0x0] Data Frame
    ··0· ···· = Security Enabled: [0x0] No
    ·1·· ···· = Acknowledgement Request: [0x1] Yes
    0··· ···· = Extended Header Present: [0x0] No
    Destination Endpoint: 0x00
    Cluster ID: [0x8034] Management Leave Response
    Profile ID: [0x0000] ZigBee Device Profile
    Source Endpoint: 0x00
    APS Counter: 1
    APS Payload: 0x8400
    ZDP Transaction Sequence Number: 0
    Management Leave Response: 0x84
    Status: [0x84] Not Supported
    NWK MIC: 0x67351B0B
    MAC Footer: 0xFFFF
    Frame Check Sequence: 0xFFFF

  • M...finally I got a Philips Remote Control to reset the bulb.
    Seems It used ZLL commissioning sequence to capture and have it join ZLL network at channel 25. (TouchLink Commissioning)
    Then long press the off button & blue wheel on remote to force hue enter factory reset mode (lamp indicated as red)
    Afterwards, hue starts to do active scan on whole band as a factory new one.

    For curious, I had retried sequence (3.) and sequence (4.) several times.
    More observations has found:

    3. Try send MGMT_LEAVE_REQ command to the bulb, the response was "Not Supported"

    *3. Bulb responded "Status: [0x84] Not Supported" while receiving ZDP_MgmtLeaveReq directly even it's parent.

    4. Did MGMT_DIRECT_JOIN to add the bulb's address into coordinator, then send MGMT_LEAVE_REQ command to the coordinator,
    that triggered coordinator sent NWK leave command to the bulb. I have seen the bulb light turns red and seems reset to factory new once.
    but the bulb started association procedure immediately, things happened too fast so I didn't catch up.
    Now I can't reproduce the same procedure now. The bulb just return the MAC ACK everytime after coordinator sent the NWK leave.
    I'm wondering if something made the bulb settings changed when re-association. The EPID observed from the bulb was different than before.
    Think that should be fine since the bulb still recognizes my ZCL and ZDP commands, the only imperfection is NWK Leave ...

    *4. With some experiments, believes root cause has found why I only made the bulb reset just once:
    Once the associator which bulb associated to, sent the NWK Leave command, hue will accept the request and enter factory reset.
    Only hue's parent could force it leave ZHA networks, other network members are not acceptable even coordinator does, which means hue recognized it's parent's short address.
    Things I didn't catch up before shall be hue associated to another router rather than coordinator(0x0000) after recovering from factory reset.
    I think the point will be NWK Leave commands shall be sent by it's parent. (wonder how come if hue's parent disappeared.:P)

    Only (4.) worked for me with conditioning, doubting that my bulb's firmware was designed to have such behaviors. (bought from Apple reseller)
    Anyway, thank for your kindly assistance for me, YK.

  • You are welcome.Not really helpful in your case and it is good to know you work it out like this.