Unable to set static ip for wlan0

I am using the release candidate version of osmc on rpi2.

I am trying to setup a static ip address for wlan0 within /etc/network/interfaces but this doesn’t appear to be working.
If I restart networking after logging in via ssh wlan0 comes up as needed.

With raspbmc, I remember having to change something to stop network manager configuring wlan0. Is there an equivalent within osmc I need to turn off/configure?

Does something else configure wlan0 during the boot process? how can I set a static ip address on wlan0 within osmc?

Any help appreciated.

Hi,

OSMC doesn’t use /etc/network/interfaces or network manager. It uses connman: https://01.org/connman

To set a static IP you would either use the networking GUI in OSMC settings, or use connmanctl from the command line.

Hi, I’m trying to setup hostapd on osmc, therefore I need to set a static ip address for the wlan0 - this worked fine via interfaces file with rapbmc.

Within Connmanctl when I type technologies it shows Ethernet and wifi, but when I type services it only shows AO Wired - Ethernet.

Does wifi need to be listed a service in order to set a static ip address within connmanctl?

Also, ifconfig doesn’t show wlan0 being up, although the adapter is recognised and shows correctly with iwconfig.

Apologies if these are basic questions, but never had to use connman before.

So, does wireless the appear in the OSMC networking settings page ?

You don’t need hostapd by the way - connman has built in Tethering support - check the tether command in connman’s help. You want a line something like:

tether wifi on SSID passphrase

Where SSID and passphrase are what you want your broadcasted network to be. This will share your Ethernet connect via Wifi.

The wireless adapter does appear in OSMC network settings. The driver is loaded as far as I can tell. If I restart networking service via the command line wlan0 is brought up with the static IP and hostapd works correctly.

Connman is doing some configuration with wlan0 which means when networking is configured during bootup I get a message saying wlan0 is already configured.

I managed to blacklist wlan0 in the /etc/connman,conf by adding the following line:

NetworkInterfaceBlacklist=wlan0

Doing this allows networking to work and brings up wlan0 with the static IP I have specified in interfaces, this in turn allows hostapd to work properly.

However, now that you’ve mentioned connman can handle tethering, I’d like to set this up instead :smile: Is there any beginners info on setting up connman, not really sure where to begin within connmanctl.

I’d like to use my wifi adapter as an accesspoint/hotspot. The Ethernet port on the rpi2 is connected to my router.

So I just went ahead and tried the tether command in commandctl and it worked! Thanks for the suggestion :smile:

tether wifi on test_ssid test_pass

Connman appears to setup the dhcp and nat settings automatically so no dhcp server or iptables needed which is nice and simple. I can’t see any way to tweak the settings though.

Hostapd does offer a lot more options for tweaking and setting up APs but for a simple wifi network connman seems to work well, saves a lot of installing and setup.

Is it possible to make the SSID hidden and also is it possible to bridge wifi and Ethernet properly so wifi clients get IP addresses via the DHCP server on my router instead of connman’s dhcp server?

I think the Tethering support in connman is fairly basic - what you see is what you get, without much option to customise it beyond it’s automatic DHCP/NAT set up, so if you need a more customised solution you may need to use hostapd after all.

I don’t know much about connman’s tethering feature to be honest - I have tested that it works (after reports on the forum that it wasn’t working) but haven’t spent any real time using it or attempted to customise it. Your best bet may be to search out the documentation for connman to see if there are any other options you can use…