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

Serial Communication using a Zigbee Mesh network and nRF52840 dongle

Hi Nordic Team, 

I would like to share with you a minor challenge that we are facing to use the nRF52840 dongle with a Zigbee Mesh network and issuing a serial communication when actives by Alexa.

At the moment, I do have two programs running independent:

* Zigbee Integration with Alexa - I've used the nRF52 SDK with the light-bulb and tweak a few things and it is working smoothly with my Alexa 4th and 4 nRF52840 dongles.

* Serial Communication with nRF52840 Dongle - I've developed a new program based on the UART_SDK which is also working seemly sending and receiving serial commands from the PC.

Now, I would like to merge both in only one compiled .hex file in order to when I ask alexa to turn on the lights, the dongle will issue a serial command to a third party device to communicate with. I want to replicate it for all of my dongles and connect them with different third party devices which will have the alexa as the coordinator of the network.

The error that is showing up during the compiling process and I still adding different libraries under the SDK folder, but it still showing some errors.

Thank you in advanced for your help and support

  • Hello Marte,

    Sorry for my delay to come back to you, but I've been trying different things in the meantime. 

    In order to simplify my question, I would like to know how to Combining two example files such as : \xxxx\examples\zigbee\light_control\light_bulb and \xxxx\examples\peripheral\uart from the actual SDK for Zigbee.

    I've tried to merge both, but file doesn't compile and work. I not sure if there is a tool in order to do that, but I've also tried to do manually and it not working.

    See the print screen error attached and Identified in yellow:

    This is also what I'm trying to implement with the serial communication. Serial Data needs to be issue when a command has been executed via Alexa, using the Light Bulb SDK.

    I've read this two articles on KB but seems like they aren't able to make it work.

    https://devzone.nordicsemi.com/f/nordic-q-a/8143/how-to-combinning-two-example-files 

    https://devzone.nordicsemi.com/f/nordic-q-a/38054/how-to-combine-two-sdk_config-h-file 

    Thank you for your help

    JM

  • Hi,

    There is no tool to merge examples for you, unfortunately. In order to merge two examples you have to copy the functionality you want from one example to the other, and add the files to user include directories and the .c files in SES.

    From your error I see that it cannot find the file app_uart.h. Most likely it has not been added correctly in SES.

    To add it to user include directories do the following:

    • Right click on Project 'zigbee_light_bulb_pca10056' and select Options...
    • Make sure the configuration is set to Common, and not Debug or Release
    • Go to Preprocessor and double click on User Include Dircetories to open it
    • Add the following:
      ../../../../../../../components/libraries/uart
      Be aware that the path must be correct. It seems you are using the light bulb example, so I believe this should be correct, but you can compare it with the other directories there to make sure. A lot of them should be libraries under the components directory, so just make sure you have the same amount of "../../" before the components directory in the line you add as there are in the others.

    To add the .c file:

    • Right click on the nRF_Drivers folder in the Project Explorer in SES
    • Select Add Existing File...
    • Go to the location of the file (<T&Z_SDK>/components/libraries/uart)
    • Select the file app_uart.c

    Please let me know if you are still having issues after going through these steps.

    Best regards,

    Marte

  • Hi Marte, 

    Thanks you so much for your explanation below. At the moment I'm using the pca10059 which is the Dongle. The UART has only the pca10056 which is annoying.

    Before I do that, Do I need update the Preprocessor Definitions by removing BOARD_PCA10056 and inserting BOARD_PCA10059 or should I do this later?

    Thank you in advance

    JM

  • Hi,

    You will have to adapt the example to the board you are using to get correct pin assignment etc. We have a nRF52840 Dongle Programming Tutorial, which I highly recommend looking at when using the dongle. There you will find a guide on how to adapt nRF5 SDK projects for the dongle.

    Be aware that for the nRF52840 dongle there is no UART connected to the PC, other than the virtual COM port used for programming via Serial DFU (USB). You can implement a virtual COM port as in the USB CDC ACM Example, but in this case you are not actually using the UART peripheral on the dongle, only the USB. We recommend using the nRF52840 DK for development, as it has an onboard debugger. It can also do USB-UART bridging, so that you can actually use the UART peripheral.

    Best regards,

    Marte

Related