-
Notifications
You must be signed in to change notification settings - Fork 31
Home
cc-znp allows you to interact with TI's CC253X ZigBee Network Processor(ZNP) on node.js via TI Z-Stack Monitor and Test(MT) APIs upon an UART interface.
This project aims to provide an opportunity for those who like to build IoT applications with zigbee on node.js. With node.js, back-end developers can have RESTful APIs to bring zigbee machines to web world easily, and can push machines to the cloud as well. For front-end developers, they can do more creative things with Javascript, and can build any fascinating GUI they want with many cool UI frameworks.
The following diagram shows the scenario when CC253X operates as a ZNP. In this case, the ZigBee stack is running on CC253X, and the application (app) is running on an external host, i.e. a microcontroller or an application processor. The app can do its job in a resourceful environment and work with ZNP for network transportation.
$ npm install cc-znp --save
## 4. Usage
To begin with cc-znp, firstly set up the serial port and call init() to enable the interface:
var znp = require('cc-znp');
var spCfg = {
path: '/dev/ttyUSB0',
options: {
baudrate: 115200,
rtscts: true
}
};
znp.on('ready', function () {
console.log('Initialization completes.');
// start to run your application
});
znp.init(spCfg, function (err) {
if (err)
console.log(err);
});