MCM-iMX95 Yocto Linux: WiFi

From Compulab Mediawiki
Jump to: navigation, search

WiFi

The SBC features 802.11ax WiFi and Bluetooth 5.3 BLE by Ezurio Sona™ NX611.
To use the WiFi, please ensure that WiFi antenna is connected to RF connector J2 (2-5G).
The NetworkManager can be used to manage WiFi interface.

Enable/Disable WiFi Interface

  • To enable WiFi interface:
nmcli radio wifi on
  • To disable WiFi interface:
nmcli radio wifi off

Network Scanning

  • Sample WiFi scanning:
nmcli dev wifi list

The output will show the list of Access Points and Ad-Hoc cells in range.

Connecting to Access Point

In the following example:

  • Replace <SSID> with the actual AP network name, system will prompt for the password:
nmcli device wifi connect <SSID> -ask name WifiCon
  • Show the connection status:
nmcli connection show
  • Disconnect wireless network:
nmcli connection down WifiCon
  • Connect wireless network again:
nmcli connection up WifiCon

Creating Access Point

Admolition note.png Debian 12
ipv4 forwarding must be turned on manually
  • Prepare routing:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i uap0 -o eth0 -j ACCEPT
iptables-save > /etc/iptables/iptables.rules
  • Enable port forwarding:
sed -i 's/^#\(net.ipv[4,6].*forward\)/\1/' /etc/sysctl.conf
nmcli radio wifi on
  • In the following example Replace <SSID> and <PASSWORD> with desired access point parameters:
nmcli device wifi hotspot ssid <SSID> password <PASSWORD> con-name HotspotCon ifname uap0
  • Disable wireless AP:
nmcli connection down HotspotCon
  • Enable wireless AP again:
nmcli connection up HotspotCon