当前位置:网站首页>迅为-iMX6ULL开发板上配置AP热点
迅为-iMX6ULL开发板上配置AP热点
2020-11-06 22:00:00 【书白】
开发板连接好电源和调试串口,然后打开调试串口终端,然后给开发板上电,等待系统启动 完成,如图 99.6.1 所示:

然后把第五章制作好的 U 盘插入开发板的 USB 接口,可以看到串口打印出 USB 设备的信息,如图 99.6.2所示:

我们在调试串口终端输入“df”命令,可以看到 U 盘的挂载目录,运行结果如图 99.6.3 所示:

接下来我们在调试串口终端输入“cd /run/media/sda1/hostap”命令,进入我们在第五章创建的“hostap”文件夹,如图 99.6.4 所示:

我们输入“ls”命令,可以看到在第五章拷贝的文件,如图 99.6.5 所示:

然后我们使用 cp 命令拷贝“ lib_nl.tar.gz ”和“ openssl.tar.gz ”到系统目录的“ /usr/lib ”目录 下,运行结果如图 99.6.6 所示:

然后我们使用“cd /usr/lib”命令,进入到“/usr/lib”目录下,如图 99.6.7 所示:

然后分别输入“ tar -xvf lib_nl.tar.gz ”和“ tar -xvf openssl.tar.gz ”这两个命令,解压 libnl 和 openssll 库文件到当前目录下(由于我这里使用的是 yocto 文件系统,该系统里面已经安装好 libnl 和openssll 的库文件了,所以我就不解压了,如果大家使用其它的文件系统,这里需要解压一下)。
然后回到 U 盘的目录,拷贝“hostapd.conf”,“udhcpd.conf”,“udhcpd.leases”到系统的“/etc”目录下,如图 99.6.8 所示:

hostapd.conf 文件是设置 AP 热点的网络名字,以及密码,其内容如下:
ctrl_interface=/var/run/hostapd
interface=wlan0
driver=nl80211
ssid=Topeet_TEST
channel=1
macaddr_acl=0
auth_algs=1
hw_mode=g
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=123456780
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
上面的 ssid 是wifi 的名称(Topeet_test),wpa_passphrase 是wifi 的密码(1234567890)。
udhcpd.conf 文件是配置 dhcp 的,内容如下:
start 192.168.0.2
end 192.168.0.100
interface wlan0
max_leases 20 #default: 254
remaining yes #default: yes
auto_time 7200
decline_time 3600
conflict_time 3600
offer_time 60
min_lease 60
lease_file /etc/udhcpd.leases
opt dns 10.221.0.11 8.8.8.8
option subnet 255.255.255.0
opt router 192.168.0.1
Start 和end 指定了 wifi 分配的 IP 地址范围(192.168.0.2-192.168.0.100),其它的参数大家可以网上查阅下,这里就不再具体讲述了。
然后拷贝“hostapd”到系统的“/usr/sbin”目录,如图 99.6.9所示:

由于yocto 文件系统使用 rfkill 命令来管理 wifi 和蓝牙,首先我们在调试串口终端输入“rfkill unblock wifi”来开启 wifi(如果大家使用的不是 yocto 文件系统,可以忽略次步骤),运行结果如图 99.6.10 所示:

然后在调试串口输入“ifconfig wlan0 192.168.0.1 up”命令,配置 wlan0 的ip,并启用 wlan,如图 99.6.11所示:

然后在调试串口输入“hostapd -B /etc/hostapd.conf -dd”开始 AP 热点,运行结果如图 99.6.12 所示:

然后在调试串口输入“udhcpd -fS /etc/udhcpd.conf &”,开启 dhcp server 服务(udhcpd 这个程序是我们在制作文件系统的时候 busybox 里面默认提供的,如果大家的文件系统没有这个程序,可以重新配置下 busybox 或者是单独移植一下 udhcpd 这个程序,具体的移植步骤这里就不在介绍了),运行结果如图 99.6.13 所示:

至此 AP 热点功能已经开启了,我们可以在调试串口输入“ps -el”查看所有进程,能够看到 hostapd 和udkcpd 两个进程在后台运行,如图 99.6.14 所示:

然后我们可以使用手机或笔记本扫描 wifi,能够查找到“Topeet_TEST”网络,并连接该 wifi 网络,密码输入“123456780”,最后会连接到“Topeet_TEST”网络,同时我们在调试串口会看到 dhcp 为我们的手机分配的 ip 地址“192.168.0.2”,如图 99.6.15 所示:

至此关于开发板上创建热点我们就介绍完了。 
版权声明
本文为[书白]所创,转载请带上原文链接,感谢
https://my.oschina.net/u/3005926/blog/4706119
边栏推荐
- An article taught you to download cool dog music using Python web crawler
- CCR coin frying robot: the boss of bitcoin digital currency, what you have to know
- Ronglian completed US $125 million f round financing
- 2020-08-15:什么情况下数据任务需要优化?
- The method of realizing high SLO on large scale kubernetes cluster
- What knowledge do Python automated testing learn?
- Introduction to the development of small game cloud
- Take you to learn the new methods in Es5
- 【字节跳动 秋招岗位开放啦】Ohayoo!放学别走,我想约你做游戏!!!
- Call analysis of start method in JNI thread and callback analysis of run method
猜你喜欢

Take you to learn the new methods in Es5
![Tron smart wallet PHP development kit [zero TRX collection]](/img/3b/00bc81122d330c9d59909994e61027.jpg)
Tron smart wallet PHP development kit [zero TRX collection]

嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:王涛

Building a new generation cloud native data lake with iceberg on kubernetes

An article will introduce you to HTML tables and their main attributes

Isn't data product just a report? absolutely wrong! There are university questions in this category

How much disk space does a new empty file take?

2020-08-15:什么情况下数据任务需要优化?

Behind the record breaking Q2 revenue of Alibaba cloud, the cloud opening mode is reshaping

如何对数据库账号权限进行精细化管理?
随机推荐
行为型模式之备忘录模式
IPFs rudder filecoin landing at the same time, fil currency price broke a thousand
list转换map(根据key来拆分list,相同key的value为一个list)
Digital city responds to relevant national policies and vigorously develops the construction of digital twin platform
Introduction to the development of small game cloud
【字节跳动 秋招岗位开放啦】Ohayoo!放学别走,我想约你做游戏!!!
2020-09-09:裸写算法:两个线程轮流打印数字1-100。
What is the purchasing supplier system? Solution of purchasing supplier management platform
jenkins安装部署过程简记
Swagger 3.0 brushes the screen every day. Does it really smell good?
Filecoin has completed a major upgrade and achieved four major project progress!
Axios learning notes (2): easy to understand the use of XHR and how to package simple Axios
The native API of the future trend of the front end: web components
[forward] how to view UserData in Lua
如何对数据库账号权限进行精细化管理?
What kind of music do you need to make for a complete game?
【学习】接口测试用例编写和测试关注点
This project allows you to quickly learn about a programming language in a few minutes
事件监听问题
Zero basis to build a web search engine of its own