Nmap takes a long time to change NOT HOME / HOME

Hello again
i use nmap in my configuration.

  • platform: owntracks
  • platform: nmap_tracker
    hosts: 192.168.1.64-253
    track_new_devices: yes
    track: yes
    home_interval: 1

but i have a problem, when i am in the house the status is HOME, but if i disconnect wifi on my samsung galaxy…the status takes a long time to change a status.

why?

What is “a long time” to you? There will be a delay as your setup only has it checking every minute for an update. If its taking 15 minutes, there is another issue.

first, you are scanning almost all of your subnet so that takes a while. Also Nmap isn’t fast, even on fast scan. It works by identifying which ports are in use at each IP address. You could speed it up, but specifying the address of your phone. limiting it’s search range.
In your DNS server, you can probably setup reserved addresses by specifying the mac for your phone and the IP address it should get. This lets you keep your phone set for DHCP (which helps when you are at a coffee shop or work), but when home, you would always get the same local IP address.

I use HA netgear tracking and I find it unreliable (not fast trigger, sometimes no trigger at all) , I think nmap is same in term of reliability.

I was looking into ibeacon technology. Any recommendation?

Limit the number of devices you scan. Me for instance I scan only a maximum of 10 devices.

What I did was give these devices a fixed IP address in a specified range I scan with NMAP.

So I would suggest you do the same and change this

to this

platform: owntracks
platform: nmap_tracker
hosts: 192.168.1.240-250
track_new_devices: no
track: yes
home_interval: 1

AFTER you gave your devices a fixed IP in the 192.168.1.240-250 range.

since I know my exact IP’s mine looks like this.

  - platform: nmap_tracker
    home_interval: 10
    hosts: 
      - 192.168.2.120
      - 192.168.2.121
      - 192.168.2.122
      - 192.168.2.124
2 Likes

but my phone ip is 192.168.1.76.
how can i do?

In your home router, there is probably a table where you setup DHCP. It will be DHCP reserved addresses or something like that. You add your phone IP and Mac address to the list. Then everytime your phone comes home, and connects to your home wifi, it will get that address. So that way Nmap always knows that if it finds something on that address it must be you.

What type of router do you have?

1 Like

Go in your router and add a fixed IP (192.168.1.76) for the MAC address of your mobile phone in the static DHCP table.