Android Things:连接到Raspberry Pi 3

时间:2017-02-01 15:51:10

标签: networking raspberry-pi3 android-things

总新手,我有一个 Raspberry Pi ,并已启用 Android Things 磁盘映像并启动它,但我无法连接到它通过以太网或USB运行 Android Studio adb.exe Windows 10 PC? Pi 屏幕有绿色和灰色" androidthings"徽标,但说 "未连接"

如果我连接USB电缆并使用adb devices命令,则未检测到任何内容。如果我连接以太网电缆并使用adb connect android.local命令,它会显示unable to connect to android.local:5555

我尝试了两个具有相同结果的 Pi

2 个答案:

答案 0 :(得分:5)

  

Pi屏幕有绿色和灰色" AndroidThings" logo但是说" Not Connected"。

" Not Connected" 消息表示您的 RPi3 不在您的本地网络中,这很可能是由直接连接使用 PC /笔记本电脑 RPi3 。你应该做的如下。

使用以太网电缆(图中1)将RPi3连接到路由器

enter image description here

重新启动 RPi3

以显示指定的 IP 地址。

设置Wi-Fi设置

  • 使用显示的 IP 通过adb连接 RPi3

    adb connect rpi3_ip_address
    
  • 设置Wi-Fi设置as per the docs

    adb shell am startservice -n com.google.wifisetup/.WifiSetupService -a WifiSetupService.Connect -e ssid network_SSID -e passphrase network_passcode
    

通过 Wi-Fi连接 RPi3 (图2中)

    adb connect Android.local

备注

  • network_SSIDnetwork_passcode区分大小写
  • 如果您的网络没有
    ,则
  • 删除-e passphrase network_passcode

如果我既没有显示也没有以太网电缆怎么办?

如上所述

Connect to Serial Debug Console并设置 Wi-Fi 设置,这次仅使用am startservice etc...

  

如果我连接 USB 电缆并使用adb devices命令,则不会检测到任何内容。

Micro USB of RPi isn't meant to transfer data over it:归功于@ Fabio的comment别忘了投票)。

答案 1 :(得分:0)

  

如果我连接USB电缆并使用adb devices命令,则不会检测到任何内容。

  • AndroidThing设备(Rpi3)不会通过usb adb连接进行连接。 见not connect to adb using USB。 您必须通过网络adb连接,即通过以太网或以下方式连接

连接到wifi的另一种方法是使用串行电缆。将串行电缆连接到RPis GPIO。(请参阅此connect serial cable to RPi3)并获取串行控制台。并在终端上提供以下命令。

>> su 
>>am startservice \
    -n com.google.wifisetup/.WifiSetupService \
    -a WifiSetupService.Connect \
    -e ssid <Network_SSID> \
    -e passphrase <Network_Passcode>