将运行 Android Things 的 Raspberry Pi 连接到 wifi [英] Connecting Raspberry Pi running Android Things to wifi
问题描述
我一直在尝试将运行 Android Things 的 Raspberry Pi 连接到 wifi,但无济于事.
I've been trying to connect to my Raspberry Pi running Android Things to wifi but to no avail.
我已按照本指南连接到无线上网.我已经通过以太网端口连接了我的 Pi 以获取 IP 地址,然后能够通过 adb connect Android.Local
进行连接.但是当通过下面的命令
I've followed this guide to connect to Wifi. I had connected my Pi via ethernet port to get the IP address and then was able to connect via adb connect Android.Local
. But when starting the WifiSetupService
via the below command
adb shell am startservice \
-n com.google.wifisetup/.WifiSetupService \
-a WifiSetupService.Connect \
-e ssid <Network_SSID> \
-e passphrase <Network_Passcode>
然后通过 adb logcat -d | 获取 logcat 输出grep Wifi
命令,我得到以下输出:
and then getting the logcat output via adb logcat -d | grep Wifi
command, I get the below output:
12-28 17:27:19.761 1133 1133 D WifiSetupService: onStartCommand(Intent { act=WifiSetupService.Connect cmp=com.google.wifisetup/.WifiSetupService (has extras) })12-28 17:27:19.761 1133 1133 I WifiConfigurator:使用 SSIDwinterfell"连接到网络12-28 17:27:19.764 408 1052 D WifiService: setWifiEnabled: true pid=1133, uid=1002312-28 17:27:19.771 1133 1360 D WifiConfigurator:更新现有网络012-28 17:27:19.845 408 1361 D WifiNetworkHistory:保存网络历史记录:winterfell"WPA_PSK gw:空网络选择状态:NETWORK_SELECTION_ENABLED ephemeral=false 选择:空链接:0 状态:2 nid:0 hasEverConnected:false12-28 17:27:19.845 408 1361 V WifiNetworkHistory:writeKnownNetworkHistory 写入配置winterfell"WPA_PSK12-28 17:27:19.883 408 1362 D WifiNetworkHistory:保存网络历史记录:winterfell"WPA_PSK gw:空网络选择状态:NETWORK_SELECTION_ENABLED ephemeral=false 选择:空链接:0 状态:2 nid:0 hasEverConnected:false12-28 17:27:19.884 408 1362 V WifiNetworkHistory:writeKnownNetworkHistory 写入配置winterfell"WPA_PSK12-28 17:27:19.884 408 457 I WifiConnectivityManager:forceConnectivityScan12-28 17:27:19.886 408 457 E WifiScanner:找不到监听器12-28 17:27:49.884 1133 1360 E WifiConfigurator:30000毫秒内Wifi连接失败
12-28 17:27:19.761 1133 1133 D WifiSetupService: onStartCommand(Intent { act=WifiSetupService.Connect cmp=com.google.wifisetup/.WifiSetupService (has extras) }) 12-28 17:27:19.761 1133 1133 I WifiConfigurator: Connecting to network with SSID "winterfell" 12-28 17:27:19.764 408 1052 D WifiService: setWifiEnabled: true pid=1133, uid=10023 12-28 17:27:19.771 1133 1360 D WifiConfigurator: Updating existing network 0 12-28 17:27:19.845 408 1361 D WifiNetworkHistory: saving network history: "winterfell"WPA_PSK gw: null Network Selection-status: NETWORK_SELECTION_ENABLED ephemeral=false choice:null link:0 status:2 nid:0 hasEverConnected: false 12-28 17:27:19.845 408 1361 V WifiNetworkHistory: writeKnownNetworkHistory write config "winterfell"WPA_PSK 12-28 17:27:19.883 408 1362 D WifiNetworkHistory: saving network history: "winterfell"WPA_PSK gw: null Network Selection-status: NETWORK_SELECTION_ENABLED ephemeral=false choice:null link:0 status:2 nid:0 hasEverConnected: false 12-28 17:27:19.884 408 1362 V WifiNetworkHistory: writeKnownNetworkHistory write config "winterfell"WPA_PSK 12-28 17:27:19.884 408 457 I WifiConnectivityManager: forceConnectivityScan 12-28 17:27:19.886 408 457 E WifiScanner: listener cannot be found 12-28 17:27:49.884 1133 1360 E WifiConfigurator: Wifi failed to connect in 30000 ms
我不知道我在哪里丢失或为什么 Pi 无法连接到 Wifi.我已经多次验证我正在向 shell am
命令发送正确的密码.
I don't know where I am missing or why Pi is unable to connect to Wifi. I have verified multiple times that I'm sending the correct passphrase to the shell am
command.
任何帮助将不胜感激!
推荐答案
ssid
for
-e ssid
区分大小写 :-)
试试Winterfell
这篇关于将运行 Android Things 的 Raspberry Pi 连接到 wifi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!