zigpy / zigpy-cc

Texas Instruments Z-Stack ZNP handler for zigpy

Home Page:https://github.com/zigpy/zigpy-cc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cp2102 + cc2530

levran opened this issue · comments

Hi!
Please add to HA configiration for ZHA rtscts option.
I tried to add cc2530 to HA/ZHA with no success.
My config:
zha:
radio_type: ti_cc
usb_path: /dev/ttyUSB0
baudrate: 115200

At the same time, on the same host in the zigbee2mqtt (container), the cc2530+cp2102 stick works great if added the parameter in config rtscts: false.

Thank you!!!
BR, Vlad.

Can you send your logs?

Maybe I can auto detect it.

Sorry but this log sad you set radio type to ezsp instead of ti_cc.
Can you test it again?

on host machine Ubuntu:
ls -l /dev/serial/by-id/
usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0 -> ../../ttyUSB0

there my configiration.yaml
zha:
radio_type: ti_cc
usb_path: /dev/ttyUSB0
baudrate: 115200
enable_quirks: false

log if zha configured in configuration.yaml
2020-03-27 17:11:00 DEBUG (MainThread) [zigpy_cc.uart] Connection made
2020-03-27 17:11:02 DEBUG (MainThread) [zigpy.appdb] Loading application state from /config/zigbee.db
2020-03-27 17:11:02 DEBUG (MainThread) [zigpy_cc.api] --> SREQ SYS version tsn: None {}
2020-03-27 17:11:02 DEBUG (MainThread) [zigpy_cc.uart] Send: b'\xfe\x00!\x02#'
2020-03-27 17:11:02 DEBUG (MainThread) [zigpy.ota] Initialize OTA providers
2020-03-27 17:11:02 DEBUG (MainThread) [zigpy.ota.provider] OTA image directory '/config/zigpy_ota/' does not exist
2020-03-27 17:11:08 ERROR (MainThread) [homeassistant.components.zha.core.gateway] Couldn't start TI CC coordinator
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 142, in async_initialize
res = await self.application_controller.startup(auto_form=True)
File "/usr/local/lib/python3.7/site-packages/zigpy_cc/zigbee/application.py", line 64, in startup
self.version = await self._api.version()
File "/usr/local/lib/python3.7/site-packages/zigpy_cc/api.py", line 206, in version
version = await self._command(Subsystem.SYS, "version", {})
File "/usr/local/lib/python3.7/site-packages/zigpy_cc/api.py", line 84, in _command
return await self.request(subsystem, command, payload)
File "/usr/local/lib/python3.7/site-packages/zigpy_cc/api.py", line 88, in request
return await self.request_raw(obj, expectedStatus)
File "/usr/local/lib/python3.7/site-packages/zigpy_cc/api.py", line 105, in request_raw
result = await waiter.wait()
File "/usr/local/lib/python3.7/site-packages/zigpy_cc/api.py", line 35, in wait
return await asyncio.wait_for(self.future, self.timeout / 1000)
File "/usr/local/lib/python3.7/asyncio/tasks.py", line 449, in wait_for
raise futures.TimeoutError()
concurrent.futures._base.TimeoutError
2020-03-27 17:11:08 WARNING (MainThread) [homeassistant.config_entries] Config entry for zha not ready yet. Retrying in 5 seconds.

if i use HA interface to add ZHA, see pictures
1
2
and log for this action:
2020-03-27 17:08:13 DEBUG (MainThread) [zigpy_cc.uart] Connection made
2020-03-27 17:08:14 DEBUG (MainThread) [zigpy.appdb] Loading application state from /config/zigbee.db
2020-03-27 17:08:14 DEBUG (MainThread) [zigpy.ota] Initialize OTA providers
2020-03-27 17:08:14 DEBUG (MainThread) [zigpy_cc.api] --> SREQ SYS version tsn: None {}
2020-03-27 17:08:14 DEBUG (MainThread) [zigpy_cc.uart] Send: b'\xfe\x00!\x02#'
2020-03-27 17:08:14 DEBUG (MainThread) [zigpy.ota.provider] OTA image directory '/config/zigpy_ota/' does not exist

For comparition, when HA container stopped, i tried cc2530 in zegbee2mqtt container. Of course HA and Z2M not works at same time.
zigbee2mqtt:info 2020-03-27 17:22:23: Logging to console and directory: '/app/data/log/2020-03-27.17-22-23' filename: log.txt
zigbee2mqtt:info 2020-03-27 17:22:23: Starting zigbee2mqtt version 1.12.0 (commit #840b9d9)
zigbee2mqtt:info 2020-03-27 17:22:23: Starting zigbee-herdsman...
zigbee2mqtt:info 2020-03-27 17:22:26: zigbee-herdsman started
zigbee2mqtt:info 2020-03-27 17:22:26: Coordinator firmware version: '{"type":"zStack12","meta":{"transportrev":2,"product":0,"majorrel":2,"minorrel":6,"maintrel":3,"revision":20190608}}'
zigbee2mqtt:info 2020-03-27 17:22:26: Currently 0 devices are joined:
zigbee2mqtt:warn 2020-03-27 17:22:26: permit_join set to true in configuration.yaml.
zigbee2mqtt:warn 2020-03-27 17:22:26: Allowing new devices to join.
zigbee2mqtt:warn 2020-03-27 17:22:26: Set permit_join to false once you joined all devices.
zigbee2mqtt:info 2020-03-27 17:22:26: Zigbee: allowing new devices to join.
zigbee2mqtt:info 2020-03-27 17:22:26: Connecting to MQTT server at mqtt://192.168.1.211
zigbee2mqtt:info 2020-03-27 17:22:26: Connected to MQTT server
zigbee2mqtt:info 2020-03-27 17:22:26: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
zigbee2mqtt:info 2020-03-27 17:22:26: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"version":"1.12.0","commit":"840b9d9","coordinator":{"type":"zStack12","meta":{"transportrev":2,"product":0,"majorrel":2,"minorrel":6,"maintrel":3,"revision":20190608}},"log_level":"info","permit_join":true}'

z2m configuration.yaml
homeassistant: false

permit_join: true

mqtt:
base_topic: zigbee2mqtt
server: 'mqtt://192.168.1.211'

serial:
port: /dev/ttyUSB0
baudrate: 115200

advanced:
rtscts: false

I understand that this is completely off topic of this problem. But I also tried ConbeeII connect to the HA through the ZHA and it also worked. And even all paired devices became visible.

Hello, I have same issue, but use just coordinator F/W(without mqtt). For example, in iobroker driver this configuration working fine.

maybe fixed in commit 58c445e

pls test with release v0.3.1

I do not know how to do test otherwise. I edited the uart.py in the docker container (HA 0.107.7).
The result is in the log.
I tried to attach a xiaomi door sensor, it is clear that there is a reaction.
But as a separate device, the sensor is not visible.
home-assistant.log

which door sensor you are using?
Can you pair it?
I only see timeouts in your log.

Xiaomi MCCGQ01LM
When i search new device by "add device" i see in log window below new lines, when i open and close window sensor.
Tomorrow i'll write exact lines from log.

Ignoring message (b'18320a00001001') on cluster 6: unknown endpoint or cluster id: 1
[0xfda0] Requesting 'Node Descriptor'
[0xfda0] Extending timeout for 0x41 request
Ignoring message (b'18330a00001000') on cluster 6: unknown endpoint or cluster id: 1 <---- *** this is sensor close action ***
Ignoring message (b'18340a00001001') on cluster 6: unknown endpoint or cluster id: 1 <---- *** this is sensor open action ***
[0xfda0:zdo] ZDO request 0x8002: [<Status.SUCCESS: 0>, 0xfda0, ]
[0xfda0:zdo] Unsupported ZDO request:0x8002
Ignoring message (b'1c3412350a02ff4c0600100121d10b21a813240400000000214000205e') on cluster 0: unknown endpoint or cluster id: 1
Ignoring message (b'18360a00001000') on cluster 6: unknown endpoint or cluster id: 1 <---- *** this is sensor close action ***
Ignoring message (b'18370a00001001') on cluster 6: unknown endpoint or cluster id: 1 <---- *** this is sensor open action ***
Ignoring message (b'18380a00001000') on cluster 6: unknown endpoint or cluster id: 1 <---- *** this is sensor close action ***
Ignoring message (b'18390a00001001') on cluster 6: unknown endpoint or cluster id: 1 <---- *** this is sensor open action ***
Ignoring message (b'183a0a00001000') on cluster 6: unknown endpoint or cluster id: 1 <---- *** this is sensor close action ***
Ignoring message (b'183b0a00001001') on cluster 6: unknown endpoint or cluster id: 1 <---- *** this is sensor open action ***
[0xfda0] Extending timeout for 0x43 request
3

I tried new version HA 0.108.2, cc2530 throw cp2102 works.