Frans-Willem / AqaraHub

AqaraHub is an open-source Zigbee hub for Xiaomi Aqara devices. It aims to be a replacement to the Xiaomi Gateway that does not require communication to outside servers, and uses a saner communication option (e.g. MQTT).
252 stars 34 forks source link

unable to pair new devices #71

Open gmiraval opened 3 years ago

gmiraval commented 3 years ago

Dear, I've followed your instructions & was able to build & run OK the binary in an Ubuntu 20.04 64 bits (please see log @the end) I've also flashed the dongle exactly with the same version you used: https://github.com/Koenkk/Z-Stack-firmware/raw/b2a0be7c4c84c2acf6ecd292f7afd0f488b3b9b1/coordinator/CC2531/bin/CC2531ZNP-Prod_20190223.zip

But i'm not able to put it in discover mode in order to join devices, when I send (i have a mosquitto server up & running @localhost): mosquitto_pub -h localhost -t AqaraHub/write/permitjoin -m 60 I never get the "AqaraHub/report/permitjoin topic, with the same number" response that you mention. Any hint/advice/clue will be highly appreciated.Thanks in advance!

LOG

~/wk/AqaraHub/build$ sudo ./AqaraHub --port /dev/ttyACM0 --mqtt mqtt://localhost/ --topic AqaraHub

[Main] Serial port: /dev/ttyACM0 [Main] Setting up ZNP connection [Main] Setting up MQTT connection [MqttWrapper] Params: { Unencrypted, TCP, localhost, 1883, --, (no password), AqaraHub } [MqttWrapper] Connecting... [Main] Using MQTT prefix 'AqaraHub/' [Main] Recursively publishing object and array properties [Main] No PSK specified on command-line, using default ('AqaraHub') [Main] Using PSK 41 71 61 72 61 48 75 62 00 00 00 00 00 00 00 00 IO Service starting [Initialize] Doing initial reset (this may take up to a full minute after a dongle power-cycle) [FRAME] >> AREQ SYS_RESET 01 [MqttWrapper] Connected, clean=false [FRAME] << AREQ SYS_RESET_IND 00 02 00 02 06 03 [Initialize] Building desired configuration [FRAME] >> SREQ SAPI_GET_DEVICE_INFO 01 [FRAME] << SRSP SAPI_GET_DEVICE_INFO 01 84 70 38 19 00 4b 12 00 [Initialize] Device IEEE Address: 124b0019387084 [Initialize] Verifying full configuration [FRAME] >> SREQ SAPI_READ_CONFIGURATION 8f [FRAME] >> SREQ SAPI_READ_CONFIGURATION 63 [FRAME] >> SREQ SAPI_READ_CONFIGURATION 62 [FRAME] >> SREQ SAPI_READ_CONFIGURATION 87 [FRAME] >> SREQ SAPI_READ_CONFIGURATION 84 [FRAME] >> SREQ SAPI_READ_CONFIGURATION 2d [FRAME] >> SREQ SAPI_READ_CONFIGURATION 83 [FRAME] >> SREQ SAPI_READ_CONFIGURATION 03 [FRAME] << SRSP SAPI_READ_CONFIGURATION 00 8f 01 01 [FRAME] << SRSP SAPI_READ_CONFIGURATION 00 63 01 00 [FRAME] << SRSP SAPI_READ_CONFIGURATION 00 62 10 41 71 61 72 61 48 75 62 00 00 00 00 00 00 00 00 [FRAME] << SRSP SAPI_READ_CONFIGURATION 00 87 01 00 [FRAME] << SRSP SAPI_READ_CONFIGURATION 00 84 04 00 08 00 00 [FRAME] << SRSP SAPI_READ_CONFIGURATION 00 2d 08 84 70 38 19 00 4b 12 00 [FRAME] << SRSP SAPI_READ_CONFIGURATION 00 83 02 ff ff [FRAME] << SRSP SAPI_READ_CONFIGURATION 00 03 01 00 [Initialize] Desired configuration matches current configuration, ready to start! [Initialize] Starting ZDO [FRAME] >> SREQ SAPI_GET_DEVICE_INFO 00 [FRAME] >> SREQ ZDO_STARTUP_FROM_APP 64 00 [FRAME] << SRSP SAPI_GET_DEVICE_INFO 00 00 01 00 64 07 00 0e 01 [WaitForState] Subscribing to on_state_change_ event [FRAME] << SRSP ZDO_STARTUP_FROM_APP 00 [Initialize] ZDO Start return value: 0 [FRAME] << AREQ ZDO_STATE_CHANGE_IND 09 [WaitForState] Got on_state_change_ [Initialize] Final device state 9 [FRAME] >> SREQ ZDO_MGMT_PERMIT_JOIN_REQ 02 00 00 00 00 [FRAME] << SRSP ZDO_MGMT_PERMIT_JOIN_REQ 00 [FRAME] << AREQ ZDO_PERMIT_JOIN_IND 00 [FRAME] << AREQ ZDO_MGMT_PERMIT_JOIN_RSP 00 00 00 [FRAME] >> SREQ AF_REGISTER 01 04 01 05 00 00 00 00 00 [FRAME] << SRSP AF_REGISTER 00 [MqttWrapper] Sending async subscribe directly [Main] Initialization complete! [Main] In final handler
gmiraval commented 3 years ago

I've just tried the following command and is working fine now. mosquitto_pub -h test.mosquitto.org -t AqaraHub/control/permitjoin -m 60 Please correct the Readme, it's "control" not "write"