Posts Tagged ‘Raspberry Pi’

5Ghz AP on Raspberry Pi 3B+

28 十一月, 2018

Summary: 5Ghz Access Point on 802.11n, 40Mhz, on Raspberry Pi 3B+.

Started off with Raspbian Lite image burned onto microSD card, with Etcher. When done, eject the card and re-insert, add an “ssh" file on the boot partition to enable ssh:

touch /Volumes/boot/ssh # or wherever the boot partition is

Upon first boot, set wifi country code with

sudo raspi-config

My understanding is that would add this “country=US" line to this file so wifi can be turned on:

$ cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

This is the guide I followed, good for Raspbian Stretch: http://www.raspberryconnect.com/network/item/333-raspberry-pi-hotspot-access-point-dhcpcd-method

This is my “hostapd.conf" I ended up with:

$ cat /etc/hostapd/hostapd.conf
interface=wlan0
driver=nl80211
ssid=name_of_access_point # rename this
hw_mode=a
channel=48
wmm_enabled=1
ieee80211n=1
require_ht=1
ht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40]
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=dont_tell_others # change this
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Compared to the guide, there are these differences:

hw_mode=a # instead of g
wmm_enabled=1
ieee80211n=1
require_ht=1
ht_capab=[HT40-][SHORT-GI-20][SHORT-GI-40]
channel=48 # see ht_capab in the hostapd.conf below for possible combinations of ht_capab and channel

For more details refer to https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf; it is very long though.

Result (on Mac, press and hold Option button while click on the wifi icon to see this): Screen Shot 2018-11-27 at 10.44.07 PM

I’m getting 71Mbps over this AP for speed test, which is the speed of my internet, and much better than the 28Mbps with my old travel router on 2.4Ghz band.

Seems you can only choose between 2.4Ghz and 5Ghz and not both at the same time: https://raspberrypi.stackexchange.com/questions/82102/is-it-possible-to-use-raspberry-pi-3-b-dual-band-wifi-simultaneously , hence I still need the other router to provide 2.4Ghz connection for IoT / old devices.

(edit) Even though the chip supports 80Mhz bandwidth (VHT), currently it cannot make use of it due to this issue: https://github.com/raspberrypi/linux/issues/2619 indicates that if you set the country to some countries in EU it wouldn’t work on 80Mhz. I could make it work by changing the few lines as suggested in this issue link as:

channel=36 # instead of 48 above; again check the list of possible channels with 80211ac
ht_capab=[HT40+][SHORT-GI-20][SHORT-GI-40][DSSS_CCK-40] # changed from [HT40-] to [HT40+] since channel 36 is used and added [DSSS_CCK-40]

ieee80211ac=1
require_vht=1
ieee80211d=0
ieee80211h=0
vht_capab=[SHORT-GI-80]
vht_oper_chwidth=1
vht_oper_centr_freq_seg0_idx=42

However it’s not as stable as before due to undervolting (I don’t have the best power supply) and I have to add a few lines to the /boot/config.txt:

arm_freq=1000 # down from default of 1400 on 3B+
dtoverlay=pi3-disable-bt # since I’m not using bluetooth anyways; not sure how much this helps though.

Even undervolting warning goes away (sudo dmesg), I still don’t have a stable connection, not sure why yet and I’m reverting back to 80211n mode for now.