ConnMan

From Gentoo Wiki
Jump to:navigation Jump to:search


This article is a stub. You can help by expanding it.

ConnMan (short for Connection Manager) is a network management service created by Intel, built with embedded use cases in mind. It is shipped by default on some desktop and mobile distributions however, such as Sailfish OS.

Installation

USE flags

USE flags for net-misc/connman Provides a daemon for managing internet connections

bluetooth Enable Bluetooth Support
debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
ethernet Enable ethernet support.
examples Install examples, usually source code
iptables Use net-firewall/iptables as firewall.
iwd Enable wifi support via net-wireless/iwd
l2tp Use net-dialup/xl2tpd for L2TP VPN support.
networkmanager Enable net-misc/networkmanager support
nftables Use net-firewall/nftables as firewall.
ofono Use net-misc/ofono for telephony support.
openconnect Use net-vpn/openconnect for VPN support.
openvpn Use net-vpn/openvpn for openvpn support.
policykit Enable PolicyKit (polkit) authentication support
pptp Use net-dialup/pptpclient for PPTP VPN support.
tools Enable testing tools.
vpnc Use net-vpn/vpnc for cisco VPN support.
wifi Enable wireless network functions
wireguard Enable WireGuard VPN support.
wispr Enable support for WISPr hotspot logins.

Make sure to enable the proper USE flags for what you plan to use ConnMan for. If this is a mobile device and you want mobile data support, make sure to enable the ofono USE flag.

Emerge

root #emerge --ask net-misc/connman

Configuration

Services

Note
Having multiple network management utilities running at the same time (NetworkManager, dhcpcd, etc) is not a good idea. However, ConnMan can be configured to not touch WiFi/Ethernet so it can play nice with these other programs, see the bottom of this article.

OpenRC

To enable ConnMan at boot:

root #rc-update add connman default

To start ConnMan now:

root #rc-service connman start

systemd

To enable ConnMan at boot and start it now:

root #systemctl enable --now connman

Usage

connmanctl is an interactive CLI application that comes installed with ConnMan. Make sure connmand has been started, either manually or through the init system, or ConnMan will be unable to function.

connmanctl can be launched with no arguments to enter interactive mode, or a command can be specified after it (useful for scripting!)

Connecting to a network

Listing available technologies

user $connmanctl technologies

Should list the available networking technologies for ConnMan, such as /net/connman/technology/wifi (WiFi support). If you don't see the technology you're looking for, make sure it was set in ConnMan's USE flags, and that support for the network interface is built into the device's kernel.

Powering on the selected technology interface

user $connmanctl enable wifi

Replace wifi with a network interface technology as desired.

Scanning wireless networks

user $connmanctl scan wifi

"Scan completed for wifi" should return when scanning is done.

Showing available services

user $connmanctl services

This outputs all available services, no matter if WiFi, Ethernet, or other. If the device is connected to the network, *AO is in the leftmost column, followed by the SSID in the next, and then followed by a unique identifier. This unique identifier is needed to connect to the network.

Enabling connecting to an encrypted network

user $connmanctl agent on

Connect to a network

Tip
Tab completions are functional in interactive mode!
user $connmanctl connect your_unique_identifier

Fill in the unique identifier from what is after your network name from services. If connecting to a wired or unsecured network, no further action is needed. If connecting to a network with a passphrase, enter it when prompted. Note: Double check your password! ConnMan can often be annoying and not re-prompt for incorrect passwords.

Testing a connection

To reveal the connection to the Local Area Network (LAN):

user $connmanctl state

And of course to test connection to the internet:

user $ping gentoo.org

Graphical front-ends

CMST

CMST is a Qt graphical front-end for ConnMan, and comes with a system tray icon. See net-misc/cmst.

EConnMan

EConnMan is the ConnMan UI that's part of the Enlightenment desktop environment. See net-misc/econnman.

Troubleshooting

ConnMan is throwing some cryptic error I can't find a reference to online!

It's most likely lack of kernel support for the device's WiFi card. Make sure if built as a module it's loaded and that dmesg isn't complaining about a load error.

You can also try using Gentoo's distribution kernel to see if that gets your network card going. If so, run lsmod with and without the distribution kernel and diff the results to view the kernel drivers that were in use with the distribution kernel that weren't with whichever you were running originally.

How to use ConnMan along with NetworkManager/dhcpcd?

FILE /etc/connman/main.conf
NetworkInterfaceBlacklist = usb,wlan

Obviously, change the interface names to those that you wish to blacklist with ConnMan. This allows another service to manage those connections, while utilizing ConnMan for other network interfaces (ie, ofono, bluetooth). If connected via SSH to your device, this should be done first to prevent ConnMan closing the SSH tunnel.

Error: no carrier

In my experience, this means that there isn't proper firmware support for the technology. However, this error can also be caused by improper permissions. Try adding your user to the wheel and network groups, or run connmanctl as root.

See also