树莓派3B创建WiFi热点

来源:互联网 发布:看门狗pc优化补丁 编辑:程序博客网 时间:2024/05/22 03:12

详见GitHub上的一个开源项目:
https://github.com/oblique/create_ap

在树莓派上具体操作步骤为:

1.将代码copy到本地,安装
git clone https://github.com/oblique/create_apcd create_apsudo 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) || trueif [ "$_IP" ]; then  printf "My IP address is %s\n" "$_IP"fiexit 0
原创粉丝点击