zigpy / zigpy-zigate

A library which communicates with ZiGate radios for zigpy
GNU General Public License v3.0
30 stars 18 forks source link

Pizigate - ZHA installation error "No response to command 0x0002" #72

Closed pedlou closed 3 years ago

pedlou commented 3 years ago

Hi, I am using the setup with Pizigate, RPI3B+ and hassio, while trying the ZHA integration I am having some issues. In Configuration+System+Hardware I have pizigate as: /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0 In Integration for ZHA I am using:

  1. Serial device path: enter manually
  2. Radio type: Zigate
  3. Serial device path: /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0 result: Failed to connect. In logs I can see the following: 2020-11-30 12:30:40 DEBUG (MainThread) [zigpy_zigate.uart] Connection made 2020-11-30 12:30:40 DEBUG (MainThread) [zigpy_zigate.uart] Send: 0x0002 b'01' 2020-11-30 12:30:40 DEBUG (MainThread) [zigpy_zigate.uart] Frame to send: b'\x00\x02\x00\x01\x02\x01' 2020-11-30 12:30:40 DEBUG (MainThread) [zigpy_zigate.uart] Frame escaped: b'\x02\x10\x02\x12\x02\x10\x02\x11\x02\x12\x02\x11' 2020-11-30 12:30:41 WARNING (MainThread) [zigpy_zigate.api] No response to command 0x0002 2020-11-30 12:30:41 WARNING (MainThread) [zigpy_zigate.api] Retry command 0x0002 2020-11-30 12:30:41 DEBUG (MainThread) [zigpy_zigate.uart] Send: 0x0002 b'01' 2020-11-30 12:30:41 DEBUG (MainThread) [zigpy_zigate.uart] Frame to send: b'\x00\x02\x00\x01\x02\x01' 2020-11-30 12:30:41 DEBUG (MainThread) [zigpy_zigate.uart] Frame escaped: b'\x02\x10\x02\x12\x02\x10\x02\x11\x02\x12\x02\x11' 2020-11-30 12:30:43 DEBUG (MainThread) [zigpy_zigate.api] Unsuccessful radio probe of '/dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0' port

Can you provide some assistance? Thanks in advance BR Pedro

doudz commented 3 years ago

I think there's a misunderstanding somewhere, you said you're using a pizigate https://zigate.fr/produit/pizigate-v1-0/ But you said the device path is /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0 CP2102 USB to UART is a USB TTL zigate not a pizigate https://zigate.fr/produit/zigate-ttl/

doudz commented 3 years ago

if you're really using a pizigate, the path is something like /dev/serial0 or /dev/ttyAMA0

pedlou commented 3 years ago

Hi Doudz, Thanks for the fast response. It is a pizigate. let me copy/paste the Supervisor>System>Hardware: serial:

2020-11-30 12:47:52 DEBUG (MainThread) [zigpy_znp.zigbee.application] Probing /dev/ttyAMA0 2020-11-30 12:47:52 DEBUG (MainThread) [zigpy_znp.uart] Connecting to /dev/ttyAMA0 at 115200 baud 2020-11-30 12:47:52 DEBUG (MainThread) [zigpy_znp.uart] Opened /dev/ttyAMA0 serial port 2020-11-30 12:47:52 DEBUG (MainThread) [zigpy_znp.uart] Toggling RTS/CTS to skip CC2652R bootloader 2020-11-30 12:47:52 DEBUG (MainThread) [zigpy_znp.uart] Connected to /dev/ttyAMA0 at 115200 baud 2020-11-30 12:47:52 DEBUG (MainThread) [zigpy_znp.api] Waiting 1s before sending anything 2020-11-30 12:47:53 DEBUG (MainThread) [zigpy_znp.api] Sending bootloader skip byte 2020-11-30 12:47:53 DEBUG (MainThread) [zigpy_znp.uart] Sending data: b'\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF\xEF' 2020-11-30 12:47:53 DEBUG (MainThread) [zigpy_znp.api] Waiting 1s or until a reset indication is received 2020-11-30 12:47:53 DEBUG (MainThread) [zigpy_znp.api] Creating one-shot listener OneShotResponseListener(matching_commands=(SYS.ResetInd.Callback(Reason=None, TransportRev=None, ProductId=None, MajorRel=None, MinorRel=None, MaintRel=None),), future=<Future pending cb=[ZNP.wait_for_responses..() at /usr/local/lib/python3.8/site-packages/zigpy_znp/api.py:449, <TaskWakeupMethWrapper object at 0x66c0e2f8>()]>) 2020-11-30 12:47:54 DEBUG (MainThread) [zigpy_znp.api] Removing listener OneShotResponseListener(matching_commands=(SYS.ResetInd.Callback(Reason=None, TransportRev=None, ProductId=None, MajorRel=None, MinorRel=None, MaintRel=None),), future=) 2020-11-30 12:47:54 DEBUG (MainThread) [zigpy_znp.api] Cleaning up empty listener list for header CommandHeader(id=0x80, subsystem=Subsystem.SYS, type=CommandType.AREQ) 2020-11-30 12:47:54 DEBUG (MainThread) [zigpy_znp.api] There are 0 callbacks and 0 one-shot listeners remaining 2020-11-30 12:47:54 DEBUG (MainThread) [zigpy_znp.api] Testing connection to /dev/ttyAMA0 2020-11-30 12:47:54 DEBUG (MainThread) [zigpy_znp.api] Sending request: SYS.Version.Req() 2020-11-30 12:47:54 DEBUG (MainThread) [zigpy_znp.api] Creating one-shot listener OneShotResponseListener(matching_commands=(SYS.Version.Rsp(TransportRev=None, ProductId=None, MajorRel=None, MinorRel=None, MaintRel=None, CodeRevision=None, BootloaderBuildType=None, BootloaderRevision=None), RPCError.CommandNotRecognized.Rsp(ErrorCode=None, RequestHeader=CommandHeader(id=0x02, subsystem=Subsystem.SYS, type=CommandType.SREQ))), future=<Future pending cb=[ZNP.wait_for_responses..() at /usr/local/lib/python3.8/site-packages/zigpy_znp/api.py:449, <TaskWakeupMethWrapper object at 0x66c0e400>()]>) 2020-11-30 12:47:54 DEBUG (MainThread) [zigpy_znp.uart] Sending data: b'\xFE\x00\x21\x02\x23' 2020-11-30 12:47:57 DEBUG (MainThread) [zigpy_znp.api] Removing listener OneShotResponseListener(matching_commands=(SYS.Version.Rsp(TransportRev=None, ProductId=None, MajorRel=None, MinorRel=None, MaintRel=None, CodeRevision=None, BootloaderBuildType=None, BootloaderRevision=None), RPCError.CommandNotRecognized.Rsp(ErrorCode=None, RequestHeader=CommandHeader(id=0x02, subsystem=Subsystem.SYS, type=CommandType.SREQ))), future=) 2020-11-30 12:47:57 DEBUG (MainThread) [zigpy_znp.api] Cleaning up empty listener list for header CommandHeader(id=0x00, subsystem=Subsystem.RPCError, type=CommandType.SRSP) 2020-11-30 12:47:57 DEBUG (MainThread) [zigpy_znp.api] Cleaning up empty listener list for header CommandHeader(id=0x02, subsystem=Subsystem.SYS, type=CommandType.SRSP) 2020-11-30 12:47:57 DEBUG (MainThread) [zigpy_znp.api] There are 0 callbacks and 0 one-shot listeners remaining 2020-11-30 12:47:57 WARNING (MainThread) [zigpy_znp.zigbee.application] Failed to probe ZNP radio with config {'path': '/dev/ttyAMA0', 'flow_control': None, 'baudrate': 115200} Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/zigpy_znp/zigbee/application.py", line 142, in probe await znp.connect() File "/usr/local/lib/python3.8/site-packages/zigpy_znp/api.py", line 236, in connect version = await self.request(c.SYS.Version.Req()) File "/usr/local/lib/python3.8/site-packages/zigpy_znp/api.py", line 520, in request response = await response_future asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/zigpy_znp/zigbee/application.py", line 142, in probe await znp.connect() File "/usr/local/lib/python3.8/site-packages/async_timeout/init.py", line 55, in aexit self._do_exit(exc_type) File "/usr/local/lib/python3.8/site-packages/async_timeout/init.py", line 92, in _do_exit raise asyncio.TimeoutError asyncio.exceptions.TimeoutError 2020-11-30 12:47:57 DEBUG (MainThread) [bellows.ezsp] Resetting EZSP 2020-11-30 12:48:00 DEBUG (MainThread) [bellows.ezsp] Unsuccessful radio probe of '/dev/ttyAMA0' port Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/bellows/ezsp/init.py", line 54, in probe await asyncio.wait_for(ezsp._probe(), timeout=PROBE_TIMEOUT) File "/usr/local/lib/python3.8/asyncio/tasks.py", line 498, in wait_for raise exceptions.TimeoutError() asyncio.exceptions.TimeoutError 2020-11-30 12:48:00 DEBUG (MainThread) [zigpy_deconz.api] Command Command.device_state (0, 0, 0) 2020-11-30 12:48:02 WARNING (MainThread) [zigpy_deconz.api] No response to 'Command.device_state' command with seq id '0x02' 2020-11-30 12:48:02 DEBUG (MainThread) [zigpy_deconz.api] Unsuccessful radio probe of '/dev/ttyAMA0' port Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/zigpy_deconz/api.py", line 380, in probe await asyncio.wait_for(api._probe(), timeout=PROBE_TIMEOUT) File "/usr/local/lib/python3.8/asyncio/tasks.py", line 491, in wait_for return fut.result() File "/usr/local/lib/python3.8/site-packages/zigpy_deconz/api.py", line 396, in _probe await self.device_state() File "/usr/local/lib/python3.8/site-packages/zigpy_deconz/api.py", line 305, in _command return await asyncio.wait_for(fut, timeout=COMMAND_TIMEOUT) File "/usr/local/lib/python3.8/asyncio/tasks.py", line 498, in wait_for raise exceptions.TimeoutError() asyncio.exceptions.TimeoutError 2020-11-30 12:48:02 DEBUG (MainThread) [zigpy_cc.uart] Connecting on port /dev/ttyAMA0 with boudrate 115200 2020-11-30 12:48:02 DEBUG (MainThread) [zigpy_cc.uart] Connection made 2020-11-30 12:48:03 DEBUG (MainThread) [zigpy_cc.api] --> SREQ SYS version tsn: None {} 2020-11-30 12:48:03 DEBUG (MainThread) [zigpy_cc.uart] Send: b'\xfe\x00!\x02#' 2020-11-30 12:48:04 DEBUG (MainThread) [zigpy_cc.api] Unsuccessful radio probe of '/dev/ttyAMA0' port Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/zigpy_cc/api.py", line 279, in probe await asyncio.wait_for(api._probe(), timeout=COMMAND_TIMEOUT) File "/usr/local/lib/python3.8/asyncio/tasks.py", line 498, in wait_for raise exceptions.TimeoutError() asyncio.exceptions.TimeoutError 2020-11-30 12:48:04 DEBUG (MainThread) [zigpy_zigate.uart] PiZiGate detected 2020-11-30 12:48:04 INFO (MainThread) [zigpy_zigate.common] Put PiZiGate in running mode 2020-11-30 12:48:05 DEBUG (MainThread) [zigpy_zigate.uart] Connection made 2020-11-30 12:48:05 DEBUG (MainThread) [zigpy_zigate.uart] Send: 0x0002 b'01' 2020-11-30 12:48:05 DEBUG (MainThread) [zigpy_zigate.uart] Frame to send: b'\x00\x02\x00\x01\x02\x01' 2020-11-30 12:48:05 DEBUG (MainThread) [zigpy_zigate.uart] Frame escaped: b'\x02\x10\x02\x12\x02\x10\x02\x11\x02\x12\x02\x11' 2020-11-30 12:48:07 DEBUG (MainThread) [zigpy_zigate.api] Unsuccessful radio probe of '/dev/ttyAMA0' port Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/zigpy_zigate/api.py", line 258, in probe await asyncio.wait_for(api._probe(), timeout=PROBE_TIMEOUT) File "/usr/local/lib/python3.8/asyncio/tasks.py", line 498, in wait_for raise exceptions.TimeoutError() asyncio.exceptions.TimeoutError 2020-11-30 12:48:07 DEBUG (MainThread) [zigpy_xbee.api] at command: AP (2,) 2020-11-30 12:48:07 DEBUG (MainThread) [zigpy_xbee.api] Command at (b'AP', b'\x02') 2020-11-30 12:48:08 WARNING (MainThread) [zigpy_xbee.api] at: No response to AP command 2020-11-30 12:48:09 WARNING (MainThread) [zigpy_cc.api] No response for: SRSP SYS version {} 2020-11-30 12:48:11 DEBUG (MainThread) [zigpy_xbee.api] Command mode no response to AT '+++' command 2020-11-30 12:48:11 DEBUG (MainThread) [zigpy_xbee.api] Failed to enter AT command mode at 57600bps, trying 1200 next 2020-11-30 12:48:14 DEBUG (MainThread) [zigpy_xbee.api] Command mode no response to AT '+++' command 2020-11-30 12:48:14 DEBUG (MainThread) [zigpy_xbee.api] Failed to enter AT command mode at 1200bps, trying 2400 next 2020-11-30 12:48:17 DEBUG (MainThread) [zigpy_xbee.api] Command mode no response to AT '+++' command 2020-11-30 12:48:17 DEBUG (MainThread) [zigpy_xbee.api] Failed to enter AT command mode at 2400bps, trying 4800 next 2020-11-30 12:48:21 DEBUG (MainThread) [zigpy_xbee.api] Command mode no response to AT '+++' command 2020-11-30 12:48:21 DEBUG (MainThread) [zigpy_xbee.api] Failed to enter AT command mode at 4800bps, trying 9600 next 2020-11-30 12:48:24 DEBUG (MainThread) [zigpy_xbee.api] Command mode no response to AT '+++' command 2020-11-30 12:48:24 DEBUG (MainThread) [zigpy_xbee.api] Failed to enter AT command mode at 9600bps, trying 19200 next 2020-11-30 12:48:27 DEBUG (MainThread) [zigpy_xbee.api] Command mode no response to AT '+++' command 2020-11-30 12:48:27 DEBUG (MainThread) [zigpy_xbee.api] Failed to enter AT command mode at 19200bps, trying 38400 next 2020-11-30 12:48:30 DEBUG (MainThread) [zigpy_xbee.api] Command mode no response to AT '+++' command 2020-11-30 12:48:30 DEBUG (MainThread) [zigpy_xbee.api] Failed to enter AT command mode at 38400bps, trying 57600 next 2020-11-30 12:48:33 DEBUG (MainThread) [zigpy_xbee.api] Command mode no response to AT '+++' command 2020-11-30 12:48:33 DEBUG (MainThread) [zigpy_xbee.api] Failed to enter AT command mode at 57600bps, trying 115200 next 2020-11-30 12:48:37 DEBUG (MainThread) [zigpy_xbee.api] Command mode no response to AT '+++' command 2020-11-30 12:48:37 DEBUG (MainThread) [zigpy_xbee.api] Failed to enter AT command mode at 115200bps, trying 230400 next 2020-11-30 12:48:40 DEBUG (MainThread) [zigpy_xbee.api] Command mode no response to AT '+++' command 2020-11-30 12:48:40 DEBUG (MainThread) [zigpy_xbee.api] Couldn't enter AT command mode at any known baudrate.Configure XBee manually for escaped API mode ATAP2 2020-11-30 12:48:40 DEBUG (MainThread) [zigpy_xbee.api] Unsuccessful radio probe of '/dev/ttyAMA0' port Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/zigpy_xbee/api.py", line 597, in _probe await self._at_command("AP", 2) File "/usr/local/lib/python3.8/site-packages/zigpy_xbee/api.py", line 385, in _at_partial return await asyncio.wait_for( File "/usr/local/lib/python3.8/asyncio/tasks.py", line 498, in wait_for raise exceptions.TimeoutError() asyncio.exceptions.TimeoutError

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/zigpy_xbee/api.py", line 579, in probe await asyncio.wait_for(api._probe(), timeout=PROBE_TIMEOUT) File "/usr/local/lib/python3.8/asyncio/tasks.py", line 491, in wait_for return fut.result() File "/usr/local/lib/python3.8/site-packages/zigpy_xbee/api.py", line 600, in _probe raise APIException("Failed to configure XBee for API mode") zigpy.exceptions.APIException: Failed to configure XBee for API mode

Thanks in advance BR Pedro

doudz commented 3 years ago

What is the version of Home Assistant ? You should use 0.118.4 because it fix pizigate probing

pedlou commented 3 years ago
Version 0.118.4
Installation Type Home Assistant OS
Development false
Supervisor true
Docker true
Virtual Environment false
Python Version 3.8.6
Operating System Family Linux
Operating System Version 4.19.127-v7
CPU Architecture armv7l
Timezone Europe/Lisbon
doudz commented 3 years ago

Ok, did you adjust the boot config to disable internal bluetooth ? because it conflicts with pizigate on Rpi 3 https://zigate.fr/documentation/compatibilite-raspberry-pi-3-et-zero-w/

pedlou commented 3 years ago

Hi Doudz,

/boot/config.txt inline:

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# HassOS - don't change it!
disable_splash=1
kernel=u-boot.bin

# uncomment for aarch64 bit support
#arm_64bit=1

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[all]
#dtoverlay=vc4-fkms-v3d
#max_framebuffers=2
dtoverlay = pi3-disable-bt
enable_uart = 1

/boot/cmdline.txt inline

dwc_otg.lpm_enable=0 console=tty1
doudz commented 3 years ago

I don't think it's important but did you try to remove space around egal sign ? Replace

dtoverlay = pi3-disable-bt
enable_uart = 1

by

dtoverlay=disable-bt
enable_uart=1
pedlou commented 3 years ago

will test it

pedlou commented 3 years ago

It looks like it makes total difference as now integration is successful image I will now try to perform some Zigbee devices integration. many thanks