Skip to content

gl-inet/gl-zigbee-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GL-Zigbee SDK for GL.iNet zigbee gateway

GL-Zigbee SDK is developed and provided by GL-iNet Technology as a part of the zigbee solution. The SDK encapsulates the communication between the gateway and the zigbee module, allowing third-party developers to focus on the business layer rather than the communication layer.

Support device

System requirements

  • x86_64 platform

  • Ubuntu or another linux distro

Compiling under Windows can be done using the Windows Subsystem For Linux (WSL) with Ubuntu installed to it. Follow the guide bellow, installing Ubuntu 18.04 LTS from the Microsoft Store:

https://docs.microsoft.com/en-us/windows/wsl/install-win10

Preparing your build environment

Before using the SDK, you need to install the Openwrt SDK environment.

https://github.com/gl-inet/sdk

Downloads

$ git clone https://github.com/gl-inet/gl-zigbee-sdk.git

Compiling

Place your package in openwrt-sdk/<version>/<target>/package/, then run:

$ cd sdk/<version>/<target>/
$ make package/<package_name>/compile V=s

For example, to compile the zigbee SDK for the S1300

$ cd sdk/qsdk53/ipq806x/
$ make package/gl-zigbee-sdk/{clean,compile} V=s

If there is a problem with missing dependent libraries during compilation, follow these steps

$ ./scripts/feeds update -f
$ ./scripts/feeds install <dependency_name>

Directory Structure

|—— Makefile
|
|—— LICENSE								
|
|—— VERSION_FILE							
|
|—— README							
|
|—— doc									               # document
|	|—— Zbtool User Guide
|	|—— GL-Zigbee SDK User Guide
|
|—— files
|	|—— gl-zbtool.init				      	# configuration file
|
|—— src
    |—— components
    |   |—— dev_mgr
    |   |—— log
    |  	|—— thread
    |
    |—— daemon 						         	# zb daemon
    |   |—— daemon
    |   |—— zbdriver
    |       |——silabs				     	# silabs SDK
    |
    |—— include               	# header file 
    |
    |—— lib                  		# zb api lib
    |   |—— libglzbapi.h
    |   |—— libglzbapi.c
    |
    |—— project             			# user application file
    |   |—— demo.c	        				# demo file
    |
    |—— tool                     	
    |   |—— cli.c						# debug tool – zbtool
    |
    |—— Makefile

API Refrence

Look at the doc/GL-Zigbee SDK User Guide. It contains all detail about the API.

Q&A

zbdaemon don't work

  1. Check the hardware configuration is correctly imported.

    root@OpenWrt:~# uci show zigbee
    zigbee.spi=interface
    zigbee.uart=interface
    zigbee.uart.port='/dev/ttyS0'
    zigbee.uart.baudrate='115200'
    zigbee.uart.flow_control='n'
    zigbee.uart.reset_method='soft'
  2. Check that the reset IO is generated correctly and pulled up correctly.

    root@OpenWrt:~# cat /sys/class/gpio/gpio1/value 
    1
  3. Check whether the serial port is used by other function, especially the system debugging serial port.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages