stormboy / node-zbee

A NodeJS module for communicating with Zigbee devices using an XBee.
GNU Lesser General Public License v3.0
17 stars 2 forks source link

QUERY: understanding the basics #3

Closed mrose17 closed 10 years ago

mrose17 commented 10 years ago

thanks for assembling this package! sorry if some of these questions lack clue.

i am one of the curators of #thethingsystem - http://thethingsystem.com/ - an open source home autonomy server. the primary repo is there: https://github.com/TheThingSystem/steward

our goal is to support as many things as possible. i am now in the process of exploring adding zigbee support. i've got your package with a digi xstick2 zb running on my Mac, RPi, and BBB.

what i now need to do is internalize the design pattern to use for:

when i run app.js on a network with a zigbee smart plug and thermo/hydrometer, this is what i see after i do a reset, configure, allow join from the app.'s window:

%  node app.js
info  - socket.io started
datastore initialising
Zigbee manager server listening on port 3000
ZBee initialised. Parameters: { panid: '0000000000000000',
  id: ' ',
  sourceHigh: '0013a200',
  sourceLow: '40b663de',
  nodeDiscoveryTime: 6000 }
self node: { dec: [ 0, 19, 162, 0, 64, 182, 99, 222 ],
  hex: '0013a20040b663de' }
Firmware Version: 21a7
info  - handshake authorized rzqTNV4qZGKYYss_35aP
A client socket connected!
received command:  reset , data:  undefined
--- got zbee watchdogReset
--- got zbee coordinatorStarted
received command:  configure , data:  undefined
configuring
--- got zbee disassociated
--- got zbee coordinatorStarted
received command:  join , data:  undefined
joing allowed
Node 00137a0000009a70 discovered
Node 00137a0000009a70 got End Device Announce: { address16: [ 30, 17 ],
  address64: [ 0, 19, 122, 0, 0, 0, 154, 112 ],
  capability: 128 }
Node 00137a0000009a70 got End Device Announce: { address16: [ 30, 17 ],
  address64: [ 0, 19, 122, 0, 0, 0, 154, 112 ],
  capability: 128 }
Node 00137a0000009a70: could not locate app for endpoint: 10
Node 00137a0000009a70: could not locate cluster for endpoint: 10, clusterID: 1026 attribute report: {"address64":"00137a0000009a70","endpoint":10,"profileId":260,"clusterId":1026,"attributes":[{"id":0,"type":41,"data":[227,9]}]}
Node 00137a0000009a70: could not locate cluster for endpoint: 10, clusterID: 1029 attribute report: {"address64":"00137a0000009a70","endpoint":10,"profileId":260,"clusterId":1029,"attributes":[{"id":0,"type":33,"data":[162,17]}]}
error getting active endpoints: { msg: 'Never got Transmit status from XBee' }
Node 00137a0000009a70 got End Device Announce: { address16: [ 30, 17 ],
  address64: [ 0, 19, 122, 0, 0, 0, 154, 112 ],
  capability: 128 }
Node 00137a0000009a70: could not locate cluster for endpoint: 10, clusterID: 1026 attribute report: {"address64":"00137a0000009a70","endpoint":10,"profileId":260,"clusterId":1026,"attributes":[{"id":0,"type":41,"data":[1,10]}]}
Node 00137a0000009a70: could not locate cluster for endpoint: 10, clusterID: 1029 attribute report: {"address64":"00137a0000009a70","endpoint":10,"profileId":260,"clusterId":1029,"attributes":[{"id":0,"type":33,"data":[101,17]}]}

can you give me a hint as to how to interpret this? (i did the reset and the configure just to get a clean slate with the stick, as i've been testing it on multiple devices)

many thanks!

mrose17 commented 10 years ago

@stormboy - hi. don't want to nag, but any chance you could put me on the path to enlightenment? many thanks!

stormboy commented 10 years ago

I've just come back from hiking, so I am catching up with civilisation right now.

Hey, great to know you're interested. I've been keeping an eye on The Thing System as I've been interested in the space of unifying the IoT. In fact, I worked on a project that was working towards this commencing around 2001. The backing of that project faded a few years, but some code has been put on GitHub under the name "Meemplex" https://github.com/ekoliving/Meemplex (with no documentation).

From the log above it looks like:

Are you using my fork of the xbee module? I remember one of the main things was that "reply" messages were not handled properly on the main fork. Not sure if 'Never got Transmit status from XBee' is to do with that.

I hope that helps for a start.

Sorry, it's been a number of months since I've looked at this module, but I do have a motive to get back into this project because I have some Zigbee devices at home that I need to hook into my own system (which includes LIFX, Hue, Nest, Wemo, Zigbee Power meter, Solar inverter, Pioneer AVR, etc).

mrose17 commented 10 years ago

hi. welcome back!

thanks for the response.

2001? that's pretty early…

i'm using your node-zbee which has a package.json with this dependency:

    "svd-xbee": "git://github.com/stormboy/svd-xbee"

so, i think that's all your forks.

zigbee would be a big plus for #thethingsystem. i've got an ecobee smart plug, an iris smart plug, a zbht-2 temperature/humidity sensor, and a few other things in my "zigbee drawer" (seriously).

the good news is that #thethingsystem has support for lifx, hue, nest, and wemo (except the baby monitor).

can you give me pointers to the solar inverter and pioneer avr you are using?

…and, here's my pitch:

since this is an open source project, it's not a paying job, but i'm happy to donate hardware that's needed (a decade ago that'd be expensive!)

does that sound feasible?

thanks!

stormboy commented 10 years ago

Sounds good. I'll look into using thethingsystem side-by-side with my existing system in which modules communicate via MQTT and I have a web UI here https://github.com/stormboy/whims.

I have some Netvox gadgets, mainly focussed on wall plugs, buttons, and motion sensors. I don't have any Zigbee temperature or humidity sensors.

I get my smart meter data using a Raven USB stick (http://rainforestautomation.com/raven) as the Zigbee comms can only happen with a secret key, which is not easily achievable for open source projects. This device outputs an XML stream. My module: https://github.com/stormboy/node-raven . The data is picked up via MQTT and logged via this module https://github.com/stormboy/node-meem-datalog which also serves up historical data on request.

I'm reading data from my Aurora inverter over RS485 using the aurora command line tool (http://www.curtronics.com/Solar/AuroraData.html) in a cron job. Not really neat, but it works.

I have a Pioneer VSX 2021 AV receiver that can be controlled over IP. My module: https://github.com/stormboy/node-pioneer-avr

mrose17 commented 10 years ago

nice. i hope to have something in the github repo for the steward in about a week for you on the zigbee stuff.

the steward supports mqtt in both directions, though i'm not sure how helpful that would be for you. i'm taking a look at the raven stick and the pioneer avr.

yes, the api key is a big pain. several of my modules require them as well. sigh.