因为没有显示模块就一个光板,于是就装了armbian,windows镜像烧写还有问题,于是跑到ubuntu下用dd搞定的,后面和结果参考文献https://bbs.elecfans.com/jishu_1102536_1_1.html一样的,所以不再啰嗦。
用的tf容量是4G的,应该不是class10的。几年前买的。
root@orangepizero:/etc/hostapd# df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/mmcblk0p1 3.5G 1.1G 2.4G 30% /
udev 10M 0 10M 0% /dev
tmpfs 99M 4.6M 95M 5% /run
tmpfs 248M 0 248M 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 248M 0 248M 0% /sys/fs/cgroup
tmpfs 248M 0 248M 0% /tmp
tmpfs 50M 0 50M 0% /run/user/0
root@orangepizero:/etc/hostapd#
接下来想看看wifi的信号强度怎么样,因为想接个摄像头给小孩做小车玩玩,要是放航模上这个板子有点重,26g,先放车或者船上玩玩。用hostapd建个热点看看。
root@orangepizero:/etc/hostapd# vihostapd.conf
interface=/var/run/hostapd
macaddr_acl=0
auth_algs=1
driver=nl80211
interface=wlan0
bridge=br0
hw_mode=g
ieee80211n=1
channel=1
ssid=opi-zero
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=876543210
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
满怀期待的运行,希望一次成功,果然不成功
root@orangepizero:/etc/hostapd#hostapd /etc/hostapd/hostapd.conf
Configura
tion file:/etc/hostapd/hostapd.conf
nl80211: Could not configure driver mode
nl80211: deinit ifname=wlan0disabled_11b_rates=0
nl80211 driver initialization failed.
wlan0: interface stateUNINITIALIZED->DISABLED
wlan0: AP-DISABLED
hostapd_free_hapd_data: Interface wlan0wasn't started
root@orangepizero:/etc/hostapd#
按照出错信息搜索了下,看到一篇文章http://blog.csdn.net/gsls200808/article/details/39370597
大意是要先关闭wifi,再软锁定
先nmcli nm wifioff
试了下出现错误
root@orangepizero:/etc/hostapd# nmcli nmwifi off
Error: Object 'nm' is unknown, try 'nmclihelp'.
root@orangepizero:/etc/hostapd#
说没有nm这个参数。没辙了。再搜,发现解决方案
用 nmcli radio wifi off 代替,
nmcli radio wifi off
这下正常了。ifconfig看不到wlan0了
然后
rfkill unblock wlan
hostapd hostapd.conf
ok正常启动
root@orangepizero:/etc/hostapd# hostapd hostapd.conf
Configuration file: hostapd.conf
nl80211: Could not re-add multicast membership for vendor
events: -2 (No such file or directory)
Using interface wlan0 with hwaddr 98:7c:1b:68:73:7a and ssid "opi-zero"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED
在
手机上查看信号强度,和家里的路由器(ssid:wuping)放一块,在两米距离的时候opi-zero的信号强度比路由器要强
隔了一堵墙大概6米时,opi-zero信号衰减的很快。
总结:
hostapd.conf 文件内容如下:
interface=/var/run/hostapd
macaddr_acl=0
auth_algs=1
driver=nl80211
interface=wlan0
bridge=br0
hw_mode=g
ieee80211n=1
channel=1
ssid=opi-zero
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=3
wpa_passphrase=876543210
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
建立热点测信号强度就3条命令:
nmcli radio wifi off
rfkill unblock wlan
hostapd hostapd.conf
因为我就想看看opi zero的信号强度,如果做路由的话害的brctl加入bridge。还有改其他参数,先不折腾了。
`