How to set wifi to Android Things without an ethernet cable or adb [closed]

杀马特。学长 韩版系。学妹 提交于 2019-12-17 19:22:46

问题


I'm interested in knowing how to set the first wifi on android things (not android phone) without access to a network cable, for a fresh install.

There certainly must be a way to put the information in the SD card right after copying the OS image. If that can't be done directly, worst case scenario I would expect it should be possible to write a script and copy it somewhere into some of the partitions and have it automatically run at boot (which can be handy for other things). Unless the image is signed?

I would also be ok by writing an app that could be copied to SD card before first boot that would be auto-installed and do that thing for me. I would know how to write the app, but so far I don't know how to do the copy/autoinstall/autorun thing.

I would also be ok having one device connect to network and configure wifi, then clone its SD card into another one.

What really gets in my way is having to get a network cable every time I prepare a new SD card.


回答1:


You should be able to add your wifi configuration at the end of /data/misc/wifi/wpa_supplicant.conf.

network={
    ssid="SSID"
    key_mgmt=WPA-PSK
    psk="PASSPHRASE"
}

This should be located on the data (ext4) partition of the sdcard (for me /dev/sdb15)




回答2:


You can use:

adb connect Android.local

to connect to Android Things PC (Raspberry PI3) and then just set up your WiFi like described in Android Things tutorial:

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

https://developer.android.com/things/hardware/raspberrypi.html



来源:https://stackoverflow.com/questions/41731108/how-to-set-wifi-to-android-things-without-an-ethernet-cable-or-adb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!