16

I have successfully managed to install the Android Things Dev Preview onto my Raspberry Pi.

I have a problem though. When I first started installing my own applications I was able to connect to the Raspberry Pi through Ethernet, because it displayed the IP address on the TV when I booted up the Raspberry Pi.

Now because I have the Raspberry Pi already running an application, when I boot it up, it is automatically booting into my application without showing the initial screen with the IP address (and I forgot my IP address 🤔).

Is there an easy way to get the IP address of the Raspberry Pi, or connect to it when I don't know the IP address? Even a command to get a list of all available ADB devices on the network would help.

It would be great if when connected to a certain Wi-Fi, you could run something like:

adb network devices

Which could give a list of ADB devices on the network you are on.

4
  • What I do is connect my Pi running Things via serial cable, and then use Minicom to get into its shell from the connected computer. Then run ifconfig. Sep 7, 2017 at 14:26
  • Android Things: Connect to Raspberry Pi 3 (see What if I have neither display nor Ethernet cable? section in particular)
    – Onik
    Oct 25, 2017 at 21:46
  • just FYI "adb devices" is a valid command. Nov 19, 2017 at 3:58
  • I can't find IP address of Raspberry Pie either any of the ways defined here. I also have the same question as @riggaroo have. Mar 7, 2018 at 11:15

7 Answers 7

23

The Raspberry PI Automatically broadcasts Android.local and should resolve to the IP address assigned to your Pi on port 5555. Running the following:

adb connect Android.local

The command above is effectively the same as running:

adb connect <ip-address>:5555

Note: This will only work if your host platform supports multicast DNS service discovery.

This information was found in the documentation here by step 7 https://developer.android.com/things/hardware/raspberrypi.html

2
  • 1
    I'm very curious to know what will be broadcast when there's multiple devices
    – Fabio
    Jan 18, 2017 at 9:10
  • 1
    @riggaroo I tried adb connect Android.local but got the following error. unable to connect to Android.local:5555: nodename nor servname provided, or not known. However the connection was successful when I attempted to run adb connect <ip-address>. Any clue to know why Android.local didn't work for me?
    – Vijay
    Mar 9, 2017 at 22:04
12

You can scan your network for points with ports 5555/5554 open, for example,

nmap -p 5555,5554 192.168.0.2-100

will scan in range 2-100 for any IP addresses with those ports open.

1
  • Thanks, this also works! This works for all types of Android devices, not just the raspberry PI 😬
    – riggaroo
    Jan 6, 2017 at 15:38
4

Or you can check in your router which devices are connected

4

On OS X you can scan for all devices that publish itself as Android.local

dns-sd -Q Android.local

I believe you need Bonjour on Windows/Linux to get something similar, but I'm still not familiar with them.

After figuring out the correct IP for the desired device you can connect as usual:

adb connect <ip-address>:5555
0
3

If multicast DNS is not supported on host platform and you have access to your router, you can simply log into it and view the list of connected devices. You will be able to view all the devices no matter if mDNS is available or if there are any ports opened on the device (or if you don't know which port is opened).

3

The easiest way how to get to the initial screen with IP address from your application is to connect a USB keyboard to your Raspberry Pi then pressing escape key once :)

3

I had the very same problem recently and the easiest way in my opinion is that to just install a simple app on your phone (in my case Fing) that shows all the connected devices to your local connection including th RPI with their ip address. So then you are good to go!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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