Cant ping Android device

15,182

Solution 1

Did you check the sleep policy of android phone. To save battery android may put your device to sleep.

Settings > Wireless & Network Setting > Wifi Settings > Press Menu button > Advanced > Wifi sleep policy , Set to Never.

Still if you're not able to ping, then in the android kernel (OS) iptables rules may be set to block the icmp packets. What is the android OS you're using ?

You can try nmap.

sudo nmap -sP 192.168.1.0/24 or sudo nmap -sP 10.0.0.1/24

Solution 2

As a first step check the IP addresses of the PI + S8 to see if they are both in the same subnet and connected properly.

The main problem might be that the ping application isn't available on android devices (at least i think so).

To fix this check the android store for PingTools Network Utilities and install the app on your smartphone.

Afterwards try pinging from your S8 to the pi.

Share:
15,182
Kevin Duarte
Author by

Kevin Duarte

Updated on June 19, 2022

Comments

  • Kevin Duarte
    Kevin Duarte almost 2 years

    I am trying to ping my Samsung Galaxy S8 from the Raspberry Pi 3 but I do not seem to be getting a response.

    I am using the command line arguments as ping 192.168.1.187 from my Pi, but it fails to receive a ping back. I had even tried using Android Terminal from the Galaxy S8 to ping wwww.google.com but it cannot send a ping.

    This leads me to believe that the problem lies on the Galaxy S8. Is there any way to "allow" pings on it? Is there another method where the Pi can detect if the Galaxy S8 is connected to the same wifi network?

    Notes:

    • Router cannot ping to the Galaxy S8

    • Raspberry Pi pings fine with every other device (Laptop, TV, other Pis)

    • Firewall is disabled

    • Galaxy S8's wifi is set to always on

  • Kevin Duarte
    Kevin Duarte almost 7 years
    I tried to ping the S8 to pi using the app you mentioned and it worked! However, the pi still cannot ping to the S8. I am confused since ping on Android terminal seems to be completely there. Furthermore, Android is based off a linux distro with much of the main features still there so there shouldnt be a probably even receiving a ping. I wonder if its a software bug or something on the S8 because ping is important for many applications
  • Iconic
    Iconic almost 7 years
    Just as an additional info: I can ping the Galaxy S5 but not the S7 so I would also say it might be a bug or maybe they disabled the ping functionality on purpose. Maybe someone could check Android Studio logs to verify what exactly causes the problem.
  • Kevin Duarte
    Kevin Duarte almost 7 years
    Perfect! nmap works flawlessly. Might be a little slow using a ping scan and -T5 flag, however, it is great for my application! Thank you.
  • Prashanth Kondedath
    Prashanth Kondedath almost 7 years
    Awesome. Glad you found your solution. Happy coding