Filter results by

ZigBee Application Programming – ARTIK Gateway

The ZigBee application programming interface you use depends on the module type.

  • ARTIK 030 modules use the Simplicity Studio ZigBee stack and gcc or IAR compiler. Refer to the ARTIK 030 ZigBee article for full details.

  • ARTIK 5/7/10 modules can use (in order of increasing complexity):
    – ZigBee API (SDK calls, use ARTIK IDE on development PC to compile)
    – libzigbee API (C++ calls, use gcc on ARTIK board to compile)
    – Simplicity Studio stack (generate in Simplicity Studio, compile on ARTIK board)

In all cases, you can also use the Command Line Interface to send commands, read attributes, and get status information.

Custom A5/7/10 Applications

Our pre-built utility programs introduced you to using ARTIK Linux-based devices in a ZigBee environment. To develop your own ZigBee applications on an ARTIK 5/7/10 board, you'll start from your development PC. From there, the action depends on your approach:

  • ZigBee API (ARTIK IDE): Cross-compile them in the IDE and copy the binary file to your ARTIK board

  • libzigbee: Copy the source files to your ARTIK board and compile them natively using libzigbee libraries

  • Simplicity (Simplicity IDE): Generate the source files in Simplicity and then copy the entire environment over to your ARTIK board to compile natively using ZigBee libraries.


The fastest and simplest approach to ZigBee development is to use the ZigBee API. You use its calls just like any other ARTIK API calls.

If you'd like to start using the ZigBee API, we've got an easy project for you! Recreate the zigbee-test program we used in the introductory article, and then modify it for your own application.

  1. Go to ARTIK IDE – Linux Projects and follow the instructions.
  2. When you get to the screen that lets you choose the application you want to develop, choose ZigBee.

  3. Once the example loads, delete the artik_zigbee_cli.c file. It's there for your reference, but conflicts with artik_zigbee_test.c if present at compile time.

  4. Compile and run the project as-is to verify that the code provided generates the utility program you have used throughout these articles.

Now you can augment it to suit your needs. Have fun!

Advanced: Use libzigbee device library

The libzigbee device library consists of API calls tailored to specific device types. This concise code may be more appropriate for embedded applications with limited memory footprints. Go to the libzigbee article for more information.

Optional: Use ZigBee stack

You may consider using the ZigBee stack for development. This approach is for advanced users only. The information presented is for an earlier stack and will need tweaking to work for you.

Customize your ZigBee development if you have special needs that go beyond the current ZigBee API capabilities, such as developing for ZigBee 3.0 (not yet supported in the API). As the approach described here requires deep knowledge of the ZigBee stack internals, we recommend that you try using the ZigBee API first.

You can only access the Simplicity Studio ZigBee stack for ARTIK 5/7/10 if you have also purchased an ARTIK 030 kit to register.

When you create an application, keep in mind that your program will be communicating directly over the UART interface with the NCP to send commands and receive data. You should first learn more about how the NCP and the ARTIK processor communicate. The NCP application note is a good place to start.

Main directory:

in the documentation folder:

Create NCP application. Follow this procedure on the development PC you used to install your ARTIK 030 Simplicity Studio software, which is prerequisite to developing ARTIK 5/7/10 applications.

  1. If not present, create a new directory builder inside this directory:

  2. In Simplicity Studio 4.0, select File > Switch Workspace > Other to change the workspace to point to the directory you just created. After switching the workspace, Simplicity Studio 4.0 will restart.

  3. Create your project in Simplicity.
    1. Choose File > New > Project and create an AppBuilder project.
    2. Select the ZCL application type.

    3. Choose the Host stack, not the SoC stack.

    4. Pick a project, such as XncpLed, or start from a blank one if you prefer.

    5. Continue clicking Next and Finish to get to the main project. You can ignore chip selection and messages about boards and toolchains; they don't matter, as you will be compiling the code in its native environment.

    6. Under the HAL Configuration tab, look under "Platform configuration" to set "Wireless Chip" to EM3587, and "Host" to Unix host. Set other tab information according to the device you're trying to create.

    7. You'll also need to select the correct UART port and method.

      Serial port Flow control
      520 ttySAC1 rts-cts (hardware)
      530 ttyAMA1 rts-cts (hardware)
      710 ttySAC0 xon-xoff (software)
      1020 ttySAC0 rts-cts (hardware)
  4. Click Generate to produce the output files. Note that they are all under the \vx.x.x.x\app\builder\ directory.

  5. Close the Simplicity Studio program.

Compile under Linux. Follow this procedure to transfer source code to your ARTIK board for compilation.

  1. Using a program like WinSCP, copy the vx.x.x.x directory with all its subdirectories under
    to the /root directory on the ARTIK board.

  2. On your ARTIK board Linux command line, cd to your project directory /root/vx.x.x.x/app/builder/(your_project).

  3. Type make NO_READLINE=1 to begin compiling.

Your executable file is now here:


Run the program. Before you can run your program, you'll need to install and start the corresponding application on the radio chip side, as noted in AN1010-Customized-NCP.pdf. Then you can execute your program as you would any other.


When running your own applications, you must temporarily stop or permanently disable the ZigBee daemon.
systemctl disable zigbeed

Last updated on: