Hi Moroen,
Yes of course will help testing and will keep you updated.
I have to admit that once every while my Ikea hub seems to hang, ie not responsive, also not through the Ikea app on my phone, so no issue with the plugin. It happened again last night, and while looking at syslog/logging it seems there is something strange going on with handling timeout in domoticz/plugin. Especially a reference to a plugin print that mentioned there is no attribute message is suspicious. The timeout itself is caused by the hub I assume, but handling the timeout in the plugin gives:
Code: Select all
Jan 16 21:39:59 domoticzpi3 twistd[368]: 2018-01-16T21:39:59+0100 [twisted.internet.defer#critical] Unhandled error in Deferred:
Jan 16 21:39:59 domoticzpi3 twistd[368]: 2018-01-16T21:39:59+0100 [twisted.internet.defer#critical]
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011Traceback (most recent call last):
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/twisted/internet/base.py", line 1243, in run
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011 self.mainLoop()
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/twisted/internet/base.py", line 1252, in mainLoop
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011 self.runUntilCurrent()
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/twisted/internet/base.py", line 878, in runUntilCurrent
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011 call.func(*call.args, **call.kw)
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/twisted/internet/task.py", line 239, in __call__
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011 d = defer.maybeDeferred(self.f, *self.a, **self.kw)
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011--- <exception caught here> ---
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/twisted/internet/defer.py", line 150, in maybeDeferred
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011 result = f(*args, **kw)
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011 File "/home/pi/domoticz/plugins/IKEA-Tradfri/tradfri.tac", line 250, in announce
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011 print("Error in annouce: {0}:{1}".format(e, e.message))
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011builtins.AttributeError: 'RequestTimeout' object has no attribute 'message'
Jan 16 21:39:59 domoticzpi3 twistd[368]: #011
Afterwards I keep getting timeouts like:
Code: Select all
Jan 16 21:45:14 domoticzpi3 twistd[368]: 2018-01-16T21:45:14+0100 [CoapAdapter,0,127.0.0.1] Unhandled Error
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011Traceback (most recent call last):
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/twisted/python/log.py", line 103, in callWithLogger
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 return callWithContext({"system": lp}, func, *args, **kw)
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/twisted/python/log.py", line 86, in callWithContext
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 return context.call({ILogContext: newCtx}, func, *args, **kw)
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/twisted/python/context.py", line 122, in callWithContext
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 return self.currentContext().callWithContext(ctx, func, *args, **kw)
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/twisted/python/context.py", line 85, in callWithContext
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 return func(*args,**kw)
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011--- <exception caught here> ---
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 why = selectable.doRead()
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/twisted/internet/tcp.py", line 205, in doRead
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 return self._dataReceived(data)
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/twisted/internet/tcp.py", line 211, in _dataReceived
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 rval = self.protocol.dataReceived(data)
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 File "/home/pi/domoticz/plugins/IKEA-Tradfri/tradfri.tac", line 89, in dataReceived
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 self.factory.setState(self, command["deviceID"], command["state"])
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 File "/home/pi/domoticz/plugins/IKEA-Tradfri/tradfri.tac", line 401, in setState
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 targetDevice = self.api(self.gateway.get_group(int(deviceID)))
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 92, in request
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 return self._execute(api_commands)
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 File "/home/pi/.local/lib/python3.5/site-packages/pytradfri/api/libcoap_api.py", line 81, in _execute
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011 raise RequestTimeout() from None
Jan 16 21:45:14 domoticzpi3 twistd[368]: #011pytradfri.error.RequestTimeout:
Between 21:39 and this morning the timeouts kept coming and the whole raspberry pi seemd to have restarted twice (not sure if there is a relation, and I can't find out what happened exactly). When unplugging the hub and plugging it back in this morning, the system restored itself to ok operation, without rebooting/restarting Domoticz. This is what I see just before the reboot:
Code: Select all
Jan 17 02:20:24 domoticzpi3 mtp-probe: checking bus 1, device 5: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3"
Jan 17 02:20:24 domoticzpi3 mtp-probe: bus: 1, device: 5 was not an MTP device
Jan 17 02:20:24 domoticzpi3 mtp-probe: checking bus 1, device 4: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2"
Jan 17 02:20:24 domoticzpi3 mtp-probe: bus: 1, device: 4 was not an MTP device
Jan 17 02:20:24 domoticzpi3 mtp-probe: checking bus 1, device 6: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5"
Jan 17 02:20:24 domoticzpi3 mtp-probe: bus: 1, device: 6 was not an MTP device
Jan 17 02:20:24 domoticzpi3 mtp-probe: checking bus 1, device 3: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1"
Jan 17 02:20:24 domoticzpi3 mtp-probe: bus: 1, device: 3 was not an MTP device
Jan 17 02:20:24 domoticzpi3 mtp-probe: checking bus 1, device 5: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3"
Jan 17 02:20:24 domoticzpi3 mtp-probe: bus: 1, device: 5 was not an MTP device
Jan 17 02:20:24 domoticzpi3 mtp-probe: checking bus 1, device 4: "/sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2"
Jan 17 02:20:24 domoticzpi3 mtp-probe: bus: 1, device: 4 was not an MTP device
Jan 17 02:20:24 domoticzpi3 liblogging-stdlog: [origin software="rsyslogd" swVersion="8.24.0" x-pid="347" x-info="http://www.rsyslog.com"] start
Jan 17 02:20:24 domoticzpi3 kernel: [ 0.000000] Booting Linux on physical CPU 0x0
Jan 17 02:20:24 domoticzpi3 kernel: [ 0.000000] Linux version 4.9.59-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #1047 SMP Sun Oct 29 12:19:23 GMT 2017