Leon Anavi
IT Tips && Tricks

Mobile & Embedded

Created: 03.09.2025 06:11 Last Modified: 03.09.2025 21:42 Views: 36
Keywords: connman, connmanctl, Linux, openembedded, RaspberryPi, rpi, rpi5, Wi-Fi, yocto

The Yocto Project on Raspberry Pi 5 Episode 8: Connecting to Wi-Fi with ConnMan Network Manager

ConnMan (short for Connection Manager) is an open-source, command-line network manager tailored for embedded Linux devices. It focuses on fast connection handling and low-latency resolution times, making it especially suitable for resource-constrained environments such as IoT gateways, development boards, and automotive systems. Unlike heavier alternatives such as NetworkManager, ConnMan is designed with a small footprint and minimal dependencies, which allows it to run efficiently on systems with limited memory and storage.

First released in 2008, ConnMan is written in C, licensed under the GNU GPL, and its source code is hosted on kernel.org. It was originally developed by Intel Open Source Technology Center with the goal of providing a modular, lightweight, and extensible framework for managing various types of network connections. ConnMan supports a wide range of networking technologies, including Ethernet and Wi-Fi.

Episode 8 of my Yocto Project and OpenEmbedded tutorial series shows how to add ConnMan to core-image-base and use it to scan for and connect to a Wi-Fi network on the Raspberry Pi 5.

Using ConnMan

1. Bring up the Wi-Fi interface wlan0:

rfkill unblock wifi
ip link set wlan0 up

2. Start the ConnMan CLI:

connmanctl

3. Enable Wi-Fi:

technologies
enable wifi

4. Scan for available Wi-Fi networks:

scan wifi

5. List discovered networks (note the service name like wifi_[MAC_ADDR]_[SSID_HEX]_managed_psk):

services

6. Turn on the agent (to handle prompts like passwords):

agent on

7. Connect to your Wi-Fi network:

connect wifi_[MAC_ADDR]_[SSID_HEX]_managed_psk

8. Enter the Wi-Fi password when prompted:

Agent RequestInput wifi_[MAC_ADDR]_[SSID_HEX]_managed_psk
Passphrase = [ Type=psk, Requirement=mandatory ]
Passphrase?

Troubleshooting

To bring up the Wi-Fi interface automatically at boot on embedded Linux distributions that use systemd, create the file /etc/systemd/network/10-wlan0.network with the following content:

[Match]
Name=wlan0
[Network]
DHCP=yes


  Home | About | Contact | Disclaimer | Sitemap © 2009-2022 Leon Anavi. All rights reserved.