且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android Things:连接到 Raspberry Pi 3

更新时间:2023-01-04 22:45:17

Pi 屏幕有一个绿色和灰色的AndroidThings"徽标但显示未连接".

The Pi screen has a green and grey "AndroidThings" logo but says "Not Connected".

"Not Connected" 消息意味着您的 RPi3 不在您的本地网络中,这很可能是由于直接连接RPi3 与您的 PC/笔记本电脑.你应该做的如下.

The "Not Connected" message means your RPi3 is not in your local network, which most likely caused by directly connecting the RPi3 with your PC / laptop. What you should do is as follows.

为了显示分配的IP地址.

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

 adb connect rpi3_ip_address

  • 设置 Wi-fi 设置按照文档:

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

  •     adb connect Android.local
    


    注意事项:

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

    连接到串行调试控制台并按照上述设置Wi-Fi设置,只需使用am startservice etc... 这次.

    Connect to Serial Debug Console and setup Wi-Fi settings as above, just using am startservice etc... this time.

    如果我连接了 USB 电缆并使用 adb devices 命令,则没有检测到任何内容.

    If I connect a USB cable and use the adb devices command, nothing is detected.

    RPi 的微型 USB 并不意味着通过它传输数据:感谢@Fabio 的评论 (不要忘记投票).

    Micro USB of RPi isn't meant to transfer data over it: a credit goes to @Fabio's comment (don't forget to vote it up).