Managing wifi using connman¶
ConnMan is a command-line network manager designed for use with embedded devices and fast resolve times. It is modular through a plugin architecture, but has native dhcp and ntp support.
Enabling and disabling wifi¶
To check if wifi is enabled you can run
and check for the line that says Powered: True/False.
To power the wifi on you can run
or if you need to disable it you can run
Connecting to an open access point¶
The commands in this section show how to run connmanctl in command mode.
To scan the network connmanctl accepts simple names called technologies. To scan for nearby wifi networks:
To list the available networks found after a scan run (example output):
MyNetwork wifi_dc85de828967_68756773616d_managed_psk
OtherNET wifi_dc85de828967_38303944616e69656c73_managed_psk
AnotherOne wifi_dc85de828967_3257495245363836_managed_wep
FourthNetwork wifi_dc85de828967_4d7572706879_managed_wep
AnOpenNetwork wifi_dc85de828967_4d6568657272696e_managed_none
Every wifi network is identified by a name composed as
To connect to an open network, look for wifi networks ending with _managed_none:
Network names can be tab-completed
You should now be connected to the network. Check using ip addr or run
Connecting to a protected access point¶
For protected access points you will need to provide some information to the ConnMan daemon, at the very least a password or a passphrase.
The commands in this section show how to run connmanctl in interactive mode, it is required for running the agent command. To start interactive mode simply type:
You then proceed almost as above, first scan for any wifi technologies:
To list services:
MyNetwork wifi_dc85de828967_68756773616d_managed_psk
OtherNET wifi_dc85de828967_38303944616e69656c73_managed_psk
AnotherOne wifi_dc85de828967_3257495245363836_managed_wep
FourthNetwork wifi_dc85de828967_4d7572706879_managed_wep
AnOpenNetwork wifi_dc85de828967_4d6568657272696e_managed_none
Now you need to register the agent to handle user requests. The command is:
You now need to connect to one of the protected services.
To do this easily, just use tab completion for the wifi_ service.
If you were connecting to OtherNET in the example above you would type:
The agent will then ask you to provide any information the daemon needs to complete the connection.
The information requested will vary depending on the type of network you are connecting to.
The agent will also print additional data about the information it needs as shown in the example below.
Agent RequestInput wifi_dc85de828967_38303944616e69656c73_managed_psk
Passphrase = [ Type=psk, Requirement=mandatory ]
Passphrase?
Provide the information requested, in this example the passphrase, and then type:
If the information you provided is correct you should now be connected to the protected access point.
Static IP Address¶
To use static IP address, run the following command after establishing a successful connection to AP
Settings¶
Settings and profiles are automatically created for networks the user connects to often.
They contain fields for the passphrase, essid and other information.
Profile settings are stored in directories under /var/lib/connman/ by their service name.
To view all network profiles run this command from root shell:
Using Multiple Network Interfaces¶
When using ethernet and Wi-Fi at the same time, create the following file to configure connman to connect both interfaces: