## 802.11 AC 5ghz setup for softap mode
## Tested with RTL8821CU (little white Alfa dongle on Starling)
## RTL8812AU, and RTL8811AU (small Alfa dongle with SMA antenna)

ssid=myssid
wpa_passphrase=1234567890


# 802.11n/ac
ieee80211n=1
require_ht=1
ht_capab=[HT40+][SHORT-GI-20][SHORT-GI-40]
ieee80211ac=1
wmm_enabled=1
require_vht=1
country_code=US
ieee80211d=1

## vht setup for RTL8821cu
## The HTC-VHT flag is necessary for higher bitrates on both chips
vht_capab=[MAX-MPDU-11454][A-MPDU-1][SHORT-GI-80][HTC-VHT][MAX-A-MPDU-LEN-EXP4]

## extra flags that RTL8812AU is capable of, but don't seem to be necessary
#vht_capab=[MAX-MPDU-11454][A-MPDU-1][SHORT-GI-80][HTC-VHT][MAX-A-MPDU-LEN-EXP4][TX-STBC-2BY1][RX-STBC-1][SU-BEAMFORMEE]

# Channel
# 149 seems to work well on rtl8821cu. chwidth=1 should allow 80mhz if available
# which works on rtl8812au but rtl8821cu seems to fall back on 40mhz
vht_oper_chwidth=1
hw_mode=a
#channel=36
#vht_oper_centr_freq_seg0_idx=42
channel=149
vht_oper_centr_freq_seg0_idx=155
#channel=153
#vht_oper_centr_freq_seg0_idx=159


## Generic
interface=wlan0
driver=nl80211


# WPA2 settings
auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP



## NOTES

# from a connected computer, check bitrates with:
# iw dev wlo1 link
# this file lives in /data/misc/wifi/hostapd.conf

# /usr/share/modalai/system-tweaks/voxl-softap stop
# /usr/share/modalai/system-tweaks/voxl-softap start

# vht hardware capabilities for 8821cu is:
# 0x3c00022
# starting from the right (bit 0), set bits are:
# 1: [MAX-MPDU-11454]
# 5: [SHORT-GI-80]
# 22: [HTC-VHT]
# 23-25: [MAX-A-MPDU-LEN-EXP4]

# vht hardware capabilities for 8812au is:
# 0x3c031a2
# starting from the right (bit 0), set bits are:
# 1: [MAX-MPDU-11454]
# 5: [SHORT-GI-80]
# 7: [TX-STBC-2BY1]
# 8: [RX-STBC-1]
# 12: [SU-BEAMFORMEE]
# 13:
# 22: [HTC-VHT]
# 23-25: [MAX-A-MPDU-LEN-EXP4]

# # vht hardware capabilities for RTL8811AU
# 0x3c03122
# starting from the right (bit 0), set bits are:
# 1: [MAX-MPDU-11454]
# 5: [SHORT-GI-80]
# 8: [RX-STBC-1]
# 12: [SU-BEAMFORMEE]
# 13:
# 22: [HTC-VHT]
# 23-25: [MAX-A-MPDU-LEN-EXP4]
