This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF5340DK Zigbee sample light_bulb - Identify mode not working

I am working on Windows, using NRF Connect SDK 1.5.0 (have also tried the SDK 1.5.0r-rc1, with an updated nrf_802154_serialization module to be able to compile).

I am using the SEGGER Embedded Studio for ARM Release 5.34a  Build 2021011401.44914 Nordic Edition.

I am able to compile and program the Zigbee light_bulb sample, but get this output, when pressing button 4, to wnable Identify mode:

I: nRF5 802154 radio initialized
*** Booting Zephyr OS build v2.4.99-ncs1 ***
I: Production configuration is not present or invalid (status: -1)
I: Zigbee stack initialized
I: Device started for the first time
I: Start network steering
I: Started network rejoin procedure.
I: Network steering was not successful (status: -1)
I: Network steering was not successful (status: -1)
E: ERROR 35 [RET_INVALID_STATE] at ../src/main.c:210

As the build target, the nrf5340dk_nrf5340_cpuapp is selected. In the network core, I have tried several possibilites:

First I built and used the zephyr sample 802154_rpmsg: zephyr\samples\boards\nrf\ieee802154\802154_rpmsg\build_nrf5340dk_nrf5340_cpunet\zephyr\zephyr.elf.

Then I tried the one that is built together with the light_bulb-sample: nrf\samples\zigbee\light_bulb\build_nrf5340dk_nrf5340_cpuapp\802154_rpmsg\zephyr\zephyr.elf

Both leads to the same error message when pressing button 4 on the DK: ERROR 35 [RET_INVALID_STATE] at ../src/main.c:210.

I have also tried the multiprotocol one: nrf\samples\nrf5340\multiprotocol_rpmsg\build_nrf5340dk_nrf5340_cpunet\zephyr\zephyr.elf, but with no luck.

In general I miss information about how to program the network core, for samples requiring the newrok core to be programmed. It seems to be problematic to program the network core. Often I get error messages when programming it, having to switch between projects, to provoke the AP-security question, so the chip erase is performed, before being able to program the network core.

I have been able to build and program the bluetooth sample nrf\samples\bluetooth\peripheral_hids_keyboard\build_nrf5340dk_nrf5340_cpuappns, so seems to be able to program apps using the network core as such. (The sample on SDK 1.5.0 now works even from an Android phone - good! :-).

Is the Zigbee samples verified to work on the nRF5340DK, and how do I get it to work?

What I would like to do, is to boot up the light_bulb sample, launch IDENTIFY mode, and try to connect to it from an Philips Hue hub. 

Parents
  • Hi,

    Firstly, you should use the NRF Connect SDK 1.5.0 instead of NCS v1.5.0r-rc1 (release candicate 1).

    As the build target, the nrf5340dk_nrf5340_cpuapp is selected. In the network core, I have tried several possibilites:

    First I built and used the zephyr sample 802154_rpmsg: zephyr\samples\boards\nrf\ieee802154\802154_rpmsg\build_nrf5340dk_nrf5340_cpunet\zephyr\zephyr.elf.

    Then I tried the one that is built together with the light_bulb-sample: nrf\samples\zigbee\light_bulb\build_nrf5340dk_nrf5340_cpuapp\802154_rpmsg\zephyr\zephyr.elf

     Use the last one, inside the nrf\samples\zigbee\light_bulb folder, the first one is a Zephyr example not written by us.

    Both leads to the same error message when pressing button 4 on the DK: ERROR 35 [RET_INVALID_STATE] at ../src/main.c:210.

     This error message means "Operation is not setup or is in an improper state". From the log output I see that the device didn't join any network.

    I: Started network rejoin procedure.
    I: Network steering was not successful (status: -1)

    I recommend you first test this example in conjuction to the Zigbee light coordinator example to get an idea of what you are looking for when commissioning a light bulb in a network, before attending to commissioned the light bulb to a third party coordinator. Set up the nRF sniffer tool for 802.15.4 so you can see the exchange of packets in-air. In nRF5 SDK we have an example light_switch_nus which can be used to test finding and binding procedure.

    What I would like to do, is to boot up the light_bulb sample, launch IDENTIFY mode, and try to connect to it from an Philips Hue hub. 

    Again using the sniffer tool get to know the commissioning process for Zigbee. Identify mode (e.g flashing a light) is used for indicate an observer which of several devices you are working with, see the Identify cluster in the ZCL specification. In https://github.com/nrfconnect/sdk-nrf/blob/73c461e3aba1820cdf6950fe99a94bafb329d403/samples/zigbee/light_bulb/src/main.c#L208 you can see that when the light bulb is in identify mode the application will start the finding and binding procedure on HA_DIMMABLE_LIGHT_ENDPOINT. See section 8.5 Finding & binding procedure for a target endpoint on the Zigbee BDB specification.

    In general I miss information about how to program the network core, for samples requiring the newrok core to be programmed. It seems to be problematic to program the network core. Often I get error messages when programming it, having to switch between projects, to provoke the AP-security question, so the chip erase is performed, before being able to program the network core.

    For the Zigbee light bulb sample the target is nrf5340dk_nrf5340_cpuapp so there is no need to program the network core. For the examples where you need to program the network core, have you tried to follow the steps in the guide here? https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/nrf/ug_nrf5340.html#building-and-programming-a-sample

    Best regards,

    Marjeris

Reply
  • Hi,

    Firstly, you should use the NRF Connect SDK 1.5.0 instead of NCS v1.5.0r-rc1 (release candicate 1).

    As the build target, the nrf5340dk_nrf5340_cpuapp is selected. In the network core, I have tried several possibilites:

    First I built and used the zephyr sample 802154_rpmsg: zephyr\samples\boards\nrf\ieee802154\802154_rpmsg\build_nrf5340dk_nrf5340_cpunet\zephyr\zephyr.elf.

    Then I tried the one that is built together with the light_bulb-sample: nrf\samples\zigbee\light_bulb\build_nrf5340dk_nrf5340_cpuapp\802154_rpmsg\zephyr\zephyr.elf

     Use the last one, inside the nrf\samples\zigbee\light_bulb folder, the first one is a Zephyr example not written by us.

    Both leads to the same error message when pressing button 4 on the DK: ERROR 35 [RET_INVALID_STATE] at ../src/main.c:210.

     This error message means "Operation is not setup or is in an improper state". From the log output I see that the device didn't join any network.

    I: Started network rejoin procedure.
    I: Network steering was not successful (status: -1)

    I recommend you first test this example in conjuction to the Zigbee light coordinator example to get an idea of what you are looking for when commissioning a light bulb in a network, before attending to commissioned the light bulb to a third party coordinator. Set up the nRF sniffer tool for 802.15.4 so you can see the exchange of packets in-air. In nRF5 SDK we have an example light_switch_nus which can be used to test finding and binding procedure.

    What I would like to do, is to boot up the light_bulb sample, launch IDENTIFY mode, and try to connect to it from an Philips Hue hub. 

    Again using the sniffer tool get to know the commissioning process for Zigbee. Identify mode (e.g flashing a light) is used for indicate an observer which of several devices you are working with, see the Identify cluster in the ZCL specification. In https://github.com/nrfconnect/sdk-nrf/blob/73c461e3aba1820cdf6950fe99a94bafb329d403/samples/zigbee/light_bulb/src/main.c#L208 you can see that when the light bulb is in identify mode the application will start the finding and binding procedure on HA_DIMMABLE_LIGHT_ENDPOINT. See section 8.5 Finding & binding procedure for a target endpoint on the Zigbee BDB specification.

    In general I miss information about how to program the network core, for samples requiring the newrok core to be programmed. It seems to be problematic to program the network core. Often I get error messages when programming it, having to switch between projects, to provoke the AP-security question, so the chip erase is performed, before being able to program the network core.

    For the Zigbee light bulb sample the target is nrf5340dk_nrf5340_cpuapp so there is no need to program the network core. For the examples where you need to program the network core, have you tried to follow the steps in the guide here? https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/nrf/ug_nrf5340.html#building-and-programming-a-sample

    Best regards,

    Marjeris

Children
  • "For the Zigbee light bulb sample the target is nrf5340dk_nrf5340_cpuapp so there is no need to program the network core. For the examples where you need to program the network core, have you tried to follow the steps in the guide here? https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/nrf/ug_nrf5340.html#building-and-programming-a-sample"

    My understanding is that the Zigbee code needs to run in the network core of the nRF5340, and before I programmed the 802154_rpmsg into the network core, the light_bulb sample seemed to fail at startup.

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/nrf/ug_nrf5340.html#network-samples

    If there is no need to program the network core, why do the light_bulb sample build a subimage, seemingly for the network core?

    Anyways, thanks for the link. There is a lot of relevant information there, but the nRF samples is not very informative with regards to the nRF5340 and need to program the network core.

    I see the Nordic documentation says this: 

    "The nRF Connect SDK also provides ThreadZigbee, and CHIP samples that can be run on the nRF5340 DK. These samples are built for the application core, but make use of both cores. The network core application is built and programmed automatically."

    But for me, the "programmed automatically" didn't seem to happen, hence the need to program the network core manually.

    Later on in the documentation, it says that SES is unable to automatically program the network core with a child-image, it only seems to happen from some of the command line tools, so guess this is the answer:

    There is a child image meant for the network core, which is automatically built by SES, but not automatically programmed into the network core by SES

    I am good, I understand this now, but I think there is a lot of work left from Nordic regarding use of the samples on the nRF5340. The docs for each sample should include the steps needed to run them successfully on a nRF5340DK, when there is special needs on this kit.

  • We appreciate the feedback, it will be forwarded to the documentation team. Let me know if you have any other questions regarding this example.

    Best regards,

    Marjeris

Related