Wget dhcp leases
-
I'm trying to write a script in raspbian to connect to my pfsense to check to see a device is online or not but I'm not sure how to go about it since the device has a static IP and always shows up in dhcp leases. Anyone have any tips?
-
Why are you trying to check another device's status via pfSense? Talk with the device itself, not with the pfSense box.
-
Pinging my phone results in unreachable destination, and even if I were able to ping it, it'd take it out of sleep mode and drain the battery because I'd be pinging it every minute or so.
-
Getting the leases file doesn't indicate that the device is active.
Just that it a asked for a DHCP lease at the moment mentioned in the file. -
I'm just trying to write a script to stop my security camera from recording movement when I'm home, and currently the lease time is 2 hours but I could make it less.
-
"I'm just trying to write a script to stop my security camera from recording movement when I'm home"
Should you be able to do that from the camera software? You could prob do it with the APP if this than that.. Prob hooks to your camera software, etc. You can have it do stuff like open your garage when get close to your house.. Would think it could do something with your camera's etc..
-
No it's just a rasberry pi with a camera, no advanced settings like that unless you make them yourself.
-
Well ok.. Can you setup your pi to check for an email And if there is a email turn off the camera or if there is an email turn on the camera? Like I was saying the IFTTT app has some real power to it. You can setup geo location events. So for example your phone enters geofence around your home do X.. When leaves does Y, so you could then have your pi check for these things and either turn on the camera or turn off the camera motion detection, etc.
http://www.howtogeek.com/221555/how-to-create-geographic-event-triggers-with-your-smartphone-and-ifttt/
Take a look at the maker channel. https://ifttt.com/maker
Should be simple enough to have a geofense setup for your home, and then if you leave or enter talk to your pi and tell it camera or not to camera, etc. This might give you an idea to get you started
http://www.makeuseof.com/tag/ifttt-connect-anything-maker-channel/ -
Looks promising, thanks!
-
You can also do stuff when it joins a specific wifi network.. So for example when you get home and your phone joins your network, the IFTTT app could do something that turns off your camera, etc.
There are always multiple ways to skin the cat ;) Sometimes people get 1 method in their heads and get stuck doing it only that way..
Which is why its always a good idea to give the details of what your actually trying to accomplish as the end goal, so that other methods of skinning that cat can be explored..