这些是设置 wifi 后的接口和 wpa_supplicant.conf 文件:
# interface file auto-generated by buildroot
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
pre-up /etc/network/nfs_check
wait-delay 15
auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -B -Dnl80211 -i wlan0 -c /etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant
wait-delay 15
iface default inet dhcp
~
ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
network={
key_mgmt=NONE
}
# reading passphrase from stdin
network={
ssid="ARGOSS00@"
#psk="G@M3NN@SSA"
psk=6de278831a5094bd1c31ce565e486416a38bcac14b2f04afc36e0392f9fd248e
}
~
我重新配置了Wlan0:
# wpa_cli -i wlan0 reconfigure
OK
# ifup -a
ifup: interface lo already configured
udhcpc: started, v1.28.4
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: no lease, failing
ifup: interface wlan0 already configured
#
然后,我找到了我的 raspi 的 IP 地址:
wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.31.143 netmask 255.255.255.0 broadcast 192.168.31.255
inet6 fe80::ba27:ebff:fe19:36a8 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:19:36:a8 txqueuelen 1000 (Ethernet)
RX packets 44 bytes 9632 (9.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 168 bytes 20005 (19.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
但是,我无法使用 ssh 从 ubuntu 16.04 连接到 raspi!
sudo ssh [email protected]
ssh: connect to host 192.168.31.143 port 22: Connection timed out