Colibri IMX8X Wifi IEEE 802.11ac

Hello,
I’m working on a custom carrier board housing a Colibri iMX8DX 1GB WB module.

We’re currently using the integrated wifi module in access point mode with a dhcp server behind it.

Everything is working so far while using IEEE 802.11g, we can connect to the access point over 2.4 GHz but the speed is limited to 54 Mbps.

We need to use the 802.11ac mode if possible, or at least the 802.11n (Wifi 4) mode.
I tried following this tutorial to no success: the access point is not started with those settings.

hostapd is started on boot with the modified service /etc/systemd/system/hostapd.service that starts hostapd with debug messages :

[Unit]
Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
BindsTo=sys-subsystem-net-devices-uap0.device
After=sys-subsystem-net-devices-uap0.device

[Service]
Type=forking
PIDFile=/run/hostapd.pid
ExecStart=/usr/sbin/hostapd -d /etc/hostapd.conf -P /run/hostapd.pid -B

[Install]
WantedBy=multi-user.target

The /etc/hostapd.conf contains the following values:

interface=uap0
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
ssid=<REDACTED>
country_code=JP
hw_mode=a
channel=36
beacon_int=100
dtim_period=2
max_num_sta=255
rts_threshold=-1
fragm_threshold=-1
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wmm_enabled=1
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
ieee80211n=1
ht_capab=[HT40+][LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40]
ieee80211ac=1
vht_capab=[RXLDPC][TX-STBC-2BY1][RX-STBC-12][MAX-A-MPDU-LEN-EXP3][SHORT-GI-80][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN]
vht_oper_chwidth=1
vht_oper_centr_freq_seg0_idx=42
eapol_key_index_workaround=0
eap_server=0
own_ip_addr=10.42.0.1
wpa=2
wpa_passphrase=<REDACTED>
wpa_pairwise=CCMP
rsn_pairwise=CCMP
ieee80211w=2
sae_require_mfp=1

Here’s the output of systemctl status hostapd -n 100:

○ hostapd.service - Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
     Loaded: loaded (/etc/systemd/system/hostapd.service; enabled; vendor preset: disabled)
     Active: inactive (dead) since Wed 2023-11-15 14:20:16 UTC; 19min ago
    Process: 879 ExecStart=/usr/sbin/hostapd -d /etc/hostapd.conf -P /run/hostapd.pid -B (code=exited, status=0/SUCCESS)
   Main PID: 887 (code=exited, status=0/SUCCESS)

Nov 15 14:20:15 colibri-imx8x-07266274 systemd[1]: Starting Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator...
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: random: Trying to read entropy from /dev/random
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: Configuration file: /etc/hostapd.conf
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: ctrl_interface_group=0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: TDLS supported
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: TDLS external setup
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Supported cipher 00-0f-ac:1
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Supported cipher 00-0f-ac:5
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Supported cipher 00-0f-ac:2
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Supported cipher 00-0f-ac:4
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Supported cipher 00-14-72:1
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Supported cipher 00-0f-ac:6
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Supports Probe Response offload in AP mode
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: TDLS channel switch
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Use separate P2P group interface (driver advertised support)
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: key_mgmt=0xd0f enc=0x10f auth=0x7 flags=0x894f97ac0 rrm_flags=0x0 probe_resp_offloads=0x7 max_stations=8 max_remain_on_chan=500>
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: interface uap0 in phy phy0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Set mode ifindex 8 iftype 3 (AP)
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Setup AP(uap0) - device_ap_sme=1 use_monitor=0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Subscribe to mgmt frames with AP handle 0xaaaadfc2b9f0 (device SME)
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaaadfc2b9f0 match=04 multicast=0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaaadfc2b9f0 match=0501 multicast=0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaaadfc2b9f0 match=0503 multicast=0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaaadfc2b9f0 match=0504 multicast=0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaaadfc2b9f0 match=06 multicast=0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaaadfc2b9f0 match=08 multicast=0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaaadfc2b9f0 match=09 multicast=0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaaadfc2b9f0 match=0a multicast=0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaaadfc2b9f0 match=11 multicast=0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0xaaaadfc2b9f0 match=7f multicast=0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame type=0xb0 (WLAN_FC_STYPE_AUTH) nl_handle=0xaaaadfc2b9f0 match= multicast=0
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: kernel reports: Registration to specific type not supported
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame command failed (type=176): ret=-22 (Invalid argument)
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame match - hexdump(len=0): [NULL]
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Failed to subscribe to handle Authentication frames - SAE offload may not work
Nov 15 14:20:15 colibri-imx8x-07266274 hostapd[879]: nl80211: Enable Probe Request reporting nl_preq=0xaaaadfc341e0
Nov 15 14:20:15 colibri-imx8x-07266274 systemd[1]: hostapd.service: Can't open PID file /run/hostapd.pid (yet?) after start: Operation not permitted
Nov 15 14:20:16 colibri-imx8x-07266274 hostapd[879]: nl80211: Register frame type=0x40 (WLAN_FC_STYPE_PROBE_REQ) nl_handle=0xaaaadfc341e0 match= multicast=0
Nov 15 14:20:16 colibri-imx8x-07266274 hostapd[879]: rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
Nov 15 14:20:16 colibri-imx8x-07266274 hostapd[879]: nl80211: Interface uap0 is in bridge br0
Nov 15 14:20:16 colibri-imx8x-07266274 hostapd[879]: nl80211: Add own interface ifindex 8 (ifidx_reason -1)
Nov 15 14:20:16 colibri-imx8x-07266274 hostapd[879]: nl80211: if_indices[16]: 8(-1)
Nov 15 14:20:16 colibri-imx8x-07266274 hostapd[879]: nl80211: Add own interface ifindex 4 (ifidx_reason 8)
Nov 15 14:20:16 colibri-imx8x-07266274 hostapd[879]: nl80211: if_indices[16]: 8(-1) 4(8)
Nov 15 14:20:16 colibri-imx8x-07266274 hostapd[879]: phy: phy0
Nov 15 14:20:16 colibri-imx8x-07266274 hostapd[879]: BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
Nov 15 14:20:16 colibri-imx8x-07266274 hostapd[879]: uap0: interface state UNINITIALIZED->COUNTRY_UPDATE
Nov 15 14:20:16 colibri-imx8x-07266274 hostapd[879]: Previous country code US, new country code JP
Nov 15 14:20:16 colibri-imx8x-07266274 hostapd[879]: Continue interface setup after channel list update
Nov 15 14:20:16 colibri-imx8x-07266274 hostapd[879]: ctrl_iface not configured!
Nov 15 14:20:16 colibri-imx8x-07266274 systemd[1]: Started Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator.
Nov 15 14:20:16 colibri-imx8x-07266274 systemd[1]: hostapd.service: Deactivated successfully.

Is there are any example configuration working on IMX8X with high throughput wifi?

Hardware info:
Custom board
SoM: Colibri iMX8DX 1GB WB
OS: Custom (torizoncore-builder) based on torizon-core-docker-colibri-imx8x-Tezi_6.4.0+build.5
Kernel version: Linux 5.15.77-6.3.0+git.ddc6ca4d76ea

Hi @c.azais !

As you can see in the article you are following, there is an article specific for Torizon OS, which is this one: Networking with Torizon OS | Toradex Developer Center

Have you tried using Network Manager instead of Hostapd?

Best regards,

Hi @henrique.tx ,

I initially tried using NetworkManager but while I could see the access point, I was not able to connect to it.

While switching to hostapd, I may have changed a few parameters regarding authentication as well as DHCP so I could probably connect to the AP using NetworkManager now.

Will the wifi be faster if I use NetworkManager?

Kind regards,

Corentin.

Hi @c.azais !

Difference on the performance is not expected for the AP when using one or the other.

Looking at your hostapd.conf, it is quite different from the one at the Networking with Torizon OS | Toradex Developer Center. Have you tried using the one from the article? Can you please share the results with hostapd.conf being the same as the article?

#/etc/hostapd.conf
interface=uap0
ssid=<WIFI_SSID>
hw_mode=g
channel=1
own_ip_addr=<IP_ADDR>

Best regards,

Gateworks hostapd-conf script helps creating nearly fastest possible hostapd setup. It seems being outdated regarding newest 11d?, but 11ac is handled quite well.

Hi @henrique.tx ,

The configuration you shared is what I initially tried.
It works well, but the WiFi access point created is limited to 54 Mbps.
We measured real world speeds of around 30 Mbps using iperf.

Kind regards,
Corentin.

Hello @c.azais ,
Were you able to try the solution proposed by @Edward ?

Best regards,
Josep

Hello @josep.tx ,

Sorry for getting back to you so late.
I was able to try the solution proposed by @Edward.

It created a hostapd.conf very similar to what I did before and I was able to get WiFi 5 working (5 Ghz, > 100 Mbps). I measured real world speeds of around 70 Mbps between the SoM and a smartphone connected to it’s AP which is enough for our application.

I believe I originally had multiple problems with WiFi authentication (WPA2 PSK), the bridge network and the DHCP which is why my original configuration did not work.

Finally we had another problem that we discovered later: we had WiFi drops that lasted multiple seconds. It turns out that was caused by the periodic WiFi scans of NetworkManager on interface mlan0. We fixed the problem by removing the mlan0 interface from NetworkManager since we do not ever need to connect to a WiFi network.

I have attached the final, isolated network configuration that we arrived at:
filesystem_network.zip (5.0 KB)

It does the following

  • Create a bridge network br0
  • Attach a dhcp server to br0 and sets the SoM address to 10.42.0.1
  • Create a WiFi 5 access point and set it up to start at boot
  • Bridge ethernet0 and the access point together
  • Prevent NetworkManager from managing either uap0 or mlan0

Now we can access the SoM at address 10.42.0.1 no matter if we’re connected via Ethernet or WiFi.

Thank you everyone for your help.
Kind regards,
Corentin.

Hello @c.azais ,
Thanks for the detailed explanation of your tests :slight_smile:
According to your last post, can we consider this topic as solved?

Best regards,
Josep