nitaybz / homebridge-network-presence

Homebridge plugin that provides occupancy sensor for devices presence in your network
MIT License
41 stars 6 forks source link

No presence detected #13

Open kferrari opened 3 years ago

kferrari commented 3 years ago

Hi @nitaybz

I installed your plugin and it seems that on my network, none of the devices can be found. I can manually poll with arp -a in homebridge's web terminal and see all my devices (some appear after 20ish seconds, others immediately). I tried with different devices like RPis and MacBooks.

Here's my configuration:

{
    "debug": true,
    "interval": 10,
    "threshold": 15,
    "anyoneSensor": false,
    "addressRange": "192.168.178.0-192.168.178.250",
    "devices": [
        {
            "name": "M1",
            "ip": "192.168.178.45",
            "threshold": 10
        }
    ],
    "platform": "NetworkPresence"
}

The log also isn't hinting at a problem. Here's the relevant portion:

[01/02/2021, 08:17:36] [Config] Initializing config platform...
[01/02/2021, 08:17:36] [Config] Running in Service Mode
[01/02/2021, 08:17:36] [Hue] Initializing Hue platform...
[01/02/2021, 08:17:36] [Hue] homebridge-hue v0.12.21, node v14.15.4, homebridge v1.1.7
[01/02/2021, 08:17:36] [NetworkPresence] Initializing NetworkPresence platform...
[01/02/2021, 08:17:36] [RPi] Initializing RPi platform...
[01/02/2021, 08:17:36] [RPi] homebridge-rpi v1.2.8, node v14.15.4, homebridge v1.1.7, homebridge-lib v5.0.5
[01/02/2021, 08:17:36] [octoprint] Initializing octoprint platform...
[01/02/2021, 08:17:36] [SamsungTizen] Initializing SamsungTizen platform...
[01/02/2021, 08:17:36] [Camera FFmpeg] Initializing Camera-ffmpeg platform...
[01/02/2021, 08:17:36] [Camera FFmpeg] [MK3S] Configuring cached bridged accessory...
[01/02/2021, 08:17:36] [Camera FFmpeg] [Tevo] Configuring cached bridged accessory...
[01/02/2021, 08:17:36] [NetworkPresence] Found Cached Accessory: M1 (192.168.178.45) 
[01/02/2021, 08:17:36] [NetworkPresence] Initiating Network Scanner...
[01/02/2021, 08:17:36] [NetworkPresence] Adding "M1" Occupancy Sensor Service
[01/02/2021, 08:17:36] [NetworkPresence] [M1] - Listening to ip:192.168.178.45

[NetworkPresence] doesn't output anything more after that last line.

Here's the output from a manual arp -a run.

fritz.box2 (192.168.178.20) at e0:28:6d:xx:xx:xx [ether] on eth0
octopi-2.local (192.168.178.45) at dc:a6:32:xx:xx:xx [ether] on eth0
? (192.168.178.76) at b8:27:eb:xx:xx:xx [ether] on eth0
? (192.168.178.58) at 22:a6:2f:xx:xx:xx [ether] on eth0
? (192.168.178.54) at a4:30:7a:xx:xx:xx [ether] on eth0
Sonic-Screwdriver.local (192.168.178.22) at f8:87:f1:xx:xx:xx [ether] on eth0
octopi-2.local (192.168.178.47) at b8:27:eb:xx:xx:xx [ether] on eth0
Kims-MacBook-Pro-288.local (192.168.178.75) at 74:8f:3c:xx:xx:xx [ether] on eth0
pihole (192.168.178.33) at b8:27:eb:xx:xx:xx [ether] on eth0
? (192.168.178.77) at 00:9d:6b:xx:xx:xx [ether] on eth0
? (192.168.178.61) at 22:db:ac:xx:xx:xx [ether] on eth0
fritz.box (192.168.178.1) at 98:9b:cb:xx:xx:xx [ether] on eth0
? (192.168.178.202) at 98:9b:cb:xx:xx:xx[ether] on eth0
? (192.168.178.201) at 98:9b:cb:xx:xx:xx [ether] on eth0
Philips-hue.local (192.168.178.27) at 00:17:88:xx:xx:xx [ether] on eth0
iPad-von-Kim-Ferrari.local (192.168.178.30) at cc:c7:60:xx:xx:xx [ether] on eth0
? (192.168.178.154) at 32:3a:fd:xx:xx:xx [ether] on eth0
? (192.168.178.66) at f2:6d:6b:xx:xx:xx [ether] on eth0
tevoprint.local (192.168.178.56) at b8:27:eb:xx:xx:xx [ether] on eth0
pihole.local (192.168.178.50) at b8:27:eb:xx:xx:xx [ether] on eth0
homebridge@homebridge:/var/lib/homebridge $ 

Thanks a lot for a promising plugin. Any help would be greatly appreciated. Please let me know if there's anything I can provide you with in addition.

nitaybz commented 3 years ago

Can you try to remove the ip range?

kferrari commented 3 years ago

Woah, thanks for the swift answer! I tried, with no effect. All output and behaviour is the same.

nitaybz commented 3 years ago

can you give more details on your homebridge installation? what device? homebridge version? node version?

kferrari commented 3 years ago

It's running on a Raspberry Pi 3B+ Rev 1.3 on raspbian buster

nitaybz commented 3 years ago

What about network conditions? Do you have multiple subnets?

kferrari commented 3 years ago

I'm using two Fritz!Boxes and two Fritz! Repeaters which act in mesh mode. I also tried discovering the repeater to which the homebridge RPi is plugged in. I tried discovery by MAC and hostname, with no success either. Just for fun, I rolled back to homebridge-network-presence v1.1.2, also same behaviour.

nitaybz commented 3 years ago

indeed weird behavior... I'm planning to add more logs to help me debug those issues. and as a feature, I'll make a ping only mode so it will skip the arp process for better compatibility. I just need some time :)

kferrari commented 3 years ago

Sure, thanks a lot! Just drop me a comment here, once I should try something out. I'll keep you posted in case something changes. Thanks

sadiq81 commented 3 years ago

I have the same problem, only working if I remove the addressRange but that makes my network unresponsive.

Lazyass0 commented 3 years ago

Same problem only working wit addressRange empty tried both range and subnet variant and also single IP and not working either way.