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.

cc2531 USB Dongle CC2531ZNP-Pro-Secure_Standard Firmware

Other Parts Discussed in Thread: CC2531, CC-DEBUGGER, Z-STACK

I'am from Switzerland and bought before 1 month a TI cc2531 USB Dongle and six "Lightify" Bulbs.
I've updated the firmware  CC2531ZNP-Pro-Secure_Standard.hex  from "github.com/.../firmware" with the cc-debugger to the cc2531 USB Dongle. (The Firmware is from 2014 )
Connected the USB Dongle with an raspberry pi 2 and run my server software with node.js.
Everything worked fine!

Now I've bought again two "Lightify" Bulbs this week. But I'am not able to pair or connect the two bulbs like the others before. I've read that the US Osram Bulbs using the ZigBee HA and the EU Osram Bulbs uses the ZigBee LL standart.

Is there a new firmware for the ZNP-SB?
Updated Osram their firmware? I've read that there is a new ZigBee 3.0 protokoll? And works this ZigBee 3.0 with the cc2531 USB Dongle?

Thank you.

  • 1. A ZLL bulb should send beacon requests and try to join HA network first. I would suggest you to use Ubiqua Packet Analyzer to check why these two new bulbs doesn't join your Zigbee HA network.
    2.Yes, there is Zigbee 3.0 announced but TI has not released related Z-Stack yet.
  • Thank you Mr. Chen for your advice.
    I will check these with the Ubiqua Packet Analyzer.

    Anyone who is interested, the Trial Version of the Ubiqua Packet Analyzer can be downloaded here: www.ubilogix.com/.../ubiqua
  • You are welcome.
  • I was a little bit to fast yesterday.
    This morning the two "Lightify" Bulbs could be recognized and paired.
    But after the first pairing, I disconnected the Bulbs and attempt again a pairing and now it doesn't worked.

    Then I installed the trial of the Ubiqua Packet Analyzer, transfered the "Packet Sniffer.hex" to the cc2531 USB Dongle, turned on the bulbs, scanned for the channels, choose Channel 11 and started the capturing.
    All of the bulbs would be recognized and I could see them in the Traffic and Grafic View.

    Now I'am thinking, I've have two Wireless Routers for the Internet and one of them uses Channel 11!
    I think the problem is the same channel like the cc2531 USB Dongle.

    Now my question is: Could it be, that the same channel ist the problem. And how could I change the Channel of the cc2531 USB Dongle?
    I'have only the pre compiled "CC2531ZNP-Pro-Secure_Standard" Image from "github.com/.../firmware".

    Thank you.
  • I don't think two CC2531 uses the same channel will cause problem. Can you clarify your CC2531 USB dongle act as coordinator or router?
  • I use only one cc2531 USB Dongle and the Server Software starts the service as a coordinator.
    I mean the Wireless Router for the Internet (2.4 GHZ) uses the same channel 11 as the cc2531 USB Dongle.

    I'am using as Server Software a node.js stack. (github.com/.../master)
    The Server starts with (client.startCoordinator.bind(client))...)
  • It should be OK that your Zigbee and Wifi are on the same channel unless they are close to each other. Since you install Ubiqua Packet Analyzer, what do you see on it.
  • I've turned on 5 Bulbs and one Power Switch (three of them are the new ones) and The Ubiqua Packet Analyzer gave me all devices. I think thats ok.

    Now I've tested a few things and i think the problem is the not cleared cache from the NV Ram from the cc2531.
    I have 9 devices. eight Lightify bulbs and one Lightify Power Switch.

    I've turned "On" four Bulbs and the Power Switch. From this four bulbs, three are new one. Their have never before connected with the cc2531.
    My Server Software gave me with the function (CLIENT.devices().then(function(devices) {devices.forEach(device){device.IEEEAddress})

    Seven Devices resp. seven IEEE Adresses. Old ones! Not the three new ones.
    Because the bought of three new Bulbs, i think the cache is full and the cc2531 could not save more devices in the cache.

    How did I clear the cache from the cc2531?
    And how many devices I could pair Simultaneously with the cc2531 USB Dongle?

    I've found the function (this.writeConfiguration.bind(this, 'ZCD_NV_STARTUP_OPTION', 1, 0)), the explanation says "don't clear on startup".
    I've changed the value to 1,1. But nothing happens, I was thinking that these startup option is to clear the cache at startup.

    This are the function to start the Coordinator:
    ###
    ZNPClient.prototype.startCoordinator = function() {

    var startRequest = when_sequence([
    this.writeConfiguration.bind(this, 'ZCD_NV_STARTUP_OPTION', 1, 0), // don't clear on startup
    this.writeConfiguration.bind(this, 'ZCD_NV_ZDO_DIRECT_CB', 1, 1), // DO get direct callbacks
    this.writeConfiguration.bind(this, 'ZCD_NV_PRECFGKEY', 16,
    new Buffer(
    [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F]
    )
    ),
    this.writeConfiguration.bind(this, 'ZCD_NV_PRECFGKEYS_ENABLE', 1, 0),
    this.writeConfiguration.bind(this, 'ZCD_NV_SECURITY_MODE', 1, 1),
    this.writeConfiguration.bind(this, 'ZCD_NV_LOGICAL_TYPE', 1, ZNP.LogicalType.COORDINATOR),
    this.writeConfiguration.bind(this, 'ZCD_NV_PANID', 2, this.config.panId),
    this.writeConfiguration.bind(this, 'ZCD_NV_CHANLIST', 4, ZNP.Channel.CHANNEL_11)
    ])
    .then(function(results) {
    return this.comms.request('ZB_START_REQUEST').then(function(response) {
    if (response.data.length !== 0) {
    throw new Error('ZB_START_REQUEST failed');
    }
    return response;
    });
    }.bind(this));

    return startRequest
    .then(this._registerApplicationEndpoint.bind(this))
    .then(this._startupFromApp.bind(this))
    .then(this._registerForCallbacks.bind(this))
    .then(this._promiseFutureState.bind(this, ZNP.ZDOState.DEV_ZB_COORD))
    .then(this.sendPermitJoiningRequest.bind(this, {Timeout:0})); // Disable joining on startup
    };
    ###

  • Ok, I've cleared the cache with the Coordinator settings: this.writeConfiguration.bind(this, 'ZCD_NV_STARTUP_OPTION', 0, 3) and set it after this back to the 1,0 STARTUP_OPTION value.
    Restarted the Server and now the cache is cleared but now I can't see any devices anymore.
    No Device will be recognized or paired now. What happened?
  • Do you enable permit join on your coordinator?
  • Good morning Mr. Chen,

    I'am not sure. I've tested every value for the ZCD_NV_STARTUP_OPTION. 0x00, 0x01, 0x02, 0x03 and 0x04 and request a device restart. I read this article from you: e2e.ti.com/.../1638973

    In any case exept the 0x00 option the Devices doesn't get paired and I must reflash the cc2531. I've made before an backup of the flash so I could go back to the flash file with my old devices in the pairing list. And with them it worked. But yeah, with the old NV Ram pairings and no more space for more devices I think.

    How I configure the "permit join"?
    How could I erase the NV Ram without loosing the ability to pair the devices?


    Their are a few settings and options in the ZNPClient.js to start the Coordinator.

    #####
    // Device state notifications
    this.comms.on('command:ZDO_STATE_CHANGE_IND', this._handleStateChange.bind(this));

    // Device announcements
    this.comms.on('command:ZDO_END_DEVICE_ANNCE_IND', this._handleDeviceAnnounce.bind(this));

    // Device endpoint responses
    this.comms.on('command:ZDO_MATCH_DESC_RSP', this._handleDeviceMatchDescriptionResponse.bind(this));
    this.comms.on('command:ZDO_ACTIVE_EP_RSP', this._handleDeviceMatchDescriptionResponse.bind(this));

    // Endpoint description responses
    this.comms.on('command:ZDO_SIMPLE_DESC_RSP', this._handleEndpointSimpleDescriptorResponse.bind(this));

    // Application framework (ZCL) messages
    this.comms.on('command:AF_INCOMING_MSG', this._handleAFIncomingMessage.bind(this));
    #####

    To start the Coordinator:
    #####
    ZNPClient.prototype.startCoordinator = function() {

    var startRequest = when_sequence([
    this.writeConfiguration.bind(this, 'ZCD_NV_STARTUP_OPTION', 1, 0), // don't clear on startup
    this.writeConfiguration.bind(this, 'ZCD_NV_ZDO_DIRECT_CB', 1, 1), // DO get direct callbacks

    this.writeConfiguration.bind(this, 'ZCD_NV_PRECFGKEY', 16,
    new Buffer(
    [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F]
    )
    ),
    this.writeConfiguration.bind(this, 'ZCD_NV_PRECFGKEYS_ENABLE', 1, 0),
    this.writeConfiguration.bind(this, 'ZCD_NV_SECURITY_MODE', 1, 1),
    this.writeConfiguration.bind(this, 'ZCD_NV_LOGICAL_TYPE', 1, ZNP.LogicalType.COORDINATOR),
    this.writeConfiguration.bind(this, 'ZCD_NV_PANID', 2, this.config.panId),
    this.writeConfiguration.bind(this, 'ZCD_NV_CHANLIST', 4, ZNP.Channel.CHANNEL_11)
    ])
    .then(function(results) {
    return this.comms.request('ZB_START_REQUEST').then(function(response) {
    if (response.data.length !== 0) {
    throw new Error('ZB_START_REQUEST failed');
    }
    return response;
    });
    }.bind(this));

    return startRequest
    .then(this._registerApplicationEndpoint.bind(this))
    .then(this._startupFromApp.bind(this))
    .then(this._registerForCallbacks.bind(this))
    .then(this._promiseFutureState.bind(this, ZNP.ZDOState.DEV_ZB_COORD))
    .then(this.sendPermitJoiningRequest.bind(this, {Timeout:0})); // Disable joining on startup
    };
    #####
  • You can use ZDO_MGMT_PERMIT_JOIN_REQ to do it.
  • Now I've made this Functions and handlers and changed the
    ---> .then(this.sendPermitJoiningRequest.bind(this, {Timeout:0}));
    to my new function
    ---> MGMTPermitJoinReq

    Restartet the device, but it wouldn't pair any device.
    What I'am doing wrong?

    The ZDO_MGMT_PERMIT_JOIN_REQ get three values you can see in packets.ZB_MGMT_PERMIT_JOINING_REQUEST.
    Is the type uint8 for the TCSignificance right?


    ###
    ....
    .then(this.MGMTPermitJoinReq.bind(this, {Timeout:0x01})); // Set joining to unendlich!
    ....

    // ZDO_MGMT_PERMIT_JOIN_REQ
    this.comms.on('command:ZDO_MGMT_PERMIT_JOIN_RSP', this._handleMGMTPermitJoinReq.bind(this));



    //_handleMGMTPermitJoinReq - ZDO_MGMT_PERMIT_JOIN_REQ
    ZNPClient.prototype.MGMTPermitJoinReq = function(params) {
    console.log('sendZDO_MGMT_PERMIT_JOIN_REQ', 'Params >>', params);

    var payload = packets.ZB_MGMT_PERMIT_JOINING_REQUEST.write(params);

    return this.comms.request('ZDO_MGMT_PERMIT_JOIN_REQ', payload).then(this._parseStatus);
    };

    //_handleMGMTPermitJoinReq
    ZNPClient.prototype._handleMGMTPermitJoinReq = function(packet) {
    console.log("_handleMGMTPermitJoinReq", packet);
    };

    // Dataset, payload
    packets.ZB_MGMT_PERMIT_JOINING_REQUEST = {
    Destination: {
    default: 0xFFFF,
    type: 'uint16le'
    },
    Timeout: {
    default: 0x01,
    type: 'uint8'
    },
    TCSignificance: {
    default: 1,
    type: 'uint8'
    }
    };


    ###

  • Try to set timeout to 255 which means to enable permit join forever.
  • That doesn't worked. I think the NV Ram is full and could not pair anymore devices?!
    How I clear the paired devices cache on the cc2531?

    I've set the panID to FFFF and tested also the FFFC. No luck.

    This is my pairing list with eight old devices on the cc2531. This devices, if I turn on the bulbs are connecting without problems.
    The new ones only connect one times before 2 days, but then no luck to get them pair again. And the new Bulbs are not in this list of IEEE Addresses.

    ##

    IEEE_Address: 8418260000CB67E6
    IEEE_Address: 841826000006C758
    IEEE_Address: 841826000006C5C7
    IEEE_Address: 841826000009866B
    IEEE_Address: 000D6F000BC2C501
    IEEE_Address: 841826000005C74A
    IEEE_Address: 841826000005BCFB
    IEEE_Address: 8418260000CB6181

    #
  • Do you use Ubiqua Packet Analyzer to chech why device doesn't join?
  • I've only one cc2531 USB Dongle, can't check with a second one, what is going on.
    But with the Ubiqua Packet Analyzer all devices are accknowleged.

    But now I've set the dstAddress of the ZDO_MGMT_PERMIT_JOIN_REQ Command to "0x0000" and now i get a response from the handler. Before nothing happens after executing the ZDO_MGMT_PERMIT_JOIN_REQ command.

    This is the output:
    ###
    _handleMGMTPermitJoinReq { sof: 254,
    length: 3,
    cmd0: 69,
    cmd1: 182,
    data: <Buffer 00 00 00>,
    fcs: 240,
    command:
    { type: { [String: 'AREQ'] key: 'AREQ', value: 64 },
    subsystem: { [String: 'ZDO'] key: 'ZDO', value: 5 },
    id: { [String: 'ZDO_MGMT_PERMIT_JOIN_RSP'] key: 'ZDO_MGMT_PERMIT_JOIN_RSP', value: 182 } } }
    _handleMGMTPermitJoinReq___
    ###

    How many devices supports the cc2531?
  • I can only suggest you to buy another CC2531 USB dongle for sniffer purpose.
  • I think that's indispensable.
    Thanks again for your help and time.
  • You are welcome.
  • I've found the problem! I had to reset the bulbs.

    The three new bulbs were "used" ones I think. I had to reset them.

    I was thinking before, switch the Power off/on would be resetting the Osram bulbs. That was wrong!
    To reset the Osram Lightify Bulbs, you must do an cycle of on/off switching the power in a specific time and cycle.

    I've spend two days in checking my code and struggle around. ;)

    # Reset Info:
    To physically reset the OSRAM LIGHTIFY bulb, run five power cycles as detailed below (a power cycle is the act of turning something on and off).

    Note: To turn the OSRAM LIGHTIFY bulb on and off: Turn it on and off with the wall switch, OR unscrew it by hand.

    Turn OFF the light
    Turn ON the light for 3 seconds
    Repeat this process 5 times (OFF + ON for 3 seconds = 1 time)
    After the fifth time, wait 10 seconds
    The light will then blink 3 times if successfully reset
    Repeat the process if the light doesn’t blink
    To see a demonstration of the reset process, watch this video from OSRAM.

    Once the OSRAM LIGHTIFY Tunable White 60 Bulb is reset, repeat the first set of steps above to connect it .

    www.youtube.com/watch
  • It's good to know you find solution for this and share solution with us.