Detecting when my phone is on the wifi

2,058 views
Skip to first unread message

Stephen Keep - RedConnect.io

unread,
Mar 19, 2016, 4:12:42 AM3/19/16
to Node-RED
Hi All,

So Im running a home project and have node-red on a pi. I want to trigger a flow when my android phone leaves and joins the wifi.

Has anyone done this?

Cheers

Steve

Mark Setrem

unread,
Mar 19, 2016, 4:36:56 AM3/19/16
to Node-RED

Stephen Keep - RedConnect.io

unread,
Mar 19, 2016, 4:52:57 AM3/19/16
to Node-RED
Perfect thanks Mark!

Timur Fatykhov

unread,
Mar 19, 2016, 1:33:58 PM3/19/16
to Node-RED
Ping method is good if your phone keeps WiFi on during sleep but issue could be to low battery/etc. I ended up using tasker for android which can send a POST to my node-red app. Currently playing with owntracks. (http://owntracks.org/) it talks to node-red via MQTT and HTTPS api should be available soon.  downside - you need to expose node-red in DMZ zone so security is important.
Works best for me.

Bart Ellast

unread,
Mar 20, 2016, 6:27:35 AM3/20/16
to Node-RED
I have also been playing around with using ping on smartphones to determine if anyone is at home.
But as timur said, i find it a bit too unreliable to use.

There are a lot of times the phone does not seem to connect to the wifi, or ditches it's connection.

Ben Hardill

unread,
Mar 20, 2016, 7:41:51 AM3/20/16
to Node-RED
I have a method using Bluetooth pings which works reasonably well. Bluetooth just needs to be on, not discoverable.

Details in the end of this blog post:  http://www.hardill.me.uk/wordpress/2010/02/25/how-to-get-a-txt-msg-from-your-burglar/

I've also done the WiFi thing, but modern versions of iOS and Android randomise MAC addresses when searching for APs (they do still use the right one when connecting).

http://www.hardill.me.uk/wordpress/2011/06/20/wifi-presence-detection/

&

http://www.hardill.me.uk/wordpress/2011/06/20/wifi-presence-detection/

Julian Knight

unread,
Mar 20, 2016, 8:13:11 AM3/20/16
to Node-RED
The lping method works with an iPhone but not with Windows Phone (Connection Refused). Also, the blog post I don't think tells you that you need to put the phones into discoverable mode before doing the hciscan.

But yes, that is otherwise a useful method as long as your server (a Pi in my case) is central enough in the building to pick up BT devices. I'm going to run some tests on that.
Reply all
Reply to author
Forward
0 new messages