kevinvincent / ha-wyzesense

A Home Assistant Component to interface with the WYZE Sense hub and sensor system
369 stars 99 forks source link

TimeoutError _DoCommand Freenas 11.2 jail Hassio #16

Open jasonogren opened 5 years ago

jasonogren commented 5 years ago

I have a freenas 11.2 jail with home assistant in a virtualenv and found the device (uhid0). This appears and disappears when I place and remove the Wyze hub. I have Nortek zwave USB running without problems so I feel that I can expose and configure USB devices in a jail. I believe my usbconfig shows the device as <vendor 0x1a86 product 0xe024>. I never got a (hidraw0) interface and I had write permission errors to (uhid0)and have overcome that and now get this output. For this integration to work does the device have to be seen as hidraw0? Thanks for any insight and great work on the integration!

usbconfig in jail:

ugen1.8: <vendor 0x1a86 product 0xe024> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen1.8.0: uhid0: <vendor 0x1a86 product 0xe024, class 0/0, rev 1.10/1.0c, addr 8>

                                     Error while setting up platform wyzesense2019-08-19 14:02:40 DEBUG (SyncWorker_53) [wyzesense.gateway] Start Inquiry...

2019-08-19 14:02:40 DEBUG (SyncWorker_53) [wyzesense.gateway] ===> Sending: Packet: Cmd=4327, Payload= 2019-08-19 14:02:40 DEBUG (SyncWorker_53) [wyzesense.gateway] Sending: b'aa55430327016c' 2019-08-19 14:02:42 WARNING (SyncWorker_53) [custom_components.wyzesense.binary_sensor] _DoCommand, retrying in 1 seconds... 2019-08-19 14:02:43 DEBUG (SyncWorker_53) [wyzesense.gateway] Start Inquiry... 2019-08-19 14:02:43 DEBUG (SyncWorker_53) [wyzesense.gateway] ===> Sending: Packet: Cmd=4327, Payload= 2019-08-19 14:02:43 DEBUG (SyncWorker_53) [wyzesense.gateway] Sending: b'aa55430327016c' 2019-08-19 14:02:45 WARNING (SyncWorker_53) [custom_components.wyzesense.binary_sensor] _DoCommand, retrying in 1 seconds... 2019-08-19 14:02:46 DEBUG (SyncWorker_53) [wyzesense.gateway] Start Inquiry... 2019-08-19 14:02:46 DEBUG (SyncWorker_53) [wyzesense.gateway] ===> Sending: Packet: Cmd=4327, Payload= 2019-08-19 14:02:46 DEBUG (SyncWorker_53) [wyzesense.gateway] Sending: b'aa55430327016c' 2019-08-19 14:02:46 WARNING (MainThread) [homeassistant.components.binary_sensor] Setup of platform wyzesense is taking over 10 seconds. 2019-08-19 14:02:48 WARNING (SyncWorker_53) [custom_components.wyzesense.binary_sensor] _DoCommand, retrying in 1 seconds... 2019-08-19 14:02:49 DEBUG (SyncWorker_53) [wyzesense.gateway] Start Inquiry... 2019-08-19 14:02:49 DEBUG (SyncWorker_53) [wyzesense.gateway] ===> Sending: Packet: Cmd=4327, Payload= 2019-08-19 14:02:49 DEBUG (SyncWorker_53) [wyzesense.gateway] Sending: b'aa55430327016c' 2019-08-19 14:02:51 WARNING (SyncWorker_53) [custom_components.wyzesense.binary_sensor] _DoCommand, retrying in 1 seconds... 2019-08-19 14:02:52 DEBUG (SyncWorker_53) [wyzesense.gateway] Start Inquiry... 2019-08-19 14:02:52 DEBUG (SyncWorker_53) [wyzesense.gateway] ===> Sending: Packet: Cmd=4327, Payload= 2019-08-19 14:02:52 DEBUG (SyncWorker_53) [wyzesense.gateway] Sending: b'aa55430327016c' 2019-08-19 14:02:54 WARNING (SyncWorker_53) [custom_components.wyzesense.binary_sensor] _DoCommand, retrying in 1 seconds... 2019-08-19 14:02:55 DEBUG (SyncWorker_53) [wyzesense.gateway] Start Inquiry... 2019-08-19 14:02:55 DEBUG (SyncWorker_53) [wyzesense.gateway] ===> Sending: Packet: Cmd=4327, Payload= 2019-08-19 14:02:55 DEBUG (SyncWorker_53) [wyzesense.gateway] Sending: b'aa55430327016c' 2019-08-19 14:02:57 WARNING (SyncWorker_53) [custom_components.wyzesense.binary_sensor] _DoCommand, retrying in 1 seconds... 2019-08-19 14:02:58 DEBUG (SyncWorker_53) [wyzesense.gateway] Start Inquiry... 2019-08-19 14:02:58 DEBUG (SyncWorker_53) [wyzesense.gateway] ===> Sending: Packet: Cmd=4327, Payload= 2019-08-19 14:02:58 DEBUG (SyncWorker_53) [wyzesense.gateway] Sending: b'aa55430327016c' 2019-08-19 14:03:01 WARNING (SyncWorker_53) [custom_components.wyzesense.binary_sensor] _DoCommand, retrying in 1 seconds... 2019-08-19 14:03:02 DEBUG (SyncWorker_53) [wyzesense.gateway] Start Inquiry... 2019-08-19 14:03:02 DEBUG (SyncWorker_53) [wyzesense.gateway] ===> Sending: Packet: Cmd=4327, Payload= 2019-08-19 14:03:02 DEBUG (SyncWorker_53) [wyzesense.gateway] Sending: b'aa55430327016c' 2019-08-19 14:03:04 WARNING (SyncWorker_53) [custom_components.wyzesense.binary_sensor] _DoCommand, retrying in 1 seconds... 2019-08-19 14:03:05 DEBUG (SyncWorker_53) [wyzesense.gateway] Start Inquiry... 2019-08-19 14:03:05 DEBUG (SyncWorker_53) [wyzesense.gateway] ===> Sending: Packet: Cmd=4327, Payload= 2019-08-19 14:03:05 DEBUG (SyncWorker_53) [wyzesense.gateway] Sending: b'aa55430327016c' 2019-08-19 14:03:07 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform wyzesense Traceback (most recent call last): File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 149, in _async_setup_platform await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT) File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for return fut.result() File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) File "/home/hass/homeassistant/custom_components/wyzesense/binary_sensor.py", line 81, in setup_platform ws = beginConn() File "</srv/homeassistant/lib/python3.6/site-packages/decorator.py:decorator-gen-2>", line 2, in beginConn File "/srv/homeassistant/lib/python3.6/site-packages/retry/api.py", line 74, in retry_decorator logger) File "/srv/homeassistant/lib/python3.6/site-packages/retry/api.py", line 33, in retry_internal return f() File "/home/hass/homeassistant/custom_components/wyzesense/binary_sensor.py", line 79, in beginConn return wyzesense.Open(config[CONF_DEVICE], on_event) File "/srv/homeassistant/lib/python3.6/site-packages/wyzesense/gateway.py", line 551, in Open return Dongle(device, event_handler) File "/srv/homeassistant/lib/python3.6/site-packages/wyzesense/gateway.py", line 295, in init__ self._Start() File "/srv/homeassistant/lib/python3.6/site-packages/wyzesense/gateway.py", line 482, in _Start self._Inquiry() File "/srv/homeassistant/lib/python3.6/site-packages/wyzesense/gateway.py", line 388, in _Inquiry resp = self._DoSimpleCommand(Packet.Inquiry()) File "/srv/homeassistant/lib/python3.6/site-packages/wyzesense/gateway.py", line 383, in _DoSimpleCommand self._DoCommand(pkt, cmd_handler, timeout) File "/srv/homeassistant/lib/python3.6/site-packages/wyzesense/gateway.py", line 374, in _DoCommand raise TimeoutError("_DoCommand") TimeoutError: _DoCommand

kevinvincent commented 5 years ago

It doesn't have to be /dev/hidraw0, it'll use whatever you provide in the config. However, your logs look like the dongle isn't sending anything back. I've only seen that happen when I chose the wrong /hidraw device. The vendor and device id you provided is correct for the wyzesense dongle, so its definitely detecting it. Unfortunately I don't have any experience with freenas. What's the output when you run dmesg | grep hidraw?

jasonogren commented 5 years ago

Thanks for the quick response. dmesg | grep hidraw show no interface but interestingly dmesg | grep uhid0 show the device but says (disconnected). Seems like I have some more freenas USB homework. Is there a kernel linux driver for hidraw that might me missing in Freenas?

From BSD manual: The uhid driver provides support for all HID (Human Interface Device) in- terfaces in USB devices that do not have a special driver.

Perhaps I am missing kernel support or module support for hidraw?

Thanks

njolstech commented 3 years ago

I can confirm that I'm having this issue as well.

It seems that FreeNAS/FreeBSD doesn't have hidraw but rather uhid.