From 121c58b24340f1c56e9a9c5340afee5cd8c5def5 Mon Sep 17 00:00:00 2001 From: IrvingGao <1729854488@qq.com> Date: Sat, 25 May 2024 00:22:20 +0800 Subject: [PATCH] update readme --- README.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..f0913de --- /dev/null +++ b/README.md @@ -0,0 +1,79 @@ + +## Linux嵌入板卡自发热点连接无线网络 + + +### 介绍 + +Linux嵌入板卡发出热点供客户端连接,客户端通过浏览器访问热点,连接到Linux嵌入板卡的热点,并进行交互。 + +### 环境准备 + +#### (1) 安装依赖项: + +``` +sudo apt-get update +sudo apt-get install hostapd dnsmasq +``` + +#### (2) 克隆项目到本地并安装依赖: + +``` +// 克隆项目到本地 https or ssh +git clone http://43.132.157.186:3000/gaohz/wifi_hotpot.git +cd wifi_hotpot +``` + +#### (3) 安装Python端环境依赖: + +``` +sudo pip install flask psutil +``` + +#### (4) 配置开机自启动服务项: + + +- 编辑 +``` +sudo vim /etc/systemd/system/wifi_hotspot.service +``` + +- 内容: +``` +[Unit] +Description=WiFi Hotspot Wrapper +After=network.target +Wants=network.target + +[Service] +Type=oneshot +ExecStart=python3 /home/orangepi/wifi_hotpot/wifi_manager.py +WorkingDirectory=/home/orangepi/wifi_hotpot +User=root + +[Install] +WantedBy=default.target +``` + +- 配置 +``` +sudo systemctl daemon-reload +sudo systemctl enable wifi_hotspot.service +# sudo systemctl disable wifi_hotspot.service +``` + +- 开始(测试) + +``` +sudo systemctl start wifi_hotspot.service +``` + +- 查看输出 +``` +sudo systemctl status wifi_hotspot.service +``` + +#### (5) 配置热点信息: + +- 手动连接`http://192.168.12.1/` + +- 连接成功后,输入用户名密码,即可进入交互界面。 \ No newline at end of file