Python plugin: Presence detection from wireless router

Python and python framework
EscApe
Posts: 210
Joined: Thursday 02 April 2015 8:46
Target OS: Raspberry Pi
Domoticz version: v3+beta
Location: The Netherlands
Contact:

Re: Python plugin: Presence detection from wireless router

Post by EscApe » Friday 29 June 2018 21:29

Did you update to the latest version and try the new #forcegeneric option (as described on github and in the previous posts)?
That should force the plugin to use brctl or arp and ignore the wl command even if the command is available on the router.

In your case the command seems to be available, but unless we/you can figure out what interfaces to query we can’t use it. It could be as simple as the router using other interfaces names than eth*, wlan*, ath* and the script simply filtering them out.

User avatar
Innovator
Posts: 15
Joined: Tuesday 20 February 2018 13:33
Target OS: NAS (Synology & others)
Domoticz version: 8924
Location: Amsterdam
Contact:

Re: Python plugin: Presence detection from wireless router

Post by Innovator » Saturday 30 June 2018 9:20

@Escape Thanks for the advice; executed and working! :D
Synology DS918+ /DS412+
ASUS BRT-AC828, RT-AC86U, RT-AC68U

drwurn
Posts: 42
Joined: Sunday 10 June 2018 16:59
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python plugin: Presence detection from wireless router

Post by drwurn » Saturday 30 June 2018 15:58

My phone (android) has multiple unwanted absence while being at home.
My wife's phone (Iphone) is working properly.

Already looked in my phone but wifi power saver is turned off.
It looks like it's happening after an hour or so when I didn't was active on my phone, and after that hour it's happening multiple times per hour.
The period that my phone is offline are a few minuts and it's going online without touching my phone.

Already changed the poll and grace period a few times but so far it didn't work out.

What should be a good poll/grace time in my case?
Don't really care if it takes a few minutes to confirm absence, if presence confirmation is fast.

EscApe
Posts: 210
Joined: Thursday 02 April 2015 8:46
Target OS: Raspberry Pi
Domoticz version: v3+beta
Location: The Netherlands
Contact:

Re: Python plugin: Presence detection from wireless router

Post by EscApe » Wednesday 04 July 2018 14:00

@drwurn

Hard to say. The detection depends on a stable wifi connection or a grace period that will bridge the temporary connection drops. If your wife's phone sometimes drops the connection for more than 10 minutes, you will need a grace period longer than that. The grace period does not influence how quickly a new presence is detected. Only absence.

In this case do NOT choose a longer poll time. Long poll times will affect how quickly presence is detected AND if your wif'e's phone drops the connection often, then the chance will increase that you are checking for presence during such a connection drop. Polling often will ensure the grace period will be reset every time the phone is (briefly) connected.

I'm afraid you'll just have to experiment to find the ideal combination of settings.

Prutsium
Posts: 62
Joined: Monday 18 June 2018 11:31
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Germany / Netherlands
Contact:

Re: Python plugin: Presence detection from wireless router

Post by Prutsium » Friday 06 July 2018 22:01

Wierd .....

I have it running on my own Asus RT68 and works great.
Trying to setup the same on the RT87 and no luck .... SSH is enabled and no certificate.

Code: Select all

Result:
2018-07-06 22:58:49.975 (Presence detection Phones) Output from router: b''
2018-07-06 22:58:56.410 MQTT: Topic: domoticz/in, Message: {"idx":23,"nvalue":0,"svalue":"0;13662.7","Battery":57,"RSSI":6}
2018-07-06 22:58:56.520 MQTT: Topic: domoticz/in, Message: {"idx":20,"nvalue":0,"svalue":"230","Battery":57,"RSSI":6}
2018-07-06 22:58:56.628 MQTT: Topic: domoticz/in, Message: {"idx":22,"nvalue":0,"svalue":"0.000","Battery":57,"RSSI":6}
2018-07-06 22:59:04.837 (Presence detection Phones) Pushing 'onHeartbeatCallback' on to queue
2018-07-06 22:59:04.854 (Presence detection Phones) Processing 'onHeartbeatCallback' message
2018-07-06 22:59:04.854 (Presence detection Phones) Calling message handler 'onHeartbeat'.
2018-07-06 22:59:04.854 (Presence detection Phones) devid2domid: {'Jerome': 2}
2018-07-06 22:59:04.854 (Presence detection Phones) Checking router capabilities and wireless interfaces
2018-07-06 22:59:04.854 (Presence detection Phones) Pushing 'PollIntervalDirective' on to queue
2018-07-06 22:59:04.854 (Presence detection Phones) Using ssh public key authentication (~/.ssh/id_rsa.pub) for OS user running domoticz.
2018-07-06 22:59:04.870 (Presence detection Phones) The OS user profile running domoticz is:	root
2018-07-06 22:59:04.870 (Presence detection Phones) Fetching data from router using ssh
2018-07-06 22:59:04.870 (Presence detection Phones) command: ['ssh', '-o', 'ConnectTimeout=2', 'oxy@192.168.199.1', '#!/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 $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(iwinfo $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 wlanconfig > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "wlanconfig@"\n\t\t\t\t\t\t\tfor iface in $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(wlanconfig $iface list > /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 brctl > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "brctl"\n\t\t\t\t\t\t\texit\n\t\t\t\t\tfi\t\t\t\t\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-07-06 22:59:04.985 (Presence detection Phones) Returncode ssh command: 255

EscApe
Posts: 210
Joined: Thursday 02 April 2015 8:46
Target OS: Raspberry Pi
Domoticz version: v3+beta
Location: The Netherlands
Contact:

Re: Python plugin: Presence detection from wireless router

Post by EscApe » Friday 06 July 2018 22:39

Hi Prutsium,

My frist guess would be a authentication failure. You say no certificate, but the plugin up is trying to use key based authentication according to the log segment. Seems like you are getting no info from the router at all.

Prutsium
Posts: 62
Joined: Monday 18 June 2018 11:31
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Germany / Netherlands
Contact:

Re: Python plugin: Presence detection from wireless router

Post by Prutsium » Saturday 07 July 2018 6:26

EscApe wrote:
Friday 06 July 2018 22:39
Hi Prutsium,

My frist guess would be a authentication failure. You say no certificate, but the plugin up is trying to use key based authentication according to the log segment. Seems like you are getting no info from the router at all.
<t>When i try to log into the router directly from the Pi running domoticz with SSH ***@192.168.199.1 i get no errors so seems SSH from the Pi works.<br/>
<br/>
No clue whats happening here as i installed it before without issues on a different system.</t>

Prutsium
Posts: 62
Joined: Monday 18 June 2018 11:31
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Germany / Netherlands
Contact:

Re: Python plugin: Presence detection from wireless router

Post by Prutsium » Saturday 07 July 2018 6:26

EscApe wrote:
Friday 06 July 2018 22:39
Hi Prutsium,

My frist guess would be a authentication failure. You say no certificate, but the plugin up is trying to use key based authentication according to the log segment. Seems like you are getting no info from the router at all.
<t>When i try to log into the router directly from the Pi running domoticz with SSH ***@192.168.199.1 i get no errors so seems SSH from the Pi works.<br/>
<br/>
No clue whats happening here as i installed it before without issues on a different system.</t>

Prutsium
Posts: 62
Joined: Monday 18 June 2018 11:31
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Germany / Netherlands
Contact:

Re: Python plugin: Presence detection from wireless router

Post by Prutsium » Saturday 07 July 2018 6:36

Prutsium wrote:
Saturday 07 July 2018 6:26
EscApe wrote:
Friday 06 July 2018 22:39
Hi Prutsium,

My frist guess would be a authentication failure. You say no certificate, but the plugin up is trying to use key based authentication according to the log segment. Seems like you are getting no info from the router at all.
<t>When i try to log into the router directly from the Pi running domoticz with SSH ***@192.168.199.1 i get no errors so seems SSH from the Pi works.<br/>
<br/>
No clue whats happening here as i installed it before without issues on a different system.</t>
Ok got it working have generated a key and then it worked. Seems the option without key and using user & pass doesnt work somehow.

mrkrabs
Posts: 42
Joined: Sunday 12 March 2017 15:42
Target OS: Raspberry Pi
Domoticz version: 3.9589
Contact:

Re: Python plugin: Presence detection from wireless router

Post by mrkrabs » Monday 23 July 2018 17:41

not sure if this is plugin related, but still. I've recently removed python3.5 and installed python3.4 and then remove the 3.4 version and installed back python3.5 and now i got this error on the latest plugin version:

Code: Select all

2018-07-23 17:38:36.096 Error: (Presence detection) 'onStart' failed 'ValueError':'invalid literal for int() with base 10: 'null''.
2018-07-23 17:38:36.097 Error: (Presence detection) ----> Line 490 in '/home/pi/domoticz/plugins/Domoticz_iDetect/plugin.py, function onStart
2018-07-23 17:38:36.097 Error: (Presence detection) ----> Line 363 in '/home/pi/domoticz/plugins/Domoticz_iDetect/plugin.py, function onStart
2018-07-23 17:38:44.432 Error: (Presence detection) 'onHeartbeat' failed 'AttributeError':''BasePlugin' object has no attribute 'beats''.
2018-07-23 17:38:44.432 Error: (Presence detection) ----> Line 494 in '/home/pi/domoticz/plugins/Domoticz_iDetect/plugin.py, function onHeartbeat
2018-07-23 17:38:44.433 Error: (Presence detection) ----> Line 415 in '/home/pi/domoticz/plugins/Domoticz_iDetect/plugin.py, function onHeartbeat
i am on the latest domoticz beta, which is V4.9788. anyone has any ideas what i am missing? thank you!

User avatar
Dnpwwo
Posts: 750
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python plugin: Presence detection from wireless router

Post by Dnpwwo » Tuesday 24 July 2018 11:06

@mrkrabs,

I always recommend that people run the version of Python that ships with their operating system because that always seems to work best.

Python Plugin Framework works with Python 3.4.2 and above and there is no advantage to running later versions. Functionality is the same for all versions up to 3.7.0.

Is there a reason you can't run 3.4?
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw

mrkrabs
Posts: 42
Joined: Sunday 12 March 2017 15:42
Target OS: Raspberry Pi
Domoticz version: 3.9589
Contact:

Re: Python plugin: Presence detection from wireless router

Post by mrkrabs » Tuesday 24 July 2018 11:10

yes, there is, like, this plugin requires Python3.5 or higher according to github, also some other plugins require Python3.5

EscApe
Posts: 210
Joined: Thursday 02 April 2015 8:46
Target OS: Raspberry Pi
Domoticz version: v3+beta
Location: The Netherlands
Contact:

Re: Python plugin: Presence detection from wireless router

Post by EscApe » Wednesday 25 July 2018 8:03

The plugin requires python3.5 because i used the 'new' subprocess.run method. To be compatible with python 3.4 parts of it would have to be rewritten to use subprocess.popen instead. That's not a priority for me right now, but if anyone wants te take up the challenge i would be more than happy to incorporate the changes into to plugin.

mrkrabs
Posts: 42
Joined: Sunday 12 March 2017 15:42
Target OS: Raspberry Pi
Domoticz version: 3.9589
Contact:

Re: Python plugin: Presence detection from wireless router

Post by mrkrabs » Wednesday 25 July 2018 10:04

@EscApe - do you have any idea what could my errors posted above mean?

EscApe
Posts: 210
Joined: Thursday 02 April 2015 8:46
Target OS: Raspberry Pi
Domoticz version: v3+beta
Location: The Netherlands
Contact:

Re: Python plugin: Presence detection from wireless router

Post by EscApe » Wednesday 25 July 2018 10:31

@mrkrabs

Not sure what the root cause is, but from the log segment I think it is the poll interval setting. It’s configuration has changed a little while ago. I think that was also mentioned in the release notes.

Are you using the latest version of the plugin and did you visit and save(!) the settings page of the plugin (to make sure all settings are present and correct)?

Other things to check:
- is domoticz actually using python 3.5 (shown on the settings > about page)
- with debug mode enabled, are there any other messages from the plugin in the log before the ones you posted?

mrkrabs
Posts: 42
Joined: Sunday 12 March 2017 15:42
Target OS: Raspberry Pi
Domoticz version: 3.9589
Contact:

Re: Python plugin: Presence detection from wireless router

Post by mrkrabs » Wednesday 25 July 2018 13:08

i've played around with the values changing them, and then enabled debug mode, still errors, but less now. here's the log:
Spoiler: show

Code: Select all

2018-07-25 13:03:44.120 Status: (Presence detection) Started.
2018-07-25 13:03:45.166 (Presence detection) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2018-07-25 13:03:45.167 (Presence detection) Not running on Windows
2018-07-25 13:03:45.222 (Presence detection) Checking if [ssh -V] will run: OK
2018-07-25 13:03:45.252 (Presence detection) Checking if [sshpass -V] will run: OK
2018-07-25 13:03:45.253 (Presence detection) Monitoring {'xxxxx': '98:DE:D0:BE:18:41', 'xxxxxxxx': 'D8:96:95:24:A4:92', 'xxxxxxxxxxxxxxxxxx': '64:70:33:A6:7E:E2'} for presence.
2018-07-25 13:03:45.254 (Presence detection) Checking router capabilities and wireless interfaces
2018-07-25 13:03:45.254 (Presence detection) Using password instead of ssh public key authentication (less secure!)
2018-07-25 13:03:45.255 (Presence detection) Fetching data from router using ssh
2018-07-25 13:03:45.255 (Presence detection) command: ['sshpass', '-p', '**************', 'ssh', '-o', 'StrictHostKeyChecking=no', '-o', 'ConnectTimeout=2', 'xxxxxx@10.0.0.22', '#!/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 $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(iwinfo $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 wlanconfig > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "wlanconfig@"\n\t\t\t\t\t\t\tfor iface in $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(wlanconfig $iface list > /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 brctl > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "brctl"\n\t\t\t\t\t\t\texit\n\t\t\t\t\tfi\t\t\t\t\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-07-25 13:03:45.102 Status: (Presence detection) Initialized version 0.4.2, author 'ESCape'
2018-07-25 13:03:45.102 Status: (Presence detection) Entering work loop.
2018-07-25 13:03:46.247 (Presence detection) Returncode ssh command: 0
2018-07-25 13:03:46.248 (Presence detection) Output from router: b'iwinfo@wlan0 wlan1 '
2018-07-25 13:03:46.250 (Presence detection) Parsed data from router: ['iwinfo', 'wlan0 wlan1 ']
2018-07-25 13:03:46.251 (Presence detection) 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;iwinfo wlan0 assoclist | grep '^..:..:..:..:..:.. ' | cut -d' ' -f1;iwinfo wlan1 assoclist | grep '^..:..:..:..:..:.. ' | cut -d' ' -f1;exit
2018-07-25 13:03:46.252 (Presence detection) Creating device 'Override'.
2018-07-25 13:03:46.252 (Presence detection) monitoring device: xxxxxxxxxxxxiPhone
2018-07-25 13:03:46.253 (Presence detection) xxxxxxxxxxxxiPhoneis stil in use
2018-07-25 13:03:46.253 (Presence detection) monitoring device: xxxxxiPhone
2018-07-25 13:03:46.253 (Presence detection) xxxxxiPhoneis stil in use
2018-07-25 13:03:46.254 (Presence detection) monitoring device: xxxxxxPC
2018-07-25 13:03:46.254 (Presence detection) xxxxxxPC is stil in use
2018-07-25 13:03:46.255 (Presence detection) devid2domid: {'xxxxxx': 4, 'xxxxx': 3, 'xxxxxxxxxx': 2}
2018-07-25 13:03:46.255 (Presence detection) monitormacs: {'xxxxxxx': '98:xxx:BE:18:41', 'xxxxxxxxxxxxx': 'D8:xx:24:A4:92', 'xxxxxxxxxxxxxx': '64:xxx:A6:7E:E2'}
2018-07-25 13:03:46.256 (Presence detection) Pushing 'PollIntervalDirective' on to queue
2018-07-25 13:03:46.306 (Presence detection) Processing 'PollIntervalDirective' message
2018-07-25 13:03:46.306 (Presence detection) Heartbeat interval set to: 30.
2018-07-25 13:03:46.251 Status: (Presence detection) Using chipset specific (iwinfo) command on router for interfaces ['wlan0', 'wlan1']
2018-07-25 13:03:46.252 Status: (Presence detection) Override switch created to override absence with presence
2018-07-25 13:03:54.605 (Presence detection) Pushing 'onHeartbeatCallback' on to queue
2018-07-25 13:03:54.631 (Presence detection) Processing 'onHeartbeatCallback' message
2018-07-25 13:03:54.632 (Presence detection) Calling message handler 'onHeartbeat'.
2018-07-25 13:03:54.633 Error: (Presence detection) 'onHeartbeat' failed 'KeyError'.
2018-07-25 13:03:54.633 Error: (Presence detection) ----> Line 494 in '/home/pi/domoticz/plugins/Presence/plugin.py, function onHeartbeat
2018-07-25 13:03:54.634 Error: (Presence detection) ----> Line 421 in '/home/pi/domoticz/plugins/Presence/plugin.py, function onHeartbeat
The python version in domoticz is the following:

Code: Select all

Python Version: 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170124]

EscApe
Posts: 210
Joined: Thursday 02 April 2015 8:46
Target OS: Raspberry Pi
Domoticz version: v3+beta
Location: The Netherlands
Contact:

Re: Python plugin: Presence detection from wireless router

Post by EscApe » Wednesday 25 July 2018 14:25

@mrkrabs

Did you restart domoticz after updating the plugin? If not, please do so and check and safe the settings again.

The error you're getting seems to be related to the override button. Is the button created? If not, please enable the addition of new devices in the domoticz settings and restart the plugin.

mrkrabs
Posts: 42
Joined: Sunday 12 March 2017 15:42
Target OS: Raspberry Pi
Domoticz version: 3.9589
Contact:

Re: Python plugin: Presence detection from wireless router

Post by mrkrabs » Wednesday 25 July 2018 14:28

thank you! allowing new devices for 5 minutes solved the issue.. silly me!

EscApe
Posts: 210
Joined: Thursday 02 April 2015 8:46
Target OS: Raspberry Pi
Domoticz version: v3+beta
Location: The Netherlands
Contact:

Re: Python plugin: Presence detection from wireless router

Post by EscApe » Wednesday 25 July 2018 14:34

Mwah... that kind of situation could be handled better by the plugin... Will keep it in mind for a future version.

Melotron
Posts: 50
Joined: Tuesday 22 November 2016 22:04
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python plugin: Presence detection from wireless router

Post by Melotron » Monday 13 August 2018 13:19

Hiya.

The plugin looks really good. But I'am having a problem with my router I think.
It looks as it have a problem on talking to the router.

Code: Select all

Domoticz V4.9857

2018-08-13 13:09:07.301 (Presence detection WIFI) Pushing 'onHeartbeatCallback' on to queue
2018-08-13 13:09:07.343 (Presence detection WIFI) Processing 'onHeartbeatCallback' message
2018-08-13 13:09:07.343 (Presence detection WIFI) Calling message handler 'onHeartbeat'.
2018-08-13 13:09:07.344 (Presence detection WIFI) devid2domid: {'phone1': 2, 'phone2': 3, 'phone3': 5, 'phone4': 4}
2018-08-13 13:09:07.344 (Presence detection WIFI) Checking router capabilities and wireless interfaces
2018-08-13 13:09:07.344 (Presence detection WIFI) Using ssh public key authentication (~/.ssh/id_rsa.pub) for OS user running domoticz.
2018-08-13 13:09:07.344 (Presence detection WIFI) Could not detemine the user profile running Domoticz
2018-08-13 13:09:07.344 (Presence detection WIFI) Fetching data from router using ssh
2018-08-13 13:09:07.344 (Presence detection WIFI) command: ['ssh', '-o', 'ConnectTimeout=2', 'root@192.168.1.1', '#!/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 $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(iwinfo $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 wlanconfig > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "wlanconfig@"\n\t\t\t\t\t\t\tfor iface in $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(wlanconfig $iface list > /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 brctl > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "brctl"\n\t\t\t\t\t\t\texit\n\t\t\t\t\tfi\t\t\t\t\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-08-13 13:09:07.344 Error: (Presence detection WIFI) No usable commandline to check presence. Trying again to detect router capabilities.
2018-08-13 13:09:07.344 Error: (Presence detection WIFI) SSH subprocess failed with error: 'module' object has no attribute 'run'
2018-08-13 13:09:07.345 Error: (Presence detection WIFI) Could not determine router capabilities
2018-08-13 13:09:16.982 (Presence detection WIFI) Pushing 'onStopCallback' on to queue
2018-08-13 13:09:16.982 Status: (Presence detection WIFI) Stop directive received.
2018-08-13 13:09:17.009 (Presence detection WIFI) Processing 'onStopCallback' message
2018-08-13 13:09:17.009 (Presence detection WIFI) Message handler 'onStop' not callable, ignored.
2018-08-13 13:09:17.576 (Presence detection WIFI) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE ALL
2018-08-13 13:09:17.576 (Presence detection WIFI) Not running on Windows
2018-08-13 13:09:17.577 (Presence detection WIFI) Monitoring {'phone1': 'C4:9F:4C:EE:F1:B7', 'phone2': '58:48:22:A1:8B:1C', 'phone4': 'C4:9F:4C:EF:E9:8A', 'phone3': '58:48:22:A4:4E:D2'} for presence.
2018-08-13 13:09:17.577 (Presence detection WIFI) Checking router capabilities and wireless interfaces
2018-08-13 13:09:17.577 (Presence detection WIFI) Using ssh public key authentication (~/.ssh/id_rsa.pub) for OS user running domoticz.
2018-08-13 13:09:17.577 (Presence detection WIFI) Fetching data from router using ssh
2018-08-13 13:09:17.577 (Presence detection WIFI) command: ['ssh', '-o', 'ConnectTimeout=2', 'root@192.168.1.1', '#!/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 $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(iwinfo $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 wlanconfig > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "wlanconfig@"\n\t\t\t\t\t\t\tfor iface in $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(wlanconfig $iface list > /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 brctl > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "brctl"\n\t\t\t\t\t\t\texit\n\t\t\t\t\tfi\t\t\t\t\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-08-13 13:09:17.577 (Presence detection WIFI) monitoring device: Presence detection WIFI - phone1
2018-08-13 13:09:17.577 (Presence detection WIFI) Presence detection WIFI - phone1 is stil in use
2018-08-13 13:09:17.577 (Presence detection WIFI) monitoring device: Presence detection WIFI - phone2
2018-08-13 13:09:17.578 (Presence detection WIFI) Presence detection WIFI - phone2 is stil in use
2018-08-13 13:09:17.578 (Presence detection WIFI) monitoring device: Presence detection WIFI - phone4
2018-08-13 13:09:17.578 (Presence detection WIFI) Presence detection WIFI - phone4 is stil in use
2018-08-13 13:09:17.578 (Presence detection WIFI) monitoring device: Presence detection WIFI - phone3
2018-08-13 13:09:17.578 (Presence detection WIFI) Presence detection WIFI - phone3 is stil in use
2018-08-13 13:09:17.578 (Presence detection WIFI) monitoring device: Presence detection WIFI - Override
2018-08-13 13:09:17.578 (Presence detection WIFI) devid2domid: {'phone1': 2, 'phone2': 3, 'phone3': 5, 'phone4': 4}
2018-08-13 13:09:17.578 (Presence detection WIFI) monitormacs: {'phone1': 'C4:9F:4C:EE:F1:B7', 'phone2': '58:48:22:A1:8B:1C', 'phone4': 'C4:9F:4C:EF:E9:8A', 'phone3': '58:48:22:A4:4E:D2'}
2018-08-13 13:09:17.578 (Presence detection WIFI) Pushing 'PollIntervalDirective' on to queue
2018-08-13 13:09:17.578 (Presence detection WIFI) Processing 'PollIntervalDirective' message
2018-08-13 13:09:17.578 (Presence detection WIFI) Heartbeat interval set to: 15.
2018-08-13 13:09:17.083 Status: (Presence detection WIFI) Stopping threads.
2018-08-13 13:09:17.303 Status: (Presence detection WIFI) Exiting work loop.
2018-08-13 13:09:17.303 Status: (Presence detection WIFI) Stopped.
2018-08-13 13:09:17.304 Status: (Presence detection WIFI) Started.
2018-08-13 13:09:17.567 Status: (Presence detection WIFI) Entering work loop.
2018-08-13 13:09:17.569 Status: (Presence detection WIFI) Initialized version 0.4.2, author 'ESCape'
2018-08-13 13:09:17.576 Error: (Presence detection WIFI) [ssh -V] will not run but is required! (error: 'module' object has no attribute 'run')
2018-08-13 13:09:17.576 Error: (Presence detection WIFI) [sshpass -V] will not run but is required! (error: 'module' object has no attribute 'run')
2018-08-13 13:09:17.577 Error: (Presence detection WIFI) SSH subprocess failed with error: 'module' object has no attribute 'run'
2018-08-13 13:09:17.577 Error: (Presence detection WIFI) Could not determine router capabilities
2018-08-13 13:09:27.080 (Presence detection WIFI) Pushing 'onHeartbeatCallback' on to queue
2018-08-13 13:09:27.092 (Presence detection WIFI) Processing 'onHeartbeatCallback' message
2018-08-13 13:09:27.093 (Presence detection WIFI) Calling message handler 'onHeartbeat'.
2018-08-13 13:09:27.093 (Presence detection WIFI) devid2domid: {'phone1': 2, 'phone2': 3, 'phone3': 5, 'phone4': 4}
2018-08-13 13:09:27.093 (Presence detection WIFI) Checking router capabilities and wireless interfaces
2018-08-13 13:09:27.093 (Presence detection WIFI) Using ssh public key authentication (~/.ssh/id_rsa.pub) for OS user running domoticz.
2018-08-13 13:09:27.093 (Presence detection WIFI) Could not detemine the user profile running Domoticz
2018-08-13 13:09:27.093 (Presence detection WIFI) Fetching data from router using ssh
2018-08-13 13:09:27.093 (Presence detection WIFI) command: ['ssh', '-o', 'ConnectTimeout=2', 'root@192.168.1.1', '#!/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 $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(iwinfo $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 wlanconfig > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "wlanconfig@"\n\t\t\t\t\t\t\tfor iface in $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(wlanconfig $iface list > /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 brctl > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "brctl"\n\t\t\t\t\t\t\texit\n\t\t\t\t\tfi\t\t\t\t\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-08-13 13:09:27.093 Error: (Presence detection WIFI) No usable commandline to check presence. Trying again to detect router capabilities.
2018-08-13 13:09:27.093 Error: (Presence detection WIFI) SSH subprocess failed with error: 'module' object has no attribute 'run'
2018-08-13 13:09:27.094 Error: (Presence detection WIFI) Could not determine router capabilities
2018-08-13 13:09:42.082 (Presence detection WIFI) Pushing 'onHeartbeatCallback' on to queue
2018-08-13 13:09:42.116 (Presence detection WIFI) Processing 'onHeartbeatCallback' message
2018-08-13 13:09:42.116 (Presence detection WIFI) Calling message handler 'onHeartbeat'.
2018-08-13 13:09:42.116 (Presence detection WIFI) devid2domid: {'phone1': 2, 'phone2': 3, 'phone3': 5, 'phone4': 4}
2018-08-13 13:09:42.116 (Presence detection WIFI) Checking router capabilities and wireless interfaces
2018-08-13 13:09:42.117 (Presence detection WIFI) Using ssh public key authentication (~/.ssh/id_rsa.pub) for OS user running domoticz.
2018-08-13 13:09:42.117 (Presence detection WIFI) Could not detemine the user profile running Domoticz
2018-08-13 13:09:42.117 (Presence detection WIFI) Fetching data from router using ssh
2018-08-13 13:09:42.117 (Presence detection WIFI) command: ['ssh', '-o', 'ConnectTimeout=2', 'root@192.168.1.1', '#!/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 $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(iwinfo $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 wlanconfig > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "wlanconfig@"\n\t\t\t\t\t\t\tfor iface in $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(wlanconfig $iface list > /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 brctl > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "brctl"\n\t\t\t\t\t\t\texit\n\t\t\t\t\tfi\t\t\t\t\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-08-13 13:09:42.116 Error: (Presence detection WIFI) No usable commandline to check presence. Trying again to detect router capabilities.
2018-08-13 13:09:42.117 Error: (Presence detection WIFI) SSH subprocess failed with error: 'module' object has no attribute 'run'
2018-08-13 13:09:42.117 Error: (Presence detection WIFI) Could not determine router capabilities
2018-08-13 13:09:57.085 (Presence detection WIFI) Pushing 'onHeartbeatCallback' on to queue
2018-08-13 13:09:57.091 (Presence detection WIFI) Processing 'onHeartbeatCallback' message
2018-08-13 13:09:57.091 (Presence detection WIFI) Calling message handler 'onHeartbeat'.
2018-08-13 13:09:57.091 (Presence detection WIFI) devid2domid: {'phone1': 2, 'phone2': 3, 'phone3': 5, 'phone4': 4}
2018-08-13 13:09:57.092 (Presence detection WIFI) Checking router capabilities and wireless interfaces
2018-08-13 13:09:57.092 (Presence detection WIFI) Using ssh public key authentication (~/.ssh/id_rsa.pub) for OS user running domoticz.
2018-08-13 13:09:57.092 (Presence detection WIFI) Could not detemine the user profile running Domoticz
2018-08-13 13:09:57.092 (Presence detection WIFI) Fetching data from router using ssh
2018-08-13 13:09:57.092 (Presence detection WIFI) command: ['ssh', '-o', 'ConnectTimeout=2', 'root@192.168.1.1', '#!/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 $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(iwinfo $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 wlanconfig > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "wlanconfig@"\n\t\t\t\t\t\t\tfor iface in $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(wlanconfig $iface list > /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 brctl > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "brctl"\n\t\t\t\t\t\t\texit\n\t\t\t\t\tfi\t\t\t\t\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-08-13 13:09:57.091 Error: (Presence detection WIFI) No usable commandline to check presence. Trying again to detect router capabilities.
2018-08-13 13:09:57.092 Error: (Presence detection WIFI) SSH subprocess failed with error: 'module' object has no attribute 'run'
2018-08-13 13:09:57.092 Error: (Presence detection WIFI) Could not determine router capabilities
2018-08-13 13:10:12.087 (Presence detection WIFI) Pushing 'onHeartbeatCallback' on to queue
2018-08-13 13:10:12.116 (Presence detection WIFI) Processing 'onHeartbeatCallback' message
2018-08-13 13:10:12.116 (Presence detection WIFI) Calling message handler 'onHeartbeat'.
2018-08-13 13:10:12.116 (Presence detection WIFI) devid2domid: {'phone1': 2, 'phone2': 3, 'phone3': 5, 'phone4': 4}
2018-08-13 13:10:12.116 (Presence detection WIFI) Checking router capabilities and wireless interfaces
2018-08-13 13:10:12.117 (Presence detection WIFI) Using ssh public key authentication (~/.ssh/id_rsa.pub) for OS user running domoticz.
2018-08-13 13:10:12.117 (Presence detection WIFI) Could not detemine the user profile running Domoticz
2018-08-13 13:10:12.117 (Presence detection WIFI) Fetching data from router using ssh
2018-08-13 13:10:12.117 (Presence detection WIFI) command: ['ssh', '-o', 'ConnectTimeout=2', 'root@192.168.1.1', '#!/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 $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(iwinfo $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 wlanconfig > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "wlanconfig@"\n\t\t\t\t\t\t\tfor iface in $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(wlanconfig $iface list > /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 brctl > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "brctl"\n\t\t\t\t\t\t\texit\n\t\t\t\t\tfi\t\t\t\t\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-08-13 13:10:12.116 Error: (Presence detection WIFI) No usable commandline to check presence. Trying again to detect router capabilities.
2018-08-13 13:10:12.117 Error: (Presence detection WIFI) SSH subprocess failed with error: 'module' object has no attribute 'run'
2018-08-13 13:10:12.117 Error: (Presence detection WIFI) Could not determine router capabilities
2018-08-13 13:10:27.090 (Presence detection WIFI) Pushing 'onHeartbeatCallback' on to queue
2018-08-13 13:10:27.139 (Presence detection WIFI) Processing 'onHeartbeatCallback' message
2018-08-13 13:10:27.139 (Presence detection WIFI) Calling message handler 'onHeartbeat'.
2018-08-13 13:10:27.140 (Presence detection WIFI) devid2domid: {'phone1': 2, 'phone2': 3, 'phone3': 5, 'phone4': 4}
2018-08-13 13:10:27.140 (Presence detection WIFI) Checking router capabilities and wireless interfaces
2018-08-13 13:10:27.140 (Presence detection WIFI) Pushing 'PollIntervalDirective' on to queue
2018-08-13 13:10:27.140 (Presence detection WIFI) Using ssh public key authentication (~/.ssh/id_rsa.pub) for OS user running domoticz.
2018-08-13 13:10:27.140 (Presence detection WIFI) Could not detemine the user profile running Domoticz
2018-08-13 13:10:27.140 (Presence detection WIFI) Fetching data from router using ssh
2018-08-13 13:10:27.140 (Presence detection WIFI) command: ['ssh', '-o', 'ConnectTimeout=2', 'root@192.168.1.1', '#!/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 $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(iwinfo $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 wlanconfig > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "wlanconfig@"\n\t\t\t\t\t\t\tfor iface in $(ifconfig | cut -d \' \' -f1| tr \':\' \'\n\' | grep \'^eth\\|^wlan\\|^ath\')\n\t\t\t\t\t\t\tdo\n\t\t\t\t\t\t\t\t\ttest=$(wlanconfig $iface list > /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 brctl > /dev/null 2>&1)\n\t\t\t\t\tif [ $? == 0 ]; then\n\t\t\t\t\t\t\tprintf "brctl"\n\t\t\t\t\t\t\texit\n\t\t\t\t\tfi\t\t\t\t\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-08-13 13:10:27.141 (Presence detection WIFI) Processing 'PollIntervalDirective' message
2018-08-13 13:10:27.141 (Presence detection WIFI) Heartbeat interval set to: 30.
2018-08-13 13:10:27.140 Error: (Presence detection WIFI) No usable commandline to check presence. Trying again to detect router capabilities.
2018-08-13 13:10:27.140 Error: (Presence detection WIFI) Temporarily limiting the polling frequency after encountering 5 (ssh) errors in a row.
2018-08-13 13:10:27.141 Error: (Presence detection WIFI) SSH subprocess failed with error: 'module' object has no attribute 'run'
2018-08-13 13:10:27.141 Error: (Presence detection WIFI) Could not determine router capabilities
2018-08-13 13:10:42.092 (Presence detection WIFI) Pushing 'onHeartbeatCallback' on to queue
2018-08-13 13:10:42.113 (Presence detection WIFI) Processing 'onHeartbeatCallback' message
2018-08-13 13:10:42.113 (Presence detection WIFI) Calling message handler 'onHeartbeat'.
2018-08-13 13:10:42.113 (Presence detection WIFI) Skipping heartbeat: 1
2018-08-13 13:11:12.097 (Presence detection WIFI) Pushing 'onHeartbeatCallback' on to queue
2018-08-13 13:11:12.108 (Presence detection WIFI) Processing 'onHeartbeatCallback' message
2018-08-13 13:11:12.108 (Presence detection WIFI) Calling message handler 'onHeartbeat'.
2018-08-13 13:11:12.109 (Presence detection WIFI) Skipping heartbeat: 2
2018-08-13 13:11:42.102 (Presence detection WIFI) Pushing 'onHeartbeatCallback' on to queue
2018-08-13 13:11:42.103 (Presence detection WIFI) Processing 'onHeartbeatCallback' message
2018-08-13 13:11:42.103 (Presence detection WIFI) Calling message handler 'onHeartbeat'.
2018-08-13 13:11:42.104 (Presence detection WIFI) Skipping heartbeat: 3
The router I have are a rt-ac68u runing AdvancedTomato.
Are the firmware supported, or should I switch to another one??

Regards Magnus Svensson

Post Reply

Who is online

Users browsing this forum: frenchyyii and 1 guest