WebThingsIO / zigbee-adapter

Zigbee adapter add-on for WebThings Gateway
Mozilla Public License 2.0
46 stars 29 forks source link

RaspBee Zigbee adapter #110

Closed scoppeeck closed 4 years ago

scoppeeck commented 6 years ago

Hi everyone,

I'm fully noob into RPi, coding, Arduino, etc. but wanted to get in with something "easy" and usefull to start.

I therefore decided to go for some domotic application with a first step:

Therefore I did a reset of the bulbs, trying to scan via the gateway but didn't find any.

I'm thinking that the first problem probably is the compatibility of my Zigbee module with Mozilla IoT. I've look for driver files (should be in .deb I guess?) and found 2 on the manufacturer website but I don't know how I am supposed to install those.

Do you think this would be the cause? Did anyone tried this with that module? Otherwise any other suggestion is more than welcome :-).

Thanks in advance.

Cheers,

Sylvain

mrstegeman commented 6 years ago

@scoppeeck Currently, only the Digi XStick is supported for Zigbee. However, we are actively looking into additional hardware that we could support.

Duplicate of #1042

benfrancis commented 6 years ago

See also https://github.com/mozilla-iot/wiki/wiki/Supported-Hardware

scoppeeck commented 6 years ago

thanks for your response. Indeed I saw the list but the module was much cheaper and I also thought it would be more convenient than an USB dongle.

I expected it would be possible to parameter and test it somehow and it would then be an additional option in your list.

rahul-thakoor commented 6 years ago

Hello. I am also looking into using the raspbee premium with the gateway. Any luck so far?

dhylands commented 6 years ago

It is currently unsupported

jakub-rc commented 5 years ago

Hi together, it does work now using the zigbee-conbee-adapter form here and the deconz-rest-api.

Raspbee is serving as a gateway, Zigbee-Things (Plugs, Switches) can be discovered using the phoscon app and the Mozilla Things Gateway finds connected devices using the normal search via the zigbee-conbee-adapter REST Interface.

The list of currently supported devices.

dhylands commented 5 years ago

I have my development version working with the ConBee (directly without having to go through the rest api). This is the same protocol as the RaspBee, so it should only be a couple weeks and I'll have a chance to have tested things with the RaspBee.

asecor commented 5 years ago

I have my development version working with the ConBee (directly without having to go through the rest api). This is the same protocol as the RaspBee, so it should only be a couple weeks and I'll have a chance to have tested things with the RaspBee.

We should then be able to connect the ConBee USB to an RPi and do the scanning/pairing from within Mozilla IoT?

dhylands commented 5 years ago

Yes - that is supported now.

piccolobill commented 5 years ago

So, at the end, the rasbee board is full supported as the Conbee usb stick?

dhylands commented 5 years ago

There is still one missing piece, which is specifying the serial port. The default image sets up the serial port to be used as a console. What I was thinking of doing was to put a configuration option on the zigbee addon page to allow a serial port to be specified and just assume that the user had done appropriate system level configuration, like disabling the console. So I think I'll reopen this since the RaspBee still isn't supported.

oleg77s commented 4 years ago

still waiting for the rasbee board support too

mrstegeman commented 4 years ago

@oleg77s Can you tell me if the RaspBee is detected by the adapter at all? It would be logged in your gateway log. I know the adapter doesn't currently use it, but I'm wondering if it at least sees it.

Can you do the following and post the output, please?

grep 'zigbee:' ~/.mozilla-iot/log/run-app.log*
NODE_PATH=~/.mozilla-iot/addons/zigbee-adapter/node_modules node ~/mozilla-iot/gateway/tools/list_ports.js
oleg77s commented 4 years ago

@mrstegeman, sorry for delay,
RaspBee ZigBee firmware uses the serial interface /dev/ttyAMA0 4.4.How to enable access to serial port /dev/ttyAMA0In the standard Raspbian Linux distribution the serial interface /dev/ttyAMA0is set up as a serial console, i.e. for boot message output. Since the RaspBee ZigBee firmware uses the same interface to communicate with the control software, the following changes must be done to “free” the UART: 1.disable commandline over serial: $ sudo raspi-configAdvanced Options ->Serial->Disable Commandline over Serial 2.disable gettyservice:$ sudo systemctl disable serial-getty@ttyAMA0.service 3.in the file /boot/cmdline.txt:If present remove the text “console=serial0,115200” On Raspberry Pi 3 the onboard Bluetooth needs to be disabled since itis using the UART pins 14 and 15 which are also used by RaspBee 1.in the file /boot/config.txt add the line:dtoverlay=pi3-disable-bt 2.disable Bluetooth modem service$ sudo systemctl disable hciuart

pi@gateway:~ $ grep 'zigbee:' ~/.mozilla-iot/log/run-app.log*
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:32:07.467 INFO   : zigbee: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:32:11.669 INFO   : zigbee: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:32:11.670 INFO   : zigbee: DEBUG config = ''
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:32:11.673 INFO   : zigbee: Serial ports that were found:
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:32:11.723 INFO   : zigbee: Serial Device found @ /dev/ttyAMA0
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:32:11.724 INFO   : zigbee: Serial Device found @ /dev/ttyS0
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:32:11.729 ERROR  : zigbee: Failed to start add-on zigbee-adapter: No Zigbee dongle found
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:33:09.006 INFO   : zigbee: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:33:10.369 INFO   : zigbee: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:33:10.564 INFO   : zigbee: DEBUG config = ''
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:33:10.996 INFO   : zigbee: Serial ports that were found:
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:33:11.243 INFO   : zigbee: Serial Device found @ /dev/ttyAMA0
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:33:11.245 INFO   : zigbee: Serial Device found @ /dev/ttyS0
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:33:11.248 ERROR  : zigbee: Failed to start add-on zigbee-adapter: No Zigbee dongle found
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:52:02.297 INFO   : zigbee: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:52:04.727 INFO   : zigbee: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:52:05.010 INFO   : zigbee: DEBUG config = ''
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:52:05.442 INFO   : zigbee: Serial ports that were found:
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:52:05.702 INFO   : zigbee: Serial Device found @ /dev/ttyAMA0
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:52:05.705 INFO   : zigbee: Serial Device found @ /dev/ttyS0
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 18:52:05.708 ERROR  : zigbee: Failed to start add-on zigbee-adapter: No Zigbee dongle found
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:00:16.553 INFO   : zigbee: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:00:18.828 INFO   : zigbee: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:00:19.174 INFO   : zigbee: DEBUG config = ''
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:00:19.704 INFO   : zigbee: Serial ports that were found:
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:00:20.084 INFO   : zigbee: Serial Device found @ /dev/ttyAMA0
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:00:20.088 INFO   : zigbee: Serial Device found @ /dev/ttyS0
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:00:20.092 ERROR  : zigbee: Failed to start add-on zigbee-adapter: No Zigbee dongle found
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:10:39.758 INFO   : zigbee: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:10:42.237 INFO   : zigbee: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:10:42.643 INFO   : zigbee: DEBUG config = ''
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:10:43.054 INFO   : zigbee: Serial ports that were found:
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:10:43.318 INFO   : zigbee: Serial Device found @ /dev/ttyAMA0
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:10:43.320 INFO   : zigbee: Serial Device found @ /dev/ttyS0
/home/pi/.mozilla-iot/log/run-app.log:2020-02-11 19:10:43.322 ERROR  : zigbee: Failed to start add-on zigbee-adapter: No Zigbee dongle found
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:38:52.337 INFO   : zigbee: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:38:54.389 INFO   : zigbee: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:38:54.631 INFO   : zigbee: DEBUG config = ''
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:38:55.094 INFO   : zigbee: Serial ports that were found:
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:38:55.409 INFO   : zigbee: Serial Device found @ /dev/ttyAMA0
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:38:55.412 INFO   : zigbee: Serial Device found @ /dev/ttyS0
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:38:55.415 ERROR  : zigbee: Failed to start add-on zigbee-adapter: No Zigbee dongle found
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:39:24.027 INFO   : zigbee: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:39:25.370 INFO   : zigbee: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:39:25.578 INFO   : zigbee: DEBUG config = ''
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:39:26.095 INFO   : zigbee: Serial ports that were found:
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:39:26.373 INFO   : zigbee: Serial Device found @ /dev/ttyAMA0
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:39:26.375 INFO   : zigbee: Serial Device found @ /dev/ttyS0
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:39:26.377 ERROR  : zigbee: Failed to start add-on zigbee-adapter: No Zigbee dongle found
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:45:14.996 INFO   : zigbee: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:45:16.252 INFO   : zigbee: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:45:16.494 INFO   : zigbee: DEBUG config = ''
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:45:16.893 INFO   : zigbee: Serial ports that were found:
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:45:17.137 INFO   : zigbee: Serial Device found @ /dev/ttyAMA0
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:45:17.139 INFO   : zigbee: Serial Device found @ /dev/ttyS0
/home/pi/.mozilla-iot/log/run-app.log.2020-01-03:2020-01-03 15:45:17.142 ERROR  : zigbee: Failed to start add-on zigbee-adapter: No Zigbee dongle found
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:32:07.467 INFO   : zigbee: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:32:11.669 INFO   : zigbee: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:32:11.670 INFO   : zigbee: DEBUG config = ''
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:32:11.673 INFO   : zigbee: Serial ports that were found:
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:32:11.723 INFO   : zigbee: Serial Device found @ /dev/ttyAMA0
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:32:11.724 INFO   : zigbee: Serial Device found @ /dev/ttyS0
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:32:11.729 ERROR  : zigbee: Failed to start add-on zigbee-adapter: No Zigbee dongle found
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:33:09.006 INFO   : zigbee: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:33:10.369 INFO   : zigbee: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:33:10.564 INFO   : zigbee: DEBUG config = ''
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:33:10.996 INFO   : zigbee: Serial ports that were found:
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:33:11.243 INFO   : zigbee: Serial Device found @ /dev/ttyAMA0
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:33:11.245 INFO   : zigbee: Serial Device found @ /dev/ttyS0
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:33:11.248 ERROR  : zigbee: Failed to start add-on zigbee-adapter: No Zigbee dongle found
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:52:02.297 INFO   : zigbee: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:52:04.727 INFO   : zigbee: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:52:05.010 INFO   : zigbee: DEBUG config = ''
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:52:05.442 INFO   : zigbee: Serial ports that were found:
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:52:05.702 INFO   : zigbee: Serial Device found @ /dev/ttyAMA0
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:52:05.705 INFO   : zigbee: Serial Device found @ /dev/ttyS0
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 18:52:05.708 ERROR  : zigbee: Failed to start add-on zigbee-adapter: No Zigbee dongle found
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:00:16.553 INFO   : zigbee: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:00:18.828 INFO   : zigbee: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:00:19.174 INFO   : zigbee: DEBUG config = ''
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:00:19.704 INFO   : zigbee: Serial ports that were found:
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:00:20.084 INFO   : zigbee: Serial Device found @ /dev/ttyAMA0
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:00:20.088 INFO   : zigbee: Serial Device found @ /dev/ttyS0
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:00:20.092 ERROR  : zigbee: Failed to start add-on zigbee-adapter: No Zigbee dongle found
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:10:39.758 INFO   : zigbee: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:10:42.237 INFO   : zigbee: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:10:42.643 INFO   : zigbee: DEBUG config = ''
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:10:43.054 INFO   : zigbee: Serial ports that were found:
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:10:43.318 INFO   : zigbee: Serial Device found @ /dev/ttyAMA0
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:10:43.320 INFO   : zigbee: Serial Device found @ /dev/ttyS0
/home/pi/.mozilla-iot/log/run-app.log.2020-02-11:2020-02-11 19:10:43.322 ERROR  : zigbee: Failed to start add-on zigbee-adapter: No Zigbee dongle found
pi@gateway:~ $
 pi@gateway:~ $ NODE_PATH=~/.mozilla-iot/addons/zigbee-adapter/node_modules node ~/mozilla-iot/gateway/tools/list_ports.js
Serial Device found @ /dev/ttyAMA0
Serial Device found @ /dev/ttyS0
pi@gateway:~ $ 
davehylands commented 4 years ago

Currently, the zigbee adapter only supports USB serial based devices. In theory the RaspBee could be made to work, but you'd need a way to tell the zigbee adapter to use it.

kisamoto commented 4 years ago

Any pointers about where I should start looking if I wanted to try developing support for the RaspBee?

Got a bit of time (and have ordered a RaspBee) so happy to try getting it to work and submitting a PR.

mrstegeman commented 4 years ago

Essentially, you'll need to do the following:

  1. Add a config item here and here which allows the user to specify a serial port path, e.g. /dev/ttyAMA0 or something.
  2. Inside loadZigbeeAdapters, read that config value and load up a new XBeeDriver instance for that port.
chiro79 commented 4 years ago

Hi,I managed to get a RaspBee 2 working. I had to empty the “filter” array with an empty object in “/home/pi/.mozilla-iOS/addons/zigbee-adapter/index.js” for the deconz prober. Also I changed the checksum of that file to make it recognized. It seems that the vendor information for this RaspBee 2 is different than before.

mrstegeman commented 4 years ago

@chiro79 would you want to open a pull request?

krishnanarun commented 4 years ago

Hi, I am an absolute noob at this and am trying to enable a raspbee 2 with my setup. The Conbee 2 works perfectly but I want to move to a raspbee 2 due to space constraints. I followed the advice up to disabling BT and all sections till there. I am now lost on how to make the adapter identify the raspbee 2 board and not expect a USB dongle which it currently does. A set by step would be greatly appreciated.

maxecharel commented 4 years ago

Hi everyone. I agree with @krishnanarun, some kind of step by step guide would be greatly appreciated. Having the Raspbee II directly supported would be even better; @chiro79 what about opening a pull request as suggested by @mrstegeman ? That would be awesome.

krishnanarun commented 4 years ago

@chiro79, @mrstegeman If you are not able to pull request, it would at least be really great if you could provide exact details of the code bits that need to be added to the 2 files (for Serial Port variable) and also the details of how to program the XBeeDriver code bits with the various settings like vendor id etc. If you need help with that, I can install the Phoscon Gateway and read the various settings if you tell me how to since I have the devices and the means but not the knowledge.

chiro79 commented 4 years ago

Hi all, sorry for not answering. I'm not an expert in Javascript, but as I own a RaspBee 2 and I managed to make it work I will try to fix it. Can anyone guide me on how to test the changes? Basically I will add new values in the deCONZ probe.

davehylands commented 4 years ago

The serial-prober-node repository has a serial-test.js where you can make the changes and see how the serial prober reacts. This is generally easier than trying to test as part of the gateway. Can you elaborate on what changes you want to make? Is this going to be compatible with the old ConBee dongles?

krishnanarun commented 4 years ago

Hi @chiro79, it would be awesome if you could provide the settings/entries/code for the various files you put in to get it working. I also own a Raspbee II and a Conbee 2 so can help testing as required. Not a coding expert either so can't do anything major on my own but can hold fort if I get instructions of what needs to be changed and where. Thanks a lot.

chiro79 commented 4 years ago

Hi, I'm testing the serial-prober-node project and it seems that RaspBee doesn't expose any useful information in oder to use the filter functionality of the serial-prober project... in the serial-test.js several probes are defined. All of them fail because of the filters. More exactly every filter fails in this line of the serial-prober.js file: if (typeof port[key] !== 'string') {

Looking at the information the RaspBee exposes, I have this: {"comName":"/dev/ttyAMA0"}

So, basically no information. I don't know if I'm missing something but if I'm right, and in order to make it work, we need to add a new Prober without filters (or, as this is a little bit drastic solution add a new parameter in the zigbee-adapter project to specify this very specific scenario).

I have changed successfully the serial-test.js file, so I will create two versions for the zigbee-adapter project to let y'all agree on the best approach. Hopefully tomorrow.

davehylands commented 4 years ago

It should probably filter based on filename, and there should be an explicit boolean to enable using a non-USB serial port, so that we don't send out probe bytes on a serial port that was might be used for something else (i.e. there are similar ZWave TTL serial adapters).

davidhitchins commented 4 years ago

It's now July 2020 - two years later - and it seems that the RaspBee II gateway still isn't supported. I wish I had just bought the ConBee II usb dongle! But the Raspbee II is much more compact and the list at the bottom of this page https://phoscon.de/en/raspbee2 seemed to indicate the RaspBeel II was supported. Has anyone found a way to make it work?

frederic34 commented 4 years ago

Take care there are two RASPBEE model, the new one RASPBEE II and the older RASPBEE

davidhitchins commented 4 years ago

Yes, thank you, I am aware of the two models and I have the Raspbee II. I am hoping that some sort of tweak to the code as suggested by @chiro79 above or using the Zigbee-Conbee adapter. or anything else will get it working.

davidhitchins commented 4 years ago

Any news on how to get the Raspbee II working? I have time to try any suggestions. The ones already given above seem to lead nowhere for me. One should never buy the latest and greatest seems to be the moral... ;-)

frederic34 commented 4 years ago

did you look here https://github.com/mozilla-iot/zigbee-adapter/issues/7

davidhitchins commented 4 years ago

No I didn't see that. Thanks. Will check it out.

davidhitchins commented 4 years ago

Well, I haven't given up yet with the Raspbee II. I seem to be quite close to making it work but weird things are happening when I follow the suggestions given here and here. The latter produced this result: pi@**:~ $ NODE_PATH=~/.mozilla-iot/addons/zigbee-adapter/node_modules node ~/mozilla-iot/gateway/tools/list_ports.js internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'serialport' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object. (/home/pi/mozilla-iot/gateway/tools/list_ports.js:5:20) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3)

then AFTER INSTALLING SERIALPORT this result:

pi@**:~ $ NODE_PATH=~/.mozilla-iot/addons/zigbee-adapter/node_modules node ~/mozilla-iot/gateway/tools/list_ports.js (node:1350) UnhandledPromiseRejectionWarning: TypeError: SerialPort.list no longer takes a callback and only returns a promise at Function.SerialPort.list (/home/pi/mozilla-iot/gateway/node_modules/@serialport/stream/lib/index.js:651:11) at Object. (/home/pi/mozilla-iot/gateway/tools/list_ports.js:18:12) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Function.Module.runMain (internal/modules/cjs/loader.js:831:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) (node:1350) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:1350) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Can someone please point me in the right direction to fix this? Could it be that the latest SD card image I installed from Mozilla Gateway isn't actually up-to-date hence the above errors? Sorry to be importunate (I'm not a real coder) but determined to see this through!

davehylands commented 4 years ago

list_ports.js is debug code that doesn't get executed normally and doesn't appear to have been updated to match with the latest SerialPort. Edit list_ports.js:

diff --git a/tools/list_ports.js b/tools/list_ports.js
index 762856e2..a4d87946 100755
--- a/tools/list_ports.js
+++ b/tools/list_ports.js
@@ -15,11 +15,7 @@ function extraInfo(port) {
   return output;
 }

-SerialPort.list((error, ports) => {
-  if (error) {
-    console.log('Error:', error);
-    return;
-  }
+SerialPort.list().then((ports) => {
   for (const port of ports) {
     if (port.vendorId) {
       const vidPid = `${port.vendorId}:${port.productId}`;
davehylands commented 4 years ago

I created PR https://github.com/mozilla-iot/gateway/pull/2570 to address this.

davehylands commented 4 years ago

And I now get this output when run on an RPi 3 with no dongles plugged in:

Serial Device found @ /dev/ttyAMA0
Serial Device found @ /dev/ttyS0
davidhitchins commented 4 years ago

Thanks @davehylands . I made the changes to list_ports.js and I get the same as you do above. Serial Device found @ /dev/ttyAMA0 Serial Device found @ /dev/ttyS0 But the gateway logs still show zigbee-adapter: SerialProber: timeout: XBee dongle not detected on /dev/ttyAMA0 The RPi4b plus Raspbee II just won't cooperate! I am sure I have it all configured as recommended by various commentators, some of whom say that they have the Raspbee II shield working. Or at least the Raspbee. What can the problem be I wonder? (ps there is a small typo on mozilla-iot/gateway/pull/2570 It should be list_ports.js not list_prots.js EXCERPT FROM GATEWAY LOGS 2020-08-06 14:49:19.442 INFO : Loading add-on: zigbee-adapter 2020-08-06 14:49:20.239 INFO : zigbee-adapter: Opening database: /home/pi/.mozilla-iot/config/db.sqlite3 2020-08-06 14:49:20.646 INFO : zigbee-adapter: Loading add-on zigbee-adapter from /home/pi/.mozilla-iot/addons/zigbee-adapter 2020-08-06 14:49:20.697 INFO : zigbee-adapter: DEBUG config = 'frames' 2020-08-06 14:49:20.699 INFO : zigbee-adapter: Enabling DEBUG_frames 2020-08-06 14:49:30.938 ERROR : zigbee-adapter: SerialProber: timeout: XBee dongle not detected on /dev/ttyAMA0 2020-08-06 14:49:31.191 INFO : zigbee-adapter: this.driver = DeconzDriver {} 2020-08-06 14:49:31.193 INFO : zigbee-adapter: DeconzDriver: Using serial port /dev/ttyAMA0 2020-08-06 14:49:31.196 INFO : zigbee-adapter: Sent: Version (0x0d) Request 2020-08-06 14:49:31.210 INFO : zigbee-adapter: Rcvd: Version (0x0d) Response 26520700

davehylands commented 4 years ago

What is the contents of your /boot/cmdline.txt file?

What is the output of systemctl status 'getty*' ?

davidhitchins commented 4 years ago

Thanks @davehylands Here they are: cmdline.txt console=tty1 root=PARTUUID=df50b87f-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

GETTY ● getty@tty1.service - Getty on tty1 Loaded: loaded (/lib/systemd/system/getty@.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/getty@tty1.service.d └─noclear.conf Active: active (running) since Thu 2020-08-06 15:00:10 AEST; 17h ago Docs: man:agetty(8) man:systemd-getty-generator(8) http://0pointer.de/blog/projects/serial-console.html Main PID: 568 (agetty) Tasks: 1 (limit: 4915) CGroup: /system.slice/system-getty.slice/getty@tty1.service └─568 /sbin/agetty -o -p -- \u --noclear tty1 linux

Aug 06 15:00:10 ** systemd[1]: Started Getty on tty1. Aug 06 15:00:22 ** systemd[1]: getty@tty1.service: Current command vanished from the unit file, execution of the command list won't be resumed.

● getty.target - Login Prompts Loaded: loaded (/lib/systemd/system/getty.target; static; vendor preset: enabled) Active: active since Thu 2020-08-06 15:00:10 AEST; 17h ago Docs: man:systemd.special(7) man:systemd-getty-generator(8) http://0pointer.de/blog/projects/serial-console.html

Aug 06 15:00:10 ** systemd[1]: Reached target Login Prompts.

davidhitchins commented 4 years ago

Maybe this will suggest a solution? When I disconnect the Raspbee II board from the RPi4b GPIO pins I get the following when running serial-test.js

pi@**:~/.mozilla-iot/addons/zigbee-adapter/node_modules/serial-prober $ node serial-test.js SerialProber: timeout: deConz dongle not detected on /dev/ttyAMA0 SerialProber: timeout: XBee dongle not detected on /dev/ttyAMA0 Nothing found

But when the Raspbee II IS RECONNECTED TO PI it's a different console message (below). It seems that the Raspbee II is detected but unavailable for some reason. Any idea why?

pi@**:~/.mozilla-iot/addons/zigbee-adapter/node_modules/serial-prober $ node serial-test.js [Error: Error Resource temporarily unavailable Cannot lock port] [Error: Error Resource temporarily unavailable Cannot lock port] Nothing found

So I tried to find out what was using the port AMA0 and preventing it from being locked by serial-test.js

pi@:~/.mozilla-iot/addons/zigbee-adapter/node_modules/serial-prober $ sudo lsof /dev/ttyAMA0 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME node 899 pi 21uW CHR 204,64 0t0 1160 /dev/ttyAMA0 pi@:/.mozilla-iot/addons/zigbee-adapter/node_modules/serial-prober $ ps -f -p 899 UID PID PPID C STIME TTY TIME CMD pi 899 804 0 08:38 ? 00:00:02 node /home/pi/mozilla-iot/gateway/src/addon-loader.js /home/pi/.mozilla-iot/addons/zigbee-adapter pi@****:/.mozilla-iot/addons/zigbee-adapter/node_modules/serial-prober $ sudo pwdx 899 899: /home/pi/mozilla-iot/gateway

It appears to be (I hope I know what I am saying here!) the zigbee-adapter itself that is locking the port AAMA0. This makes sense but then why does it go on to say in the WebThings gateway log? ERROR : zigbee-adapter: SerialProber: timeout: XBee dongle not detected on /dev/ttyAMA0

Somehow the loading of the zigbee-adapter is blocking itself?

davidhitchins commented 4 years ago

HOW WEIRD!! I bought a new Samsung Smart Things door sensor and managed to pair it with the PI4 - Raspbee II gateway. Now it works fine. So I wonder why the logs say: ERROR : zigbee-adapter: SerialProber: timeout: XBee dongle not detected on /dev/ttyAMA0 I assumed this meant the Raspbee wasn't working but it was - at least recently, not always.

kaibuk commented 4 years ago

Hi Everyone I also have problems with Raspbee II. In the Log files i can see that the Serial Device is found: 2020-11-05 20:53:54.239 INFO : zigbee-adapter: Serial Device found @ /dev/ttyAMA0 2020-11-05 20:53:54.240 INFO : zigbee-adapter: Serial Device found @ /dev/ttyS0 2020-11-05 20:53:54.242 ERROR : zigbee-adapter: Failed to start add-on zigbee-adapter: No Zigbee dongle found

But what i noticed is that whenever i try to scan for devices and look at whats happening on the RPI its not interacting with the adapter at all It just says: 2020-11-05 21:20:46.567 INFO : Opened a new things socket

If i enable back agian my Fritz ADoo and scan for things its just using the Fritz API and scans for thinks usin tha tmodule.

So it looks like the gateway doesn't doesn't interact with the addon at all cause it thinks there is no module installed.

Can someone giv eme advice what i could try. I wan to connect a IKEA bulb.

Jsut to add on the deCONZ tool the module is being recongised and the Phoscon tool cna find the Bulb.

mrstegeman commented 4 years ago

@frederic34 is this fully supported now?

frederic34 commented 4 years ago

I have both raspbee 1 and conbee II, my raspbee is on another system but I will make test. There is a version of firmware of the raspbee (26390500) which may fail because of the different sequence of detection (get version need more bytes) so if it's not working, give firmware version

frederic34 commented 4 years ago

@mrstegeman raspbee (first model) works after some changes in config.txt and cmdline.txt in /boot on a RPI 3

mrstegeman commented 4 years ago

@frederic34 Can you list out those changes (and how to enable the new setting) in the README and submit a PR? Then we can close this issue.

mrstegeman commented 4 years ago

This should be fixed now in v0.13.0. See README for instructions.

mspbonn commented 3 years ago

Phoscon Raspbee ii fails with Webthings 1.0.0:

Dec  8 16:40:48 gateway run-app.sh[403]: 2020-12-08 16:40:48.878 INFO   : zigbee-adapter: DeconzDriver: Using serial port /dev/ttyAMA0
Dec  8 16:40:48 gateway run-app.sh[403]: 2020-12-08 16:40:48.988 INFO   : zigbee-adapter: DeConz Firmware version: 26610700
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.260 INFO   : zigbee-adapter: Kicking WatchDog for 3600 seconds
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.550 INFO   : zigbee-adapter:          MAC Address: xxxxxxxxxxxxxxxx
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.586 INFO   : zigbee-adapter:      Network PANID16: 7bf7
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.621 INFO   : zigbee-adapter:       Network Addr16: 0000
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.648 INFO   : zigbee-adapter:      Network PANID64: xxxxxxxxxxxxxxxx
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.688 INFO   : zigbee-adapter: APS Designated Coordinator: 1
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.716 INFO   : zigbee-adapter:        Scan Channels: 00008000
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.724 INFO   : zigbee-adapter:          APS PANID64: 0000000000000000
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.731 INFO   : zigbee-adapter:  Trust Center Addr64: xxxxxxxxxxxxxxxx
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.748 INFO   : zigbee-adapter:        Security Mode: 3
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.763 INFO   : zigbee-adapter:          Network Key: xxxx----------xxxx
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.770 INFO   : zigbee-adapter:    Operating Channel: 15
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.783 INFO   : zigbee-adapter:     Protocol Version: 267
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.801 INFO   : zigbee-adapter:    Network Update ID: 0
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.829 INFO   : zigbee-adapter:          Permit Join: 0
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.845 INFO   : zigbee-adapter:         WatchDog TTL: 3600
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.853 INFO   : zigbee-adapter:              Version: 26610700
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.874 INFO   : zigbee-adapter: ZigbeeNode created: addr64: xxxxxxxxxxxxxxxx addr16: 0000
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.889 INFO   : zigbee-adapter: readDeviceInfo: read failed: { [Error: ENOENT: no such file or directory, open '/home/pi/.webthings/data/zigbee-adapter/zb-xxxxxxxxxxxxxxxx.json']
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.918 INFO   : zigbee-adapter:   errno: -2,
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.938 INFO   : zigbee-adapter:   code: 'ENOENT',
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.945 INFO   : zigbee-adapter:   syscall: 'open',
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.958 INFO   : zigbee-adapter:   path:
Dec  8 16:40:49 gateway run-app.sh[403]: 2020-12-08 16:40:49.978 INFO   : zigbee-adapter:    '/home/pi/.webthings/data/zigbee-adapter/zb-xxxxxxxxxxxxxxxx.json' }
Dec  8 16:40:50 gateway run-app.sh[403]: 2020-12-08 16:40:50.021 INFO   : zigbee-adapter: ----- Scan Starting -----
Dec  8 16:40:50 gateway run-app.sh[403]: 2020-12-08 16:40:50.038 INFO   : zigbee-adapter: ----- Nodes -----
Dec  8 16:40:50 gateway run-app.sh[403]: 2020-12-08 16:40:50.045 INFO   : zigbee-adapter: Node: xxxxxxxxxxxxxxxx 0000 Name: zb-xxxxxxxxxxxxxxxx-Dongle       rebindRequired: true endpoints: []
Dec  8 16:40:50 gateway run-app.sh[403]: 2020-12-08 16:40:50.065 INFO   : zigbee-adapter: -----------------
Dec  8 16:40:50 gateway run-app.sh[403]: 2020-12-08 16:40:50.077 INFO   : zigbee-adapter: ----- Scan Complete -----
Dec  8 16:40:50 gateway run-app.sh[403]: 2020-12-08 16:40:50.102 INFO   : zigbee-adapter: ----- Nodes -----
Dec  8 16:40:50 gateway run-app.sh[403]: 2020-12-08 16:40:50.118 INFO   : zigbee-adapter: Node: xxxxxxxxxxxxxxxx 0000 Name: zb-xxxxxxxxxxxxxxxx-Dongle       rebindRequired: true endpoints: []
Dec  8 16:40:50 gateway run-app.sh[403]: 2020-12-08 16:40:50.136 INFO   : zigbee-adapter: -----------------
Dec  8 16:40:50 gateway run-app.sh[403]: 2020-12-08 16:40:50.143 INFO   : zigbee-adapter: ----- Update Network Addresses Complete -----
Dec  8 16:41:40 gateway run-app.sh[403]: 2020-12-08 16:41:40.909 INFO   : Pairing timeout
remichristiaan commented 3 years ago

Thanks for the effort put into creating Webthings.

My RaspBee II seems to work with the Zigbee adapter (version 0.21.1) when I add an empty filter { }, to zigbee-adapter/lib/index.js ... otherwise I will not be recognized. Rpi4 configured according to the README.

index.js

const conbeeSerialProber = new SerialProber({
    name: 'conbee',
    allowAMASerial: false,
    baudRate: 38400,
    // conbee VERSION Command
    probeCmd: [
        0xc0,
        0x0d,
        0x01,
        0x00,
        0x05,
        0x00,
        0xed,
        0xff,
        0xc0,
    ],
    probeRsp: [
        0xc0,
        0x0d,
        0x01,
        0x00,
        0x09,
        0x00,
    ],
    filter: [
        {
            vendorId: /0403/i,
            productId: /6015/i,
        },
        {
            vendorId: /1cf1/i,
            productId: /0030/i,
        },
        {
        },
    ],
});

Most likely the vendor Id and product Id differs from the original Raspbee ... any clue on how to retrieve this data? I've added the empty filter also to the conbeeNewerFirmwareSerialProber section.

Log:

INFO   : zigbee-adapter: Probing serial ports
INFO   : zigbee-adapter: SerialProber: /dev/ttyAMA0 filter for XBee didn't match.
INFO   : zigbee-adapter: SerialProber: allowAMASerial
INFO   : zigbee-adapter: SerialProber: Probing /dev/ttyAMA0 at 38400 for conbee
INFO   : zigbee-adapter: SerialProber: Opening /dev/ttyAMA0 at 38400 baud
INFO   : zigbee-adapter: SerialProber: Probing /dev/ttyAMA0 ...
INFO   : zigbee-adapter: SerialProber: Sent: <Buffer c0 0d 01 00 05 00 ed ff c0>
INFO   : zigbee-adapter: SerialProber: closing /dev/ttyAMA0
INFO   : zigbee-adapter: SerialProber: timeout: conbee dongle not detected on /dev/ttyAMA0
INFO   : zigbee-adapter: SerialProber: /dev/ttyAMA0 filter for cc2531 didn't match.
INFO   : zigbee-adapter: SerialProber: Probing /dev/ttyAMA0 at 38400 for conbee
INFO   : zigbee-adapter: SerialProber: Opening /dev/ttyAMA0 at 38400 baud
ERROR  : zigbee-adapter: SerialProber: timeout: conbee dongle not detected on /dev/ttyAMA0
INFO   : zigbee-adapter: SerialProber: Probing /dev/ttyAMA0 ...
INFO   : zigbee-adapter: SerialProber: Sent: <Buffer c0 0d 01 00 09 00 00 00 00 00 e9 ff c0>
INFO   : zigbee-adapter: SerialProber: Rcvd: <Buffer c0 0d 01 00 09 00 00 07 69 26 53 ff c0>
INFO   : zigbee-adapter: SerialProber: Probe successful
INFO   : zigbee-adapter: this.driver = ConBeeDriver {}
INFO   : zigbee-adapter: ConBeeDriver: Using serial port /dev/ttyAMA0
INFO   : zigbee-adapter: Sent: Version (0x0d) Request
INFO   : zigbee-adapter: Queued: <Buffer 0d 01 00 09 00 00 00 00 00 e9 ff>
INFO   : zigbee-adapter: Sending queued frame
INFO   : zigbee-adapter: Sent: <Buffer 0d 01 00 09 00 00 00 00 00 e9 ff>
INFO   : zigbee-adapter: Sent Chunk: <Buffer c0 0d 01 00 09 00 00 00 00 00 e9 ff c0>
INFO   : zigbee-adapter: Rcvd Chunk: <Buffer c0 0d 01 00 09 00 00 07 69 26 53 ff c0>
INFO   : zigbee-adapter: Rcvd: <Buffer 0d 01 00 09 00 00 07 69 26 53 ff>
INFO   : zigbee-adapter: Rcvd: Version (0x0d) Response 26690700
INFO   : zigbee-adapter: ConBee Firmware version: 26690700