Issue with connman in OSMC RC1 & RC2

I’ve updated my raspberry pi 2 (OSMC RC1 → OSMC RC2) and everything looked ok for a little while.

Anyway I had bind9 configured and had dns to point to itself on the RPi2 which worked fine until I updated and a little after that.

Anyway DNS at some point stopped working, dns queries would fail to the loopback IP which is when I then started to reconfigure OSMC Setting / Network Settings. I switched to static and back to DHCP, which was my original settings and noticed that /etc/resolv.conf was not being updated by connman, but I still had connectivity to the pi at this point.

I think I then disabled and re-enabled the interface and then I lost connectivity and I could not see any more the IP settings for the interface. As far as the OSMC Settings / Network plugin the wired interface was disconnected even when I know the cable was in and leds on the interface were on. Rebooted and the pi did not start with dhcp or a static IP.

I then logged in via the cli from keyboard and configured the interface with ifconfig eht0 commands, and I brought the interface back up as well as restored conectivity and dns, however when I reboot the pi it reboots without connectivity and I need to enable it via ifconfig. OSMC settings kodi plugin still shows interface disconnected and enabling it doesn’t really do anything except for flipping the status from disabled to wired interface not connected (or something along those lines).

I uninstalled the amr7 connman package and manually reinstalled it along with the OSMC-Network and Rpi2 Device deb package dependency but that didn’t really change anything.

Can somebody point me in the right direction? I also noticed that the connman setting file under the interface has the correct ip details, the last that worked but it’s really not used at boot it seems.

I also noticed that there are no connman scripts in /usr/lib/connman/ as for example documented here Set IP address to be static on the Beaglebone Black | derekmolloy.ie not sure if there were any before though.

Uninstalling the connman package is rather risky, unless you know how to manually bring up the ethernet interface…and as you discovered it will also uninstall the rpi2-device-osmc metapackage which will break updates in the future unless you reinstall it.

Your problem will be that connman is configured to run it’s own dns proxy listening on port 53 and this will be conflicting with your bind installation which will also be trying to listen on port 53. Have a look at the following script:

/usr/bin/start-network

Here you will see we start connman in two different ways - for NFS we disable the dns proxy with --nodnsproxy, (as well as tell it not to manage eth0) but for non-NFS installs we leave it enabled so connman runs a dns proxy and sets resolv.conf to 127.0.0.1.

You could add --nodnsproxy to the second instance of connmand and that should fix your problem, however future updates to the armv7-network-osmc package would overwrite your change and break your config again.

I can’t think of a simple solution to that off hand without us explicitly coding in a preference setting for dnsproxy.

Well I worked out the connman dependencies from http://46.37.189.135/osmc/apt/db/packages.db, in addition it does tell you what else it will be removed when you uninstall the package, anyway I thought it would be risky but I was a little desperate :slight_smile:

Ok so now I know why bind is failing, bind and OSMC dns proxy both try to listen on port 53, but I suppose what I need to know is if this is the issue that is tripping everything else under OSMC Settings / Network Setting Gui?

Is it also this what’s stopping connman from bringing the interfaces up with the dhcp or static IP settings as configured in the connman interface settings file?

As it stands I can’t manage any eth0 ip settings from OSMC Settings and I was just wondering if the dns conflict would cause the rest to fail as well.

Thanks for you help again.

You’re not using an NFS install are you ?

Configuring static IP’s for Ethernet should work fine and has been tested multiple times… do you still have problems with static IP’s if you disable bind ? Or if you make the change to disable dnsproxy ?

I’m not using an NFS install no, regular SD card…

I’ll try disabling bind and see if I re-gain OSMC Settings ability to configure DHCP or static IPs, and primarily if OSMC boots up with Network connectivity, I’ll update this thread when I get a chance to do it tonight.

BTW did you guys introduced the local DNS proxy in RC2? I ask cause my setup with bind was working just fine prior to the update to RC2.

No the dns proxy has been there from the start, however the networking GUI has had a lot of changes since RC1 so there is possibly a bug there. If you enable debug mode in Kodi, try to make your changes in the networking GUI then upload your Kodi log after the change has failed it may help give some insight.

By the way I’ve implemented a feature whereby you can permanently turn off the dnsproxy by editing the config file /etc/connman.prefs - this way it will not get turned back on again by an update, as directly editing the start-network script would.

There are certain advanced use scenarios were this would be useful/necessary. This change should appear in the next major set of updates.

Thanks, Much appreciated, I’ll use that in the next release, in the meanwhile I’ll disable it on /usr/bin/start-network, and on the next upgrade I’ll use /etc/connman.prefs new setting.

I’ll post the kodi.log later tonight as I believe I might have hit some other bug in OSMC Settings Networking Gui.

One more thing how can I force configure OSMC to use dhcp at boot without using the OSMC Settings Networking Gui to configure it.

I’m in a state where networking doesn’t start at boot.

Try connmanctl from the command line. (Type help for options)

services should show configured networks:

connmanctl> services
*AO Wired                ethernet_d063b4006a03_cable

A means it is configured for automatic connection, O means online. (Or R for ready if you have a local network connection but not internet)

If the A is missing you could try:

config ethernet_d063b4006a03_cable --autoconnect yes

Which will re-enable auto connect on that interface. Replace the long string of numbers with the one you see when you type services.

Super I’ll try that tonight. Again Thanks a lot for your help :slight_smile:

ok the issue seems that connman is trying to connect at boot but it can’t for some reason, (autoconnect is on however) hence when I get to kodi after boot I am Not Online. I disabled bind9 but it doesn’t seem to be related and as I said it was working fine before for more than a week.

This is what I did/checked:

I exited kodi and logged in with keyboard:

connmanctl services retunrned initially the following

connmanctl
connmanctl> services
*Ac Wired ethernet_b827ebc0a1af_cable

connmanctl> services ethernet_b827ebc0a1af_cable
/net/connman/service/ethernet_b827ebc0a1af_cable
Type = ethernet
Security = [ ]
State = online
Favorite = True
Immutable = False
AutoConnect = True
Name = Wired
Ethernet = [ Method=auto, Interface=eth0, Address=B8:27:EB:C0:A1:AF, MTU=1500 ]
IPv4 = [ ]
IPv4.Configuration = [ Method=dhcp ]
IPv6 = [ ]
IPv6.Configuration = [ Method=auto, Privacy=disabled ]
Nameservers = [ ]
Nameservers.Configuration = [ 192.168.1.1 ]
Timeservers = [ ]
Timeservers.Configuration = [ ]
Domains = [ example.domain.com ]
Domains.Configuration = [ ]
Proxy =
Proxy.Configuration = [ ]
Provider = [ ]

connmanctl> connect ethernet_b827ebc0a1af_cable
Error /net/connman/service/ethernet_b827ebc0a1af_cable: In progress

connmanctl> disconnect ethernet_b827ebc0a1af_cable
Disconnected ethernet_b827ebc0a1af_cable

connmanctl> connect ethernet_b827ebc0a1af_cable
Connected ethernet_b827ebc0a1af_cable

connmanctl> services ethernet_b827ebc0a1af_cable
/net/connman/service/ethernet_b827ebc0a1af_cable
Type = ethernet
Security = [ ]
State = online
Favorite = True
Immutable = False
AutoConnect = True
Name = Wired
Ethernet = [ Method=auto, Interface=eth0, Address=B8:27:EB:C0:A1:AF, MTU=1500 ]
IPv4 = [ Method=dhcp, Address=192.168.1.221, Netmask=255.255.255.0, Gateway=192.168.1.1 ]
IPv4.Configuration = [ Method=dhcp ]
IPv6 = [ ]
IPv6.Configuration = [ Method=auto, Privacy=disabled ]
Nameservers = [ 192.168.1.1 ]
Nameservers.Configuration = [ 192.168.1.1 ]
Timeservers = [ ]
Timeservers.Configuration = [ ]
Domains = [ example.domain.com ]
Domains.Configuration = [ ]
Proxy = [ Method=direct ]
Proxy.Configuration = [ ]
Provider = [ ]

exit
exit

back into kodi all working, I go to OSMC Settings Networking Gui and it looks fine now all settings there, Disable adapter from gui, turn it back on and blank again, show as not connected.

any idea what can I look at next?

do you want the logs with debugging on in kodi when I enable disable the interface from OSMC settings?

Thanks for the info. I can’t reproduce the problem myself but one of the other OSMC devs was already experiencing the same issue and can reproduce it.

As a test could you try making the following change: Edit /etc/connman.conf and change SingleConnectedTechnology from false to true. I don’t think this will be it, but this change will revert one of the very few changes we made to connman between RC1 and RC2. If it doesn’t fix it change it back again.

I just changed SingleConnectedTechnology from false to true rebooted and no difference.

Ok thanks for that. We’re investigating this issue to see if we can track down what changed and I’ll update this thread when we find the cause.

great thanks, in the meanwhile I’ll start it manually everytime.

The problem seems to be with the dhcp client failing to get an IP address - so a workaround is to assign static IP’s.

1 Like

Ok I’ve just tried, that’s right, set static ip from OSMC Settings and rebooted (got a said face and back to kodi) rebooted again (this time rebooted) and this time after reboot kodi was online, so for now this is good enough for me. I (had a static dhcp reservation) but static ip is the same thing.

Anyway FYI when I upgraded from RC1 → RC2 I had dhcp as well but it seemed it was working fine, the issue occured when I switched from DHCP to static and back to DHCP if I remember correctly.

by the way what is the purpose of enabling “Wait for Network”?

Unrelated to this issue. This is a problem with the DHCP client. The wait for network service is off by default anyway.

I understand that, he asked what the wait for network was.

Ok thanks for that, that may be a clue.

Wait for network delays Kodi (and some other network requiring services) until the network is actually up and has an IP address.

Normally Kodi will go ahead and load as soon as possible even if the network connection isn’t ready to minimise boot time but this can cause issues with things like a MySQL install where the network connection to the MySQL server must be running before Kodi starts.