Even though there is a nice XBMC add-on to configure your WIFI settings, sometimes, you may still want to setup the WIFI connection for many reasons or just for fur.
OpenELEC use connman for managing connection to the various available network.
Setuping connman to connect to your protected WIFI network is an easy requiring you only to create a config file and enter some commands in a shell.
This guide was run using OpenELEC 4.0.1 which use internally
connman 1.21. It will
guide through all necessary steps to configure a connection to your WIFI
network. Once setup, OpenELEC will automatically re-connect on boot as long
as you keep the configuration in your storage.
Here we go!
connmandaemon is running:
ps faux | grep connmand
If you see something like below, then you are good to go:
OpenELEC:~ # ps faux | grep connmand 862 root 0:00 /usr/sbin/connmand -nr 1033 root 0:00 grep connmand
If you only see:
OpenELEC:~ # ps faux | grep connmand 1033 root 0:00 grep connmand
Then you will probably need to startup
connmand manually. Note that this
will not be persistent, i.e. it will not autostart next time you boot
connmand manually, do:
Ensures there is a network adapter for your WIFI card (or USB dongle or whatever):
You should see an adapter starting with
wlanin the list. Here the result of the command in my hardware:
eth0 Link encap:Ethernet HWaddr B8:27:EB:0F:01:A0 inet addr:192.168.0.115 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2307 errors:0 dropped:0 overruns:0 frame:0 TX packets:1268 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:320940 (313.4 KiB) TX bytes:159217 (155.4 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) wlan0 Link encap:Ethernet HWaddr 00:13:EF:20:01:8A UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
connmanctl enable wifi
connmanwill complain that wifi is already enabled, if it's the case, no problem, just move to next step.
connmancannot enable wifi, it probably means there is something fishy with your adapter (wrong linux driver maybe).
Scan for WIFI network nearby:
connmanctl scan wifi
This will scan nearby network available.
List found WIFI network:
This will list all known services. A services for
connmanis an available device for which is possible to connect to. This is not limited to WIFI and includes ehternet, bluetooth (if enabled) and more. Here the list I received when doing this command on my hardware:
*AR Wired ethernet_b827eb0f01a0_cable BELL825 wifi_0013ef20018a_42454c4c383235_managed_psk VIDEOTRON2188 wifi_0013ef20018a_564944454f54524f4e32313838_managed_psk bungie wifi_0013ef20018a_62756e676965_managed_psk Moth wifi_0013ef20018a_4d6f7468_managed_psk Maison wifi_0013ef20018a_4d6169736f6e_managed_psk GOAHEAD wifi_0013ef20018a_474f4148454144_managed_psk VIDEOTRON6117 wifi_0013ef20018a_564944454f54524f4e36313137_managed_psk VIDEOTRON4100 wifi_0013ef20018a_564944454f54524f4e34313030_managed_psk Nicolas wifi_0013ef20018a_4e69636f6c6173_managed_psk
As you can see, there is a bunch of them. All the one starting with
wifi_are WIFI network available to connect to. The suffix
_pskmeans it's a protected network.
If my case, the network I want to connect to is
Moth, so its service id assigned by
Create the configuration file to access the network.
connmanconfiguration files on
OpenELECare not at the usual location of
/var/lib/connman. In the
OpenELECdistribution, you must put your configuration file in
So, navigate to this directory and create a file with the pattern
<name>should be replaced with any name you think is useful to remember the network. In my case, I chose
<name>since it relates closely to the WIFI SSID name.
When the file is created, enter the following content in it using your favorite editor (
nanois the default one in
[global] Name = Moth Description = Moth Wifi service config file [service_wifi_moth] Type = wifi Name = Moth Passphrase = <passphrase>
This is the minimal configuration required (in fact, the
[global]section is not really necessary but useful to have).
[global]section, enter an identifier for the file in the
Namefield and a description of the network in the
Other section must always start with a
service_. What follows after is simply again another identifier which identity the network. In my case, I used the pattern
Then, in this section, the
Typeif the type of technology for the service which is
wifiin our case. The
Namerepresents the SSID network name with is
Mothin my case. And finally,
Passphraseis the password for the network, replace
<passphrase>with your own secret passphrase.
If you have an SSID name with special characters (like spaces or anything else), removed the
Nameline and put a line
SSID = <SSID_name_in_hex>instead. The value
<SSID_name_in_hex>should be replaced by the hex value of your SSID name which can obtained online with a service like . For example, for the network
Moth, the configuration file would look like this when using the
[global] Name = Moth Description = Moth Wifi service config file [service_wifi_moth] Type = wifi SSID = 4d6f7468 Passphrase = <passphrase>
There is more more configuration available but only those will suffice for you guide. Refer to the config file format for more information on the configuration file format (links to version 1.21 of
connmancorrectly sees your new settings.
For this, simply run:
connmanctl scan wifi connmanctl services
In the refreshed services list, there now should be a
A*just before the network you configured, this indicates that
connmanknows how to connect to this service:
*AR Wired ethernet_b827eb0f01a0_cable *A Moth wifi_0013ef20018a_4d6f7468_managed_psk BELL825 wifi_0013ef20018a_42454c4c383235_managed_psk bungie wifi_0013ef20018a_62756e676965_managed_psk Nicolas wifi_0013ef20018a_4e69636f6c6173_managed_psk Maison wifi_0013ef20018a_4d6169736f6e_managed_psk GOAHEAD wifi_0013ef20018a_474f4148454144_managed_psk VIDEOTRON2188 wifi_0013ef20018a_564944454f54524f4e32313838_managed_psk VIDEOTRON6117 wifi_0013ef20018a_564944454f54524f4e36313137_managed_psk VIDEOTRON4100 wifi_0013ef20018a_564944454f54524f4e34313030_managed_psk
If the network does not have the
*Abefore it, try restarting the
connmandaemon to force it to reload configuration files. First, obtain the
connmandpid by running:
ps faux | grep connmand
And then checking the first number if the result line.
It should restart automatically but if it's not the case:
When it have restarted, run another wifi scan and check if the services has the
Connect to the network
connmanctl connect wifi_0013ef20018a_4d6f7468_managed_psk
wifi_0013ef20018a_4d6f7468_managed_pskis the servie id reported by
connmanfor your network.
If everything went well, should then be connected to your protected WIFI network.
Voilà and enjoy Matt