so on my ubitiqui AirOs now it seem it works great (with user and pass filled in domoticz iDetect plugin setting). Response with ARP is quite fast.
only problem is that my log is full of errors
2018-06-07 08:14:30.954 Error: test hardware (34) thread seems to have ended unexpectedly
Code: Select all
2018-06-07 08:17:09.437 (test) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2018-06-07 08:17:09.467 (test) Checking if [ssh -V] will run: OK
2018-06-07 08:17:09.485 (test) Checking if [sshpass -V] will run: OK
2018-06-07 08:17:09.486 (test) Monitoring {'svatka': 'XXXX', 'honza': 'XXX'} for presence.
2018-06-07 08:17:09.486 (test) Pushing 'PollIntervalDirective' on to queue
2018-06-07 08:17:09.486 (test) Checking router capabilities and wireless interfaces
2018-06-07 08:17:09.486 (test) Using password instead of ssh public key authentication (less secure!)
2018-06-07 08:17:09.486 (test) Fetching data from router using ssh
2018-06-07 08:17:09.486 (test) command: ['sshpass', '-p', 'xxxx', 'ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'ConnectTimeout=2', '[email protected]', '#!/bin/sh\n\t\t\t\t\texport PATH=/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:$PATH\n\t\t\t\t\ttest=$(which wl > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "wl@"\n\t\t\t\t\t\t\tfor iface in $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(wl -i $iface assoclist > /dev/null 2>&1)\n\t\t\t\t\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\t\t\t\t\tprintf "$iface "\n\t\t\t\t\t\t\t\t\tfi\n\t\t\t\t\t\t\tdone\n\t\t\t\t\t\t\texit\n\t\t\t\t\tfi\n\t\t\t\t\ttest=$(which iwinfo > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "iwinfo@"\n\t\t\t\t\t\t\tfor iface in $(iwinfo | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(iwinfo wlan0 assoclist > /dev/null 2>&1)\n\t\t\t\t\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\t\t\t\t\tprintf "$iface "\n\t\t\t\t\t\t\t\t\tfi\n\t\t\t\t\t\t\tdone\n\t\t\t\t\t\t\texit\n\t\t\t\t\tfi\t\t\t\t\t\n\t\t\t\t\ttest=$(which arp > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "arp"\n\t\t\t\t\t\t\texit\n\t\t\t\t\tfi\n\t\t\t\t\tif [ -f /proc/net/arp ]; then\n\t\t\t\t\t\tprintf "procarp"\n\t\t\t\t\t\texit\n\t\t\t\t\tfi\n\t\t\t\t\tprintf none']
2018-06-07 08:17:09.965 (test) Returncode ssh command: 0
2018-06-07 08:17:09.965 (test) Output from router: b'procarp'
2018-06-07 08:17:09.965 (test) Parsed data from router: ['procarp']
2018-06-07 08:17:09.966 (test) Constructed this cmd for the router to poll for present phones: export PATH=/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:$PATH;cat /proc/net/arp | grep '..:..:..:..:..:..' | awk '{print $ 4}';exit
2018-06-07 08:17:09.966 (test) monitoring device: test - honza
2018-06-07 08:17:09.966 (test) test - honza is stil in use
2018-06-07 08:17:09.966 (test) monitoring device: test - svatka
2018-06-07 08:17:09.966 (test) test - svatka is stil in use
2018-06-07 08:17:09.966 (test) devid2domid: {'svatka': 3, 'honza': 2}
2018-06-07 08:17:09.966 (test) monitormacs: {'svatka': 'xxxx', 'honza': 'xxxx'}
2018-06-07 08:17:09.966 (test) Processing 'PollIntervalDirective' message
2018-06-07 08:17:09.966 (test) Heartbeat interval set to: 300.
2018-06-07 08:17:18.935 (test) Pushing 'onHeartbeatCallback' on to queue
2018-06-07 08:17:18.969 (test) Processing 'onHeartbeatCallback' message
2018-06-07 08:17:18.969 (test) Calling message handler 'onHeartbeat'.
2018-06-07 08:17:18.969 (test) devid2domid: {'svatka': 3, 'honza': 2}
2018-06-07 08:17:18.970 (test) Polling present phones from router
2018-06-07 08:17:18.970 (test) Using password instead of ssh public key authentication (less secure!)
2018-06-07 08:17:18.970 (test) Fetching data from router using ssh
2018-06-07 08:17:18.970 (test) command: ['sshpass', '-p', 'dilnajanova', 'ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'ConnectTimeout=1', '[email protected]', "export PATH=/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:$PATH;cat /proc/net/arp | grep '..:..:..:..:..:..' | awk '{print $ 4}';exit"]
2018-06-07 08:17:19.500 (test) Returncode ssh command: 0
2018-06-07 08:17:19.500 (test) Output from router: b'f0:fe:6b:6a:0f:1a\n04:95:e6:23:1d:50\n00:a0:de:a2:a4:1c\n78:11:dc:12:ce:b7\na0:d7:95:85:36:55\n32:83:45:4b:85:db\n28:6c:07:10:84:de\nd4:ca:6d:7b:34:eb\n54:10:ec:8b:7c:dd\n60:01:94:70:ac:e0\nf0:fe:6b:28:2a:fe\n78:11:dc:b0:64:78\n00:d0:4b:96:1f:c6\nb4:43:0d:f9:16:04\n'
2018-06-07 08:17:19.501 (test) Seems to have went offline: honza
2018-06-07 08:17:08.675 Status: (test) Stop directive received.
2018-06-07 08:17:08.876 Status: (test) Stopping threads.
2018-06-07 08:17:09.171 Status: (test) Exiting work loop.
2018-06-07 08:17:09.171 Status: (test) Stopped.
2018-06-07 08:17:09.172 Status: (test) Started.
2018-06-07 08:17:09.432 Status: (test) Entering work loop.
2018-06-07 08:17:09.432 Status: (test) Initialized version 0.3.3, author 'ESCape'
2018-06-07 08:17:09.966 Status: (test) Using last resort method (read info from /proc/net/arp file). This method has a slower and less reliable response to absence)
2018-06-07 08:17:19.501 Status: (test) Awaiting confirmation on absence of 1 devices
so it looks firs check is ok
but then i have these error in logs
but plugin seems to work, even with these errors
Code: Select all
2018-06-07 08:14:30.954 Error: test hardware (34) thread seems to have ended unexpectedly
im on Python Version: 3.5.2
dunno how to debug thread bug (maybe some probem with python plugin system in domoticz)
any ideas how to get rid off these errors?