0

I have a question about devices in standby-mode on my Wi-Fi network. My configuration consists of a Fritzbox3490 and a Raspberry-PI3. In my Fritzbox connection menu (fritz.box) i can see passive devices (overall 14) like my smartphone in stand-by, my PI on the other hand is not able to show me passive devices (only 10). I tried many programs like ARP-Scan, netdiscover..., but these programs only showed me the active devices. I also tried the fritzconnection api, but it did not work for me. I must admit that I am new in networking. Is there a way to get the passive devices on the console or in a python script, which are connected the fritzbox?

  • Do you mean you tried "fritzwlan.py"? It looks like it's supposed to do what you want. "It did not work" is not very specific :-), although I personally might not be able to help even if I saw the details. – sourcejedi May 23 at 22:15
  • Not sure about your Fritzbox, but my Fritzbox remembers devices that have connected to it in the past, and also shows these devices in the UI. Could that be what you are seeing? If a device is not using WLAN, there is no way to identify it (other than remembering it from a time where it was using WLAN). – dirkt May 24 at 9:17
  • When i run python fritzwlan.py i get the error: "fritzconnection.ActionError: Unknown Action: GetTotalAssociation". The Problem is, that in the service WANIPConnection, there is no action; GetTotalAssociation – Heinz R May 24 at 10:54
  • If i try another action whitch is in the listed actions like GetExternalIPAdress, i get other errors like Unknown Action: GetGerericAssociateddeviceInfo. The Problem is, that this package was last updated Jul 2017 – Heinz R May 24 at 11:43
  • 2
    Fritzhosts.py works for me. Thank you very much. – Heinz R May 24 at 12:12
0

I dunno.

We had a very similar-sounding problem trying to ping a phone. We were trying to set up a "treasure hunt" puzzle. It did not work as we hoped, because phones go to sleep after a while to save power.

[My discontinued phone] seems to have several "modes". I get 50-100ms [ping reponses to start with]. Later, I get alternately 1000ms and 10ms, and 10% loss.

Just tapping the lock button gets it back to the first mode. Takes somewhere like 30s to enter the second mode.

You’re a genius! Lock iPhone and 30-60s later it stops responding to pings completely. Press the lock button again to wake it up and it immediately begins responding again.

If it doesn't respond to multiple ARP probes, I would have said it was completely asleep. No ARP = no TCP/IP.

And yet. Here's the puzzle. Do the devices provide any "push notifications", e.g. immediate notifications of emails chat messages? That's got to be relying on TCP/IP.

The default settings for the Linux kernel will expire & remove old ARP entries after ten minutes or less. After that expiry, the Linux-based router would be unable to forward the push notifications.

To explain these results, the sleeping phone would have to be deliberately ignoring ARP requests unless they are from the router. That's not impossible, I'm just surprised that it would be considered necessary! I guess it might be done to cut off some chatty local network discovery protocol that the phone could have been using when active, such as uPNP?

EDIT: I suspect you can't find any code like this when you look in the Android Linux kernel itself. The specific behaviour may be determined by ARP offload code in the Wi-Fi device firmware.

To test this behaviour, you would

  1. set up a Linux device, to work as a Wireless Access Point and router
  2. run a packet sniffer on the Linux device's Wi-Fi interface
  3. connect a phone to it
  4. wait for the phone to go to sleep & stop responding to probes
  5. wait for the ARP entry to expire on the Linux device
  6. send the phone an email message using a chat app.

By default, your Android device turns off the Wi-Fi module during off-peak hours when the device is not being used, and this is a part of the Doze Mode.

-- a third-party non-technical article: https://www.theandroidsoul.com/how-to-fix-delayed-notifications-problem-on-android/

https://developer.android.com/training/monitoring-device-state/doze-standby

https://firebase.google.com/docs/cloud-messaging/concept-options#setting-the-priority-of-a-message

Normal priority messages are delivered immediately when the app is in the foreground. When the device is in Doze, delivery may be delayed to conserve battery. For less time-sensitive messages, such as notifications of new email ... choose normal delivery priority.

FCM attempts to deliver high priority messages immediately, allowing the FCM service to wake a sleeping device when necessary and to run some limited processing (including very limited network access).

Also, if the phone has no chat apps installed & enabled, only "low priority" notifications like email, then maybe it will only poll periodically, and the rest of the time maybe it does not respond even to ARP.

  • Thank you very much for the detailed answer. I will try this tomorrow – Heinz R May 23 at 21:49
  • @HeinzR To be honest, it is more of a followup question, I am not sure whether it will answer your own question :-). I don't know if you have the necessary equipment. E.g. not all laptops have Wi-Fi that can create an access point. I think it's possible to buy USB Wi-Fi that can though. – sourcejedi May 23 at 21:54
  • But I like the idea. Its a complete diffrent way, so i will try i out – Heinz R May 23 at 22:04
  • The idea was nice, but i don´t want to get every second a push notification to my smartphone. I want to display a list of known IP adresses in my local network, so i must know if a device is no longer in range. – Heinz R May 24 at 10:58
  • @HeinzR you misunderstand. I claim that if the phone did not respond to ARP requests from the router, then it would not be able to receive immediate push notifications. But, although I do not use smartphones, I hypothesize they can receive push notifications nearly immediately. I may be wrong! If all my assumptions are correct, then it is possible for a router to find passive devices by sending ARP probes for every IPv4 address within the subnet. My own question is - if the router could do this, why don't your ARP scans work? – sourcejedi May 24 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.