# Identify people by mobile phone

**URL:** <https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195>\
**Category:** General\
**Created:** [22 October 2018 18:58 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195 "2018-10-22T18:58:01Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [23 October 2018 22:02 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/21 "2018-10-23T22:02:10Z")

</div>

The best one i have found if Life360 - there is a Home Assistant module for it and it leaves owntracks for dead.

Craig

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 October 2018 22:14 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/22 "2018-10-23T22:14:33Z")

</div>

> [@craigcurtin](#):
>
> Life360

Yes, used that for a bit with the kids phones when they were younger.

---

<div class="post-metadata">

**Author:** ![nodecentral](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nodecentral/32/10432_2.png) [@nodecentral](https://discourse.nodered.org/u/nodecentral)\
**Post date:** [24 October 2018 08:36 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/23 "2018-10-24T08:36:10Z")

</div>

> [@craigcurtin](#):
>
> You can sprinkle as many Rpi Zero W (less than $10) around as you need to get blanket coverage and they talk to each other.
> 
> It is quite a complex bash script he has written that does lots of checking and handoffs etc to enable presence and location detection

Sounds like a cool set up..

Thinking about it some more - as my house was flood wired with cat 6 and network ports, during a major renovation - it would be cool if there was a POE Bluetooth module that I could plug in to ports in each room, and have it report back in the device ID and signal strength of any devices seen for Node Red to monitor and report on it.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [24 October 2018 11:09 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/24 "2018-10-24T11:09:32Z")

</div>

> [@nodecentral](#):
>
> POE Bluetooth module

Try this with a Pi Zero W:

> **[Micro-USB PoE injector + splitter cable set (passive PoE) for Raspberry Pi :...](https://www.amazon.co.uk/Raspberry-micro-USB-injector-splitter-passive/dp/B00T68D7S4)**
>
> Power your Raspberry Pi - or any micro-USB powered device - over ethernet with this passive\* PoE injector/splitter cable set. Just hook up your power source and ethernet (LAN/WAN) to the injector cable and plug the splitter cable into your device's...

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [24 October 2018 11:32 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/25 "2018-10-24T11:32:19Z")

</div>

> [@craigcurtin](#):
>
> I was reading on the Home Assistant Forum the other day about a new module someone over there has released that solves a lot of the Presence/Away options with detection using BLE and mobiles.
> 
> Interestingly he has written the whole thing as a bash script that will run on as little as a Pi Zero W - you might want to check it out as it could be good inspiration or maybe just something to call through an exec node
> 
> [[monitor] Reliable, Multi-User, Distributed Bluetooth Occupancy/Presence Detection - Share your Projects! - Home Assistant Community](https://community.home-assistant.io/t/monitor-reliable-multi-user-distributed-bt-occupancy-presence-detection/68505)
> 
> Craig

The above script is based on BT (bluetooth) but doesn't this require that bluetooth should always be switched on on all the mobile phone(s) you want to detect ?

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [24 October 2018 17:23 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/26 "2018-10-24T17:23:06Z")

</div>

> [@janvda](#):
>
> but doesn't this require that bluetooth should always be switched on on all the mobile phone(s) you want to detect ?

Of course

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [24 October 2018 17:37 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/27 "2018-10-24T17:37:04Z")

</div>

I don't feel I trust this Monitor script (yet)

I did install it and built a simple NR flow subscribing to the topics of interest. I put my iPhone BT mac into the configuration and did also the remaining configuration as required. Fine, I could see that my phone was detected correctly, Turning BT off, it disappeared after a departure scanning round, with confidence dropping in steps until zero. Turning BT on again, the phone appeared again.

So far so good, but....

I was away from home today, from 9:40 am until 3:30 pm. When I looked into the debug log, I saw that my phone had been detected a couple of times with confidence higher then zero. The script believed I was home around 11:00 am !!!!

I will let the thing run it's test a bit longer to see 🧐 if this shows up again or if it was just a glitch in the machinery

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [25 October 2018 00:11 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/28 "2018-10-25T00:11:32Z")

</div>

Head on over to the HA forum and post your findings over there - the guy is super responsive and will be able to look at the logs and give you an idea (or work out what happened)

Craig

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [25 October 2018 04:22 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/29 "2018-10-25T04:22:03Z")

</div>

Yes, sure, if I find it worth the effort. First I will evaluate if it could be of interest as a "subsystem" to NR and if this would be the "magic way" to solve a popular & interesting task.

What I use today is Owntracks and a long range iBeacon and it is "kind of reliable"

---

<div class="post-metadata">

**Author:** ![igrowing](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/igrowing/32/663_2.png) [@igrowing](https://discourse.nodered.org/u/igrowing)\
**Post date:** [27 October 2018 12:31 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/30 "2018-10-27T12:31:11Z")

</div>

Hi guys,

Thanks everyone for interest in the topic. Special thanks for constructive comments and references:

- About use of BT, NFC, buttons, ARP, etc. for human presence detection.
- About tradeoff of mixing all the methods, stability and usability of results.

In between, I published [Human presence detector flow](https://flows.nodered.org/flow/06f2eabb78d608153da5dccb9a2a6912) which uses external python script.

The python script uses nmap and ping in dependency of need and accordingly to tradeoffs. Nmap abuses the network. Dedicated often ping abuse the mobile phone battery. Nothing is perfect. Trying to find a golden ratio.  
This works for me whole day long 🙂 yeah, not that long.

Your opinion for improvement and weak points is appreciated.  
For instant: adding users MAC manually in CSV is not very handy, needs usability improvement.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [27 October 2018 16:31 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/31 "2018-10-27T16:31:08Z")

</div>

Hi Igor,  
I've setup the Python script, Node-RED etc.. but don't seem to get anything arriving via MQTT although it says it'sconnected. ![ScreenShot015](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/bcd309782e563e779a63c170c9f5c6c180a85c62.png)

 ![ScreenShot016](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/8921d66d40c25358ab3719844e8d233cdfdb511e.png)

---

<div class="post-metadata">

**Author:** ![igrowing](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/igrowing/32/663_2.png) [@igrowing](https://discourse.nodered.org/u/igrowing)\
**Post date:** [27 October 2018 18:25 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/32 "2018-10-27T18:25:45Z")

</div>

Hi David,

I'm checking if it can be "unmatching case" problem in my code.  
Could you meanwhile please do following:

1. Replace in the csv file the MAC with upper case symbols.
2. Remove inject and function node before the daemon node.

I'll get back soon with results of my check.  
Thank you.

UPDATE: to be on the safe side, I updated the ptracker.py to version 0.4 when the MACs are processed inside as upper case. Please, download it: [https://github.com/igrowing/RaspberryPi/blob/master/ptracker.py](https://github.com/igrowing/RaspberryPi/blob/master/ptracker.py)

Please, confirm, your mosquitto broker is up (you can subscribe to it, receive and publish messages) on the same Raspberry Pi where prtacker runs. My fault - i didn't state this item as prerequisite too.

Please, confirm, the topic of MQTT node in the flow is not changed `shm/rpi/presence/` and broker is set to `localhost:1883`.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [27 October 2018 19:20 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/33 "2018-10-27T19:20:43Z")

</div>

![ScreenShot019](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4de3cdb575c9a83b15d853052213cd5e2f367f68.png) ![ScreenShot020](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d32eeb940d72b093cbdab60533cf8a35e3a2a09f.png)

 ![ScreenShot017](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/9/99d9fc6e53e28c07e1479540a5ff8da5415fbef5.png)

Implemented those changes - still get the same message.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [27 October 2018 19:28 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/34 "2018-10-27T19:28:42Z")

</div>

![ScreenShot021](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/abdd86c95a92868cba983e7417274784aaa4cf91.png)

Oops - only just spotted yr message about v0.4 which I've done

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [27 October 2018 23:03 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/36 "2018-10-27T23:03:18Z")

</div>

Not sure why/what you see the benefits of Wireless over BT ? BT LE (4.0 and above) have far less power draw on each device, have a far shorter range (and hence can give localised presence in a smaller geographical area) and i also understand that Iphones turn off their wireless when you put them into sleep mode in the evening etc ?

I have personally been playing around with the Bash script from the HA forum that i linked to earlier for the last week or so and it is pretty much rock solid - have not found a false positive yet.

Craig

---

<div class="post-metadata">

**Author:** ![igrowing](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/igrowing/32/663_2.png) [@igrowing](https://discourse.nodered.org/u/igrowing)\
**Post date:** [28 October 2018 07:44 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/37 "2018-10-28T07:44:33Z")

</div>

> [@craigcurtin](#):
>
> BT LE (4.0 and above) have ...a far shorter range (and hence can give localised presence in a smaller geographical area) and i also understand that Iphones turn off their wireless when you put them into sleep mode in the evening

That's the exact point why not, Craig 🙂  
My goal is not precise detection of user location. I just want my home to be aware of my proximity.  
In addition, precise detection with BT requires BT transceiver with good distribution. That means many small appliances to add to existing infrastructure and maintain them. That's extra cost and extra waste time.

As well, no one in my surroundings whom I want to see in my house (especially at night!) has iphone 🙂

---

<div class="post-metadata">

**Author:** ![igrowing](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/igrowing/32/663_2.png) [@igrowing](https://discourse.nodered.org/u/igrowing)\
**Post date:** [28 October 2018 07:53 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/38 "2018-10-28T07:53:58Z")

</div>

Hi David,

For debug purposes I disable autostart and restart of daemon node, kill the ptracker in the shell and run it manually in foreground.  
This allows me to see all prints and understand a little what happens.

For deeper debug,

- try to ping your phone from the RaspberryPi. Does it respond?
- `arp -a` - does it show the same MAC you've registered in the CSV? Does IP match the ping adress above?
- `sudo nmap -sn yournet/mask` (example `sudo nmap -sn 192.168.1.0/24`). Do you see your phone responding? Is MAC correct?
- `ifconfig -a | grep -B1 "inet "` - please, post your network details. I might have some wrong assumptions about network.

Thank you!

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [28 October 2018 09:55 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/39 "2018-10-28T09:55:39Z")

</div>

Hi,  
Results are attached.

Pinging to my phone only works when the phone is unlocked, otherwise the  
ping command just waits.

I haven't got 'nmap' installed on this particular RPi (I'll do it later).

Hope this is helpful

Regards, David

![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b53dbc44a688aa081c07f39876f100f07d0c1984.png)

 ![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/2/2f3ccf0c93e1b4841a1865af4d402b325059454e.png)

![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/ed6db3f2aeb1d32e32b4ea19148c17ad8141943c.png)

---

<div class="post-metadata">

**Author:** ![igrowing](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/igrowing/32/663_2.png) [@igrowing](https://discourse.nodered.org/u/igrowing)\
**Post date:** [28 October 2018 13:47 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/40 "2018-10-28T13:47:51Z")

</div>

Hi David,

Yes, this helps.

ptracker uses nmap for correlation between MAC and IP. Please, run `sudo apt-get install nmap` before use of ptracker.py. I added this instruction to the flow description too.

As well, I Improved error detection and verbosity in the script itself version ptracker.py 0.5.

Indeed, not responding to ping while sleep might be problem of presence detection. I think this is tweakable/configurable in battery-saving related setting of the handset. For Samsung, Sony and ...tada... Oukitel I didn't encounter this problem.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [28 October 2018 14:49 UTC](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195/41 "2018-10-28T14:49:20Z")

</div>

Hi,  
Tried the things you suggested as well as installing nmap.

'nmap' finds my Android phone.

As per attached listing - still do not get any thing via MQTT in.

Cheers from David.

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex026/uploads/nodered/original/2X/c/cb19680f9b18b5d7663463095caeedd6cc68806c.png)

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex026/uploads/nodered/original/2X/5/576debcd9b54b3c131ac19a09ebe7e0a700f2f24.png)

[Previous page](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195.md?page=1)

[Next page](https://discourse.nodered.org/t/identify-people-by-mobile-phone/4195.md?page=3)
