Virgin Hass.io user - Trying to setup zigbee2mqtt for ikea lighting

Complete newbie here, so apologies in advance if this is a simple question.
Installed on rPi2 (just to test) and installed the zigbee2mqtt addon.
Purchased USB CC2531 Sniffer Bare Board Packet Protocol Analyzer Module via ebay, but in the logs when I try to use zigbee2mqtt:-

[email protected] start /zigbee2mqtt-1.4.0
node index.js
zigbee2mqtt:info 6/10/2019, 1:08:18 PM Logging to directory: ‘/share/zigbee2mqtt/log/2019-06-10.13-08-18’
zigbee2mqtt:info 6/10/2019, 1:08:20 PM Starting zigbee2mqtt version 1.4.0 (commit #unknown)
zigbee2mqtt:info 6/10/2019, 1:08:20 PM Starting zigbee-shepherd
zigbee2mqtt:info 6/10/2019, 1:08:21 PM Error while starting zigbee-shepherd, attempting to fix… (takes 60 seconds) (Error: Error: No such file or directory, cannot open /dev/ttyACM0)

Any ideas or help would be appreciated.

Your config looks for your device at /dev/ttyACM0, but since it cannot find it I suspect that the device has another address. Try running this command in a terminal: sudo ls -lt /dev/ttyA* | head -n 1. It returns the first ttyA*-port that is used, which is probably the one you want (unless you have several usb-sticks plugged in)

1 Like

Thanks. Using that command I got the response :
crw-rw---- 1 root audio 204, 64 Jun 10 14:10 /dev/ttyAMA0

So updated the device serial port as suggested:-

{
“data_path”: “/share/zigbee2mqtt”,
“homeassistant”: true,
“permit_join”: false,
“mqtt_base_topic”: “zigbee2mqtt”,
“mqtt_server”: “mqtt://homeassistant”,
“serial_port”: “/dev/ttyAMA0”,
“devices”: ,
“network_key”:
}

Now the output is:-

[email protected] start /zigbee2mqtt-1.4.0
node index.js
zigbee2mqtt:info 6/10/2019, 2:20:44 PM Logging to directory: ‘/share/zigbee2mqtt/log/2019-06-10.14-20-44’
zigbee2mqtt:info 6/10/2019, 2:20:47 PM Starting zigbee2mqtt version 1.4.0 (commit #unknown)
zigbee2mqtt:info 6/10/2019, 2:20:47 PM Starting zigbee-shepherd
zigbee2mqtt:info 6/10/2019, 2:20:54 PM Error while starting zigbee-shepherd, attempting to fix… (takes 60 seconds) (Error: request timeout)
zigbee2mqtt:info 6/10/2019, 2:21:54 PM Starting zigbee-shepherd
zigbee2mqtt:error 6/10/2019, 2:22:01 PM Error while starting zigbee-shepherd! (Error: request timeout)
zigbee2mqtt:error 6/10/2019, 2:22:01 PM Press the reset button on the stick (the one closest to the USB) and start again
zigbee2mqtt:error 6/10/2019, 2:22:01 PM Failed to start
{“message”:“request timeout”,“stack”:“Error: request timeout\n at CcZnp. (/zigbee2mqtt-1.4.0/node_modules/cc-znp/lib/ccznp.js:269:22)\n at Object.onceWrapper (events.js:273:13)\n at CcZnp.emit (events.js:182:13)\n at Timeout. (/zigbee2mqtt-1.4.0/node_modules/cc-znp/lib/ccznp.js:248:18)\n at ontimeout (timers.js:436:11)\n at tryOnTimeout (timers.js:300:5)\n at listOnTimeout (timers.js:263:5)\n at Timer.processTimers (timers.js:223:10)”}
zigbee2mqtt:error 6/10/2019, 2:22:01 PM Exiting…
npm
ERR! code ELIFECYCLE
npm ERR!
errno 1
npm ERR! [email protected] start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-06-10T13_22_01_458Z-debug.log
2019-06-10T14:22:04: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
2019-06-10T14:22:04: PM2 log: App [npm:0] starting in -fork mode-
2019-06-10T14:22:04: PM2 log: App [npm:0] online

Looks way better! Try a restart of the stick (if you didnt already), looks to be required from the log: zigbee2mqtt:error 6/10/2019, 2:22:01 PM Press the reset button on the stick (the one closest to the USB) and start again. Then restart HA :slight_smile:

1 Like

Thanks for the suggestion. Sorry for delay, I’ve been away. Hasnt helped I’m afraid. Had tried pressing the reset button (closest to usb socket) and restarted Zigbee2mqtt addon…

[Info] Configuration file found: /share/zigbee2mqtt/configuration.yaml
[Info] Configuration written to /share/zigbee2mqtt/configuration.yaml
2019-06-14T14:50:38: PM2 log: Launching in no daemon mode
2019-06-14T14:50:39: PM2 log: App [npm:0] starting in -fork mode-
2019-06-14T14:50:39: PM2 log: App [npm:0] online

[email protected] start /zigbee2mqtt-1.4.0
node index.js
zigbee2mqtt:info 6/14/2019, 2:50:46 PM Logging to directory: ‘/share/zigbee2mqtt/log/2019-06-14.14-50-46’
zigbee2mqtt:info 6/14/2019, 2:50:48 PM Starting zigbee2mqtt version 1.4.0 (commit #unknown)
zigbee2mqtt:info 6/14/2019, 2:50:48 PM Starting zigbee-shepherd
zigbee2mqtt:info 6/14/2019, 2:50:55 PM Error while starting zigbee-shepherd, attempting to fix… (takes 60 seconds) (Error: request timeout)
zigbee2mqtt:info 6/14/2019, 2:51:55 PM Starting zigbee-shepherd
zigbee2mqtt:error 6/14/2019, 2:52:02 PM Error while starting zigbee-shepherd! (Error: request timeout)
zigbee2mqtt:error 6/14/2019, 2:52:02 PM Press the reset button on the stick (the one closest to the USB) and start again
zigbee2mqtt:error 6/14/2019, 2:52:02 PM Failed to start
{“message”:“request timeout”,“stack”:“Error: request timeout\n at CcZnp. (/zigbee2mqtt-1.4.0/node_modules/cc-znp/lib/ccznp.js:269:22)\n at Object.onceWrapper (events.js:273:13)\n at CcZnp.emit (events.js:182:13)\n at Timeout. (/zigbee2mqtt-1.4.0/node_modules/cc-znp/lib/ccznp.js:248:18)\n at ontimeout (timers.js:436:11)\n at tryOnTimeout (timers.js:300:5)\n at listOnTimeout (timers.js:263:5)\n at Timer.processTimers (timers.js:223:10)”}
zigbee2mqtt:error 6/14/2019, 2:52:02 PM Exiting…
npm

ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node index.js
npm
ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm
ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-06-14T13_52_03_034Z-debug.log
2019-06-14T14:52:05: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
2019-06-14T14:52:05: PM2 log: App [npm:0] starting in -fork mode-
2019-06-14T14:52:05: PM2 log: App [npm:0] online

[email protected] start /zigbee2mqtt-1.4.0
node index.js
zigbee2mqtt:info 6/14/2019, 2:52:13 PM Logging to directory: ‘/share/zigbee2mqtt/log/2019-06-14.14-52-13’
zigbee2mqtt:info 6/14/2019, 2:52:16 PM Starting zigbee2mqtt version 1.4.0 (commit #unknown)
zigbee2mqtt:info 6/14/2019, 2:52:16 PM Starting zigbee-shepherd
zigbee2mqtt:info 6/14/2019, 2:52:23 PM Error while starting zigbee-shepherd, attempting to fix… (takes 60 seconds) (Error: request timeout)

Alright, seems like there is more in play here then :slight_smile: I recently found a sinilar issue on Github, https://github.com/Koenkk/zigbee2mqtt/issues/721, can you check and see if this helps? It seems to me that it is most likely a config issue, perhaps in conjunction with docs being not up to date (haven’t read them lately so not sure though)

I just blogged about setting this up

https://kingiacastle.com/2019/06/09/migration-off-the-xiaomi-gateway-using-zigbee2mqtt/

1 Like

Have you flashed the CC2531 stick with the alternate firmware? That would definitely cause the error you are experiencing and your original post doesn’t mention that you have.

1 Like

Hi Blawford. That’s exactly what my problem is as I didnt realise this was necessary untl recently. Now ordered the necessary kit, sorry to wasting anyone’s time.

No problem, from memory the flashing process and setup was easy so I’m sure you won’t have further issues once you receive it.

When you are pairing stuff bring the device close to the USB stick would be my other piece of advice.

1 Like

Ok so now i’ve updated the firmware on the stick, getting further…

Info] Configuration file found: /share/zigbee2mqtt/configuration.yaml
[Info] Configuration written to /share/zigbee2mqtt/configuration.yaml
2019-06-25T20:00:11: PM2 log: Launching in no daemon mode
2019-06-25T20:00:11: PM2 log: App [npm:0] starting in -fork mode-
2019-06-25T20:00:11: PM2 log: App [npm:0] online

[email protected] start /zigbee2mqtt-1.4.0
node index.js
zigbee2mqtt:info 6/25/2019, 8:00:18 PM Logging to directory: ‘/share/zigbee2mqtt/log/2019-06-25.20-00-18’
zigbee2mqtt:info 6/25/2019, 8:00:21 PM Starting zigbee2mqtt version 1.4.0 (commit #unknown)
zigbee2mqtt:info 6/25/2019, 8:00:21 PM Starting zigbee-shepherd
zigbee2mqtt:info 6/25/2019, 8:00:23 PM zigbee-shepherd started
zigbee2mqtt:info 6/25/2019, 8:00:23 PM Coordinator firmware version: ‘20190425’
zigbee2mqtt:info 6/25/2019, 8:00:23 PM Currently 0 devices are joined:
zigbee2mqtt:info 6/25/2019, 8:00:23 PM Zigbee: disabling joining new devices.
zigbee2mqtt:info 6/25/2019, 8:00:23 PM Connecting to MQTT server at mqtt://homeassistant
zigbee2mqtt:info 6/25/2019, 8:00:24 PM zigbee-shepherd ready
zigbee2mqtt:error 6/25/2019, 8:00:33 PM Not connected to MQTT server!
zigbee2mqtt:error 6/25/2019, 8:00:43 PM Not connected to MQTT server!
zigbee2mqtt:error 6/25/2019, 8:00:53 PM Not connected to MQTT server!

Do I need to install a MQTT server as well? Would really appreciate some basic user guidance here. Tthanks

Yes, you need to install MQTT as well. Hass.io addon “Mosquitto broker”.

Managed to get some more time to look this, and come on leaps and bounds. Realised I needed to do a fair bit more reading and got to the position whereby the zigbee2mqtt is working.

Attempted to add a new device (Hive lightbulb) which didnt work so tried the Ikea remote (https://www.zigbee2mqtt.io/devices/E1524). Though the logs showed there was some attempt at this, I believe it failed as no device was available within Configuration>Integration. (believe this is how it should work, happy to be corrected). Any thoughts on next steps?

7/16/2019, 3:42:26 PM - info: New device 'undefined' with address 0xd0cf5efffec08c3b connected!
7/16/2019, 3:42:26 PM - info: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"device_connected","message":"0xd0cf5efffec08c3b","meta":{}}'
7/16/2019, 3:42:26 PM - warn: Device with modelID 'undefined' is not supported.
7/16/2019, 3:42:26 PM - warn: Please see: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html
7/16/2019, 3:42:28 PM - info: MQTT publish: topic 'homeassistant/sensor/0xd0cf5efffec08c3b/action/config', payload '{"icon":"mdi:gesture-double-tap","value_template":"{{ value_json.action }}","state_topic":"zigbee2mqtt/0xd0cf5efffec08c3b","json_attributes_topic":"zigbee2mqtt/0xd0cf5efffec08c3b","name":"0xd0cf5efffec08c3b_action","unique_id":"0xd0cf5efffec08c3b_action_zigbee2mqtt","device":{"identifiers":"zigbee2mqtt_0xd0cf5efffec08c3b","name":"0xd0cf5efffec08c3b","sw_version":"Zigbee2mqtt 1.4.0","model":"TRADFRI remote control (E1524)","manufacturer":"IKEA"},"availability_topic":"zigbee2mqtt/bridge/state"}'
7/16/2019, 3:42:28 PM - info: MQTT publish: topic 'homeassistant/sensor/0xd0cf5efffec08c3b/linkquality/config', payload '{"unit_of_measurement":"-","value_template":"{{ value_json.linkquality }}","state_topic":"zigbee2mqtt/0xd0cf5efffec08c3b","json_attributes_topic":"zigbee2mqtt/0xd0cf5efffec08c3b","name":"0xd0cf5efffec08c3b_linkquality","unique_id":"0xd0cf5efffec08c3b_linkquality_zigbee2mqtt","device":{"identifiers":"zigbee2mqtt_0xd0cf5efffec08c3b","name":"0xd0cf5efffec08c3b","sw_version":"Zigbee2mqtt 1.4.0","model":"TRADFRI remote control (E1524)","manufacturer":"IKEA"},"availability_topic":"zigbee2mqtt/bridge/state"}'
7/16/2019, 3:42:32 PM - warn: Failed to configure 0xd0cf5efffec08c3b (0xd0cf5efffec08c3b) ('Error: AF data request fails, status code: 240. MAC transaction expired.') (attempt #1)
7/16/2019, 3:42:32 PM - warn: This can be ignored if the device is working properly
7/16/2019, 3:42:42 PM - warn: Failed to configure 0xd0cf5efffec08c3b (0xd0cf5efffec08c3b) ('Error: AF data request fails, status code: 240. MAC transaction expired.') (attempt #2)
7/16/2019, 3:42:42 PM - warn: This can be ignored if the device is working properly
7/16/2019, 3:42:49 PM - info: MQTT publish: topic 'zigbee2mqtt/0xd0cf5efffec08c3b', payload '{"battery":21,"linkquality":134}'
7/16/2019, 3:42:57 PM - warn: Failed to configure 0xd0cf5efffec08c3b (0xd0cf5efffec08c3b) ('Error: AF data request fails, status code: 240. MAC transaction expired.') (attempt #3)
7/16/2019, 3:42:57 PM - warn: This can be ignored if the device is working properly
7/16/2019, 3:43:18 PM - info: Device incoming...
7/16/2019, 3:43:18 PM - info: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"device incoming"}'
7/16/2019, 3:44:58 PM - info: Succesfully reenabled joining