樹莓派建立wifi熱點並開機自啟
阿新 • • 發佈:2018-12-13
1.建立熱點
建立WiFi熱點使用的GitHub上一個開源專案: https://github.com/oblique/create_ap #將程式碼copy到本地,安裝 sudo git clone https://github.com/oblique/create_ap cd create_ap sudo make install #安裝依賴的庫 sudo apt-get install util-linux procps hostapd iproute2 iw haveged dnsmasq 此時你可以建立熱點,通過以下命令: sudo create_ap wlan0 eth0 熱點名 密碼
2.加入開機自啟
sudo create_ap wlan0 eth0 熱點名 密碼
儲存後給檔案賦予執行許可權
sudo chmod +x AutoStart.sh
- 加入開機自啟
sudo vi /etc/rc.local
#在exit 0 之前加入
su pi -c 'exec /home/pi/AutoStart.sh'
重啟後就會執行AutoStart.sh指令碼