Git Product home page Git Product logo

zigbee-demo's Introduction

zigbee-demo

A simple webapp built with zigbee-shepherd to mimic a smart home application.

To run the demo

  • Install
$ git clone https://github.com/zigbeer/zigbee-demo.git  
$ cd zigbee-demo  
/zigbee-demo$ npm install  
  • Run the WebApp
/zigbee-demo$ npm start  
  • Open up http://0.0.0.0:3000/ with your browser
  • In the app, click PERMIT JOIN to run the demo, and you will see several devices joining the network one after another and doing something fun.

Demo

zigbee-demo's People

Contributors

jackchased avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

zigbee-demo's Issues

npm start failed on debian

I cannot run the demo on Beaglebone debian 7.9
This is the error:

root@beaglebone:~/Desktop/zigbeer/zigbee-demo# npm start

[email protected] start /root/Desktop/zigbeer/zigbee-demo
cross-env NODE_ENV=production node main

/root/Desktop/zigbeer/zigbee-demo/node_modules/cross-env/dist/index.js:70
var envVars = Object.assign({}, process.env);
^
TypeError: Object function Object() { [native code] } has no method 'assign'
at getEnvVars (/root/Desktop/zigbeer/zigbee-demo/node_modules/cross-env/dist/index.js:70:24)
at getCommandArgsAndEnvVars (/root/Desktop/zigbeer/zigbee-demo/node_modules/cross-env/dist/index.js:50:17)
at crossEnv (/root/Desktop/zigbeer/zigbee-demo/node_modules/cross-env/dist/index.js:23:31)
at Object. (/root/Desktop/zigbeer/zigbee-demo/node_modules/cross-env/dist/bin/cross-env.js:10:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)

npm ERR! [email protected] start: cross-env NODE_ENV=production node main
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the zigbee-demo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=production node main
npm ERR! You can get their info via:
npm ERR! npm owner ls zigbee-demo
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.8.13-bone79
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! cwd /root/Desktop/zigbeer/zigbee-demo
npm ERR! node -v v0.10.38
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/Desktop/zigbeer/zigbee-demo/npm-debug.log
npm ERR! not ok code 0

how to assign to correct models without ieee address

hi all,
i study this project, zigbee-demo to build self product now.
how to create a model without the models ieee address,
and the server app on zigbee znp.

how to assign to correct models when know the models information(endpoint id, device id ,in/out cluster and att id).

it seem need know device ieee address to read/write action(server.js),*1 and
build models(models.js)*2

*1:
ioServer.regReqHdlr('write', function (args, cb) {
var auxId = _.split(args.auxId, '/'), // [ epId, cid, rid ]
ieeeAddr = args.permAddr,
epId = parseInt(auxId[0]),
cid = auxId[2],
val = args.value,
ep = shepherd.find(ieeeAddr, epId);

    if (ieeeAddr === '0x00124b0001ce1003') {
        // ep.functional = model.functional;
        toggleDev(ep, cid, val);
    } else if (cid === 'genOnOff') {
        var cmd = val ? 'on' : 'off';
        ep.functional('genOnOff', cmd, {}, function (err, rsp) {});

}

*2.
var weatherDevInfo = {
type: 'EndDevice',
ieeeAddr: '0x00124b0001ce1001',
nwkAddr: 1,
manufId: 0,
epList: [ 1, 2 ],
endpoints: {
1: { // temperature
profId: 0x0104, epId: 1, devId: 770, inClusterList: [ 1026 ], outClusterList: [],
clusters: { msTemperatureMeasurement: { dir: 1, attrs: { measuredValue: 0 } } }
},
2: { // humidity
profId: 0x0104, epId: 2, devId: 770, inClusterList: [ 1029 ], outClusterList: [],
clusters: { msRelativeHumidity : { dir: 1, attrs: { measuredValue: 0 } } }
}
}
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.