步骤如下
git clone /oblique/create_ap或者git clone /mirrors_oblique/create_ap.git(镜像)cd create_apsudo make install#安装依赖包sudo apt-get install util-linux procps hostapd iproute2 iw haveged dnsmasq#查看你的树莓派是否有iptables(dpkg -l | grep iptables) 如果有跳过这一步sudo apt-get install iptables#(通过网线给树莓派提供网络)创建热点sudo create_ap wlan0 eth0 网络名称 网络密码 --no-virt#(通过4G给树莓派提供网络)创建热点sudo create_ap wlan0 wwan0 网络名称 网络密码 --no-virt
创建成功显示如下
如果遇到下面问题 看下是否你的树莓派连接wifi,如果是先将它断开,再重试
pi@raspberrypi:~ $ sudo create_ap wlan0 wwan0 raspi 1234567WARN: brmfmac driver doesn't work properly with virtual interfaces andit can cause kernel panic. For this reason we disallow virtualinterfaces for your adapter.For more info: /oblique/create_ap/issues/203ERROR: Your adapter can not be a station (i.e. be connected) and an AP at the same time
查看默认的配置,修改热点名称(SSID),密码(PASSPHRASE),修改提供网络的网卡(INTERENCE_IFACE)
可以使用下面命令去控制wifi热点
sudo systemctl restart create_apsudo systemctl status create_apsudo systemctl stop create_ap#(关闭开机自启)sudo systemctl disbale create_ap #(打开开机自启)sudo systemctl enable create_ap
参考:树莓派上开热点(AP)的三种办法实践结果V2_Kearney form An idea的博客-CSDN博客_树莓派开热点