正在将 Raspberry Pi 运行 Android 事物连接到 wifi
Connecting Raspberry Pi running Android Things to wifi
我一直在尝试将我的 Raspberry Pi 运行 Android 东西连接到 wifi 但无济于事。
我已按照 this guide 连接到 Wifi。我通过以太网端口连接我的 Pi 以获取 IP 地址,然后能够通过 adb connect Android.Local
连接。但是当通过下面的命令
启动 WifiSetupService
时
adb shell am startservice \
-n com.google.wifisetup/.WifiSetupService \
-a WifiSetupService.Connect \
-e ssid <Network_SSID> \
-e passphrase <Network_Passcode>
然后通过 adb logcat -d | grep Wifi
命令获取 logcat 输出,我得到以下输出:
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
命令发送正确的密码。
非常感谢任何帮助!
我想我遇到了类似的问题。这可能是由于我之前尝试登录到同一网络但错误 SSID/Password(空格问题已解决 )。首先,我尝试连接到另一个网络,我在我的 Android phone 上使用热点,WPA2 和简单的 SSID/Password 没有任何空格或奇怪的字符只是为了确定。它连接没有问题,但我仍然无法连接到我的目标接入点。解决我的问题的方法是重新刷写 microSD 卡并尝试再次连接,但这次是第一次正确 SSID/Password。
ssid
-e ssid <Network_SSID> \
区分大小写:-)
尝试Winterfell
我遇到了同样的问题,但我的解决方案不同,当我尝试将代码复制到终端时出现错误:
adb shell am startservice \
-n com.google.wifisetup/.WifiSetupService \
enter code here
-a WifiSetupService.Connect \
enter code here
-e ssid Network \
-e passphrase Network_Password
在 Network_Password 之后添加一个 space 很重要,我的意思是结尾像:
adb shell am startservice \
-n com.google.wifisetup/.WifiSetupService \
enter code here
-a WifiSetupService.Connect \
enter code here
-e ssid Network \
enter code here
-e passphrase Network_Password" "
(没有引号,最后一个space)
我一直在尝试将我的 Raspberry Pi 运行 Android 东西连接到 wifi 但无济于事。
我已按照 this guide 连接到 Wifi。我通过以太网端口连接我的 Pi 以获取 IP 地址,然后能够通过 adb connect Android.Local
连接。但是当通过下面的命令
WifiSetupService
时
adb shell am startservice \
-n com.google.wifisetup/.WifiSetupService \
-a WifiSetupService.Connect \
-e ssid <Network_SSID> \
-e passphrase <Network_Passcode>
然后通过 adb logcat -d | grep Wifi
命令获取 logcat 输出,我得到以下输出:
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
命令发送正确的密码。
非常感谢任何帮助!
我想我遇到了类似的问题。这可能是由于我之前尝试登录到同一网络但错误 SSID/Password(空格问题已解决
ssid
-e ssid <Network_SSID> \
区分大小写:-)
尝试Winterfell
我遇到了同样的问题,但我的解决方案不同,当我尝试将代码复制到终端时出现错误:
adb shell am startservice \
-n com.google.wifisetup/.WifiSetupService \
enter code here
-a WifiSetupService.Connect \
enter code here
-e ssid Network \
-e passphrase Network_Password
在 Network_Password 之后添加一个 space 很重要,我的意思是结尾像:
adb shell am startservice \
-n com.google.wifisetup/.WifiSetupService \
enter code here
-a WifiSetupService.Connect \
enter code here
-e ssid Network \
enter code here
-e passphrase Network_Password" "
(没有引号,最后一个space)