EscApe wrote: ↑
Wednesday 26 September 2018 11:40
I suspect the timeouts (that are hardcoded into the plugin) are a bit short for your setup. The router might occasionally take too long to create the ssh session. Especially if it has a slow cpu or is running other tasks. A busy Domoticz host or sub optimal netwok would also slow things down. I also get some timeouts while i'm compiling Domoticz on my raspberry pi (the pi is just to busy). Using sshpass instead of key based might add some extra time, but i have never measured the difference, so i'm not sure.
Since you are forcing the arp method the 'detection' never fails because it doesn't need a ssh session to detect the capabilities. Your only concern would be the poll timeout(s).
You could experiment by increasing them a little in line 84 of the plugin:
Code: Select all
def getfromssh(self, host, user, passwd, routerscript, port=22, alltimeout=2, sshtimeout=2):
I kept the timeouts short to prevent the plugin from blocking the plugin framework and/or domoticz during the ssh sessions, which becomes more important if you use the plugin on multiple routers/accespoints. Maybe i'll make it a setting or calculated value (based on number of routers) in a future version, but it would be better to get these response times down in your setup.
The plugin is at its best if it can query wifi chipsets directly. Are you connecting to the EdgeRouter X? If possible you should try to connect to the accespoints instead. That would make the plying more responsive to arriving and leaving. I don't know if that is even possible on the unify's or if they support ssh.
I run it now for 24 hours and it look like it is working fine. I use an other system that also use ARP and running it next to each other the test how the plugin is doing. Until now your plugin is appropriable 30 sec quicker with detecting a phone then the older one so that look great and it respond much better.
Only problem i have with ARP based function that sometimes the phones goes offline/online for a short while.
This is one phone log with the plugin active and the other is the log of the same phone and with the old ARP system. So with your plugin it goes less Offline/Online but still not found a solution for it. Battery saving and Wifi is always active on the Android phone but i think it is a problem with Android to try the save battery and kill things.
So i will test with Grace period if i can set this longer to maybe fix the on/off situation for about 2 min
You mean to adjust alltimeout=2
. Is the time set per minute ?
Old ARP system
Code: Select all
2018-09-27 06:47:21 On
2018-09-27 06:45:29 Off
2018-09-27 06:20:06 On
2018-09-27 06:18:13 Off
Code: Select all
2018-09-27 07:52:20 Off
2018-09-27 06:47:28 On
2018-09-27 06:47:16 Off
2018-09-27 06:20:08 On
2018-09-27 06:19:56 Off
2018-09-27 05:44:25 On
2018-09-27 05:32:57 Off
2018-09-27 02:05:41 On
2018-09-27 02:04:35 Off
Unifi use a Unify Controller to control the AP and if you don't use that you need to use a App for phone/tablet
You can't login in directly to a AP but it is centralized with a DB running on my Raspberry. The edgerouter X have it's one Gui but there is also an UniFy secure Gateway which is a bit the same as the Edgerouter but that one is allso using the Unify Controller software. So you can change settings for everything with one piece of software.
But need more digging to see if what option there are for this but it is quit complex so the take a while
I can't switch the iDetect - Override
to On. When i click on it a pop-up said Switching On but it stays Off. Also nothing in the logfile
For testing I removed everything so plugin was gone in Hardware and noting left in Devices.
Add the plugin-in again
Still same problem