Is Connected

Questions and comments specific to a particular plugin should go here.

Is Connected

Postby kgschlosser » Thu Jun 15, 2017 9:44 pm

Is Connected Plugin

This is a variant of the ping plugin. It is completely self contained and does not start a separate process to ping the network device.
This plugin does not have any of the issues the Ping plugin has (processes getting stuck, mouse lag)

There are 4 actions:
Add Device
Remove Device
Start Monitoring
Stop Monitoring

they are pretty self explanatory based on the names.

Once a device has been added it does not have to be added again unless you remove it or delete the plugin. The monitoring of a device once it has been added will automatically start being monitored when the plugin starts

in the host field when creating a device you can enter one of the following IP address, host name or netbios name (computer name) it will automatically sort out the rest
if either the host name or netbios name was used in the host filed then the plugin will dynamically change if the devices IP address does. so no need to restart EG or the plugin or have to make any configuration changes.


simply double click to install

Have fun
K
Attachments
IsConnected-0.2b.egplugin
(5.42 KiB) Downloaded 49 times
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Is Connected

Postby george tirebuyer » Fri Jun 16, 2017 5:29 am

22:24:50 Is Connected: Monitoring Started: Name: Vizio, IP Address: 192.168.1.104 MAC Address: 00:00:00:00:00:00
This doesn't seem to get the MAC address and doesn't log the status change. Is this working in 0.4.1 or does it need the beta?
george tirebuyer
 
Posts: 34
Joined: Sun Apr 28, 2013 12:25 pm

Re: Is Connected

Postby kgschlosser » Fri Jun 16, 2017 6:43 am

is the TV on?
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Is Connected

Postby Snowbird » Fri Jun 16, 2017 6:57 am

it works fine for me with 0.5 RC2, great plugin !! I could find a use for it !

If someday you can come up with a bluetooth plugin that actually works, you would make many persons happy ! :) something that detects when I arrive or leave home (detecting the presence of my phone's Bluetooth). There are many topics about this on this forum and many others, but I've never found something that actually works. Here's a new challenge for you ! ;)

Thank you Kevin !! Always creating things, helping out people, you're impressing me and I think I'm not the only one being impressed !
Snowbird
Experienced User
 
Posts: 115
Joined: Fri Jul 03, 2009 10:04 am

Re: Is Connected

Postby kgschlosser » Fri Jun 16, 2017 7:33 am

you have the mechanism in your hand right now. and it has a much farther reach then the 35 foot cap on BT

WIFI baby!

turn on the wifi on your phone. set the IP to static. and key that ip into this plugin. when the wifi connects then it will trigger an event in EG that the device connected (meaning you got home) and when you leave it will disconnect (meaning you left home)

the one thing you will have to do is you will have to make sure the wifi stays active even when the phone sleeps. and of course all of this depends on how good the phone and the AP play with each other. because if you get random drops then it will trigger the event that you left...

But see I am a smart guy tho.. I have included a way to smooth this issue. usually the phone will drop for mayve 30 seconds or so then reconnect... if you set the timeout for the device to be slightly greater then the drop period then it won't register that it disconnected to EG.

the interval is the length of time between checking if the device is connected and the timeout is how long it should run the check for if it doesn't see the device on the network.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Is Connected

Postby kgschlosser » Fri Jun 16, 2017 7:40 am

I also posted a tutorial (if you have an android phone) on an application that uses geofencing and will tell EG to trigger an event if you leave or enter a virtual fence that you make around your home. and you can make more then one fence too. I have 3. one to turn the heat up/down in the winter 3000 meters away from my home is the fence. one at 300 if i enter the fence if it is dark out it will turn the outside lights on and if my wife isn't home it will turn on the inside ones as well. and one at 1000 if i am leaving will shutdown the house if the wife is not home.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Is Connected

Postby george tirebuyer » Fri Jun 16, 2017 12:35 pm

05:30:45 Is Connected: Add Device: Client Name: LGG$ IP: 192.168.1.106 Interval: 5 Timeout: 0.25
05:30:45 Is Connected: Monitoring Started: Name: LGG$, IP Address: 192.168.1.106 MAC Address: 00:00:00:00:00:00
05:30:45 IsConnected.LGG$.Connected '2.00 ms'
This is all that happens whether the phone is on wifi or not. Changes don't show up in the log. I switched back to RC2 but got the same behavior on 0.4. What am I doing wrong? and what's up with the MAC address?
george tirebuyer
 
Posts: 34
Joined: Sun Apr 28, 2013 12:25 pm

Re: Is Connected

Postby kgschlosser » Fri Jun 16, 2017 4:26 pm

not sure why it's reporting back like that
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Is Connected

Postby kgschlosser » Fri Jun 16, 2017 8:13 pm

@ george tirebuyer

OK i can replicate the problem. so it's not you LOL... I have to try and figure out a way around it without the use of ping But i can't create an ICMP packet and send it off without a raw socket.. and you are not allowed to get a raw socket unless you are administrator. so that is out. So i am trying to think of what i can use packet wise to get back a response from the device that is not a ping. if anyone else has any ideas I am all for it. But i guess I could somply connect to the thing on port 80. and if it refuses it then i know it available. and if it connects then i know it is there.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Is Connected

Postby kgschlosser » Sat Jun 17, 2017 1:50 am

ok so new version is attached to the first post. I think I have it sorted. now i removed the payload indicating the ms in response time. this is due to the length of time it takes to set the socket up and what have you. so the data was coming back skewed. so i simply omitted it.

now i used a different means to check if the device is attached. but i left the MAC in there as informational. if you get all 00's do not be alarmed this simply means it could not obtain the mac address form the device.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Is Connected

Postby kgschlosser » Sat Jun 17, 2017 5:47 am

I see the new version has been downloaded a couple of times. Does it work?? are there any problems?
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Is Connected

Postby george tirebuyer » Sat Jun 17, 2017 8:47 am

No errors just not functioning. Same as before.
george tirebuyer
 
Posts: 34
Joined: Sun Apr 28, 2013 12:25 pm

Re: Is Connected

Postby kgschlosser » Sat Jun 17, 2017 4:38 pm

ok do this as a setup. set your phone to a static IP address and then enter that address in the plugin. set the duration to 5 and the timeout to 1 then turn on and off the wifi. wait a full 5 seconds between turning it on or off. you should gets events for the device being connected (wifi on) and disconnected (wifi off)
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Is Connected

Postby Snowbird » Mon Jun 19, 2017 1:55 pm

when the wifi connects then it will trigger an event in EG that the device connected (meaning you got home) and when you leave it will disconnect (meaning you left home)

This is theory, it works yes, but it's not in real time or close to real time, just because of the phone being in doze mode, it could wake up by coincidence exactly when I arrive home, but with less luck it could take up to 2 or 3 minutes, so this won't be very useful if you're looking for something close to real time, more information about doze mode :
https://developer.android.com/training/ ... andby.html

the one thing you will have to do is you will have to make sure the wifi stays active even when the phone sleeps. and of course all of this depends on how good the phone and the AP play with each other. because if you get random drops then it will trigger the event that you left...

That's the main problem, it's not something very reliable, everything is only assumption and too many conditions are necessary to make this work the right way! Again, I would say yes it should work but you can't really count on it if you're looking for something very close to real time.

But see I am a smart guy tho..

I have absolutely no doubt about this ! :)

I have included a way to smooth this issue. usually the phone will drop for mayve 30 seconds or so then reconnect... if you set the timeout for the device to be slightly greater then the drop period then it won't register that it disconnected to EG.

the interval is the length of time between checking if the device is connected and the timeout is how long it should run the check for if it doesn't see the device on the network.

Yes, that's very clever, once adjusted it should work but unfortunately not in real time...

The main advantage of Bluetooth over Wifi, is that it's always active even when the phone is in sleep mode, just because Bluetooth battery consumption is very low compared to wifi, I agree with you about the bluetooth coverage, it is indeed very little compared to wifi, but in most case it should be more than enough for those living in an apartment or a regular size house. And I can also mention that lately the BT coverage has been improved compared to few years ago.

If I didn't convince you with my argumentation, just give it a try yourself, you will see that in everyday use it's not very reliable. I have tried many other EG plugins with no real success, one that is called "Ping", and also another one called "NMAP" (created by Pako ;) ), they both work but they are not very reliable when we have to deal with the phone's sleep mode... I've done many research about "bluetooth ping" programs but most are for Linux, or some of them are scripts that needs to be adapted, unfortunately I don't have enough knowledge to make this work, that's why I was kindly asking you about a bluetooth plugin.

Anyway, I'm not criticizing at all your great plugin! I'm sure others will find it very useful (even me :) ). I'm just saying that it may not suit everyone's need when it comes to detect precisely when someone arrives/leaves home.
Snowbird
Experienced User
 
Posts: 115
Joined: Fri Jul 03, 2009 10:04 am

Re: Is Connected

Postby kgschlosser » Mon Jun 19, 2017 4:22 pm

ok i am going to give you exactly what you want. did you go and read that tutorial about the geofencing?

well the author of it has a beta version out that does just what you want. it uses BT transmissions as a beacon where you can set your location relative to it. and there is a plugin for his application that will send the entering or leaving events to EventGhost. you have to register for the beta to be able to use it. but it's an easy process. you would have to click on the help for his app and it will bring you to a forum and his website where there is more information about the beta version.


it's called EgiGeozoneBT
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2715
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Next

Return to Plugin Support

Who is online

Users browsing this forum: No registered users and 5 guests