樹莓派3 B+ / ubuntu-18.04.2 設置 wifi (少走彎路)

首先按照網上的教程,給microSD卡format, 而後把ubuntu鏡像拷上去。
開機,初始化系統
而後連一根網線git

而後: github

·##################### 、 很簡單啊! 捷徑方法 ##########################ubuntu

  1. mkdir 而後 cd 到 ~/Documents/
  2. git clone https://github.com/RPi-Distro/raspi-config.git
  3. cd into raspi-config directory, and do: sudo chmod +x raspi-config 這一步是把 raspi-config 這個文件變成可執行文件。
  4. raspi-config 是一個文件,跑的話要用:sudo ./raspi-config or sudo sh raspi-config
  5. 而後在ui裏面選就好了

`##################### 如下是原答案 花了不少精力試錯 #########################less

For the image with apt installedui

Step1:this

sudo apt-get install wireless-tools

Step2:rest

sudo apt-get install wpasupplicant

Step3: add to /etc/network/interfaces:code

auto wlan0 
iface wlan0 inet dhcp
wpa-ssid WIRELESSSSID 
wpa-psk WIRELESSPASSWORD

Step4: comment from /etc/network/interfaces the line:orm

#source /etc/network/interfaces.d/*.cfg

the commented interfaces.d/*.cfg file contains settings for the eth0.server

I do not understand why but leaving this line active and adding the wlan0 config would crash the system at boot.

Step5: reboot

For the core image without apt installed:

Step1:

ifconfig wlan0 down
ifconfig wlan0 up

Step2: create wireless config file:

sudo vi /etc/network/interfaces.d/wlan0

Note: I tried without sudo but it would not let me save the changes

Step3: add the following content

auto wlan0 
iface wlan0 inet dhcp
wpa-ssid WIRELESSSSID 
wpa-psk WIRELESSPASSWORD

Step4: reboot

其實都不須要reboot, 只要重啓網卡便可:

sudo systemctl restart networking
sudo ifdown wlan0
sudo ifup wlan0
wpa_cli status

參考:
https://askubuntu.com/questio...

相關文章
相關標籤/搜索