NO IMAGE

詳見GitHub上的一個開源專案:
https://github.com/oblique/create_ap

在樹莓派上具體操作步驟為:

1.將程式碼copy到本地,安裝
git clone https://github.com/oblique/create_ap
cd create_ap
sudo make install
2.安裝依賴的庫
sudo apt-get install util-Linux procps hostapd iproute2 iw haveged dnsmasq

若安裝不上,請先執行

sudo apt-get update
3.建立WiFi熱點
sudo create_ap wlan0 eth0 熱點名 密碼

例如:

sudo create_ap wlan0 eth0 yuntai_pi 12345678
4.開機啟動

將步驟3中建立WiFi熱點的命令新增到/etc/rc.local當中,儲存,然後reboot重啟


#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sudo create_ap wlan0 eth0 yuntai_pi 12345678
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
exit 0