Toradex module and connmand does not obtain connectivity properly

Hello,

Connmand, attaching in some DHCP servers, Toradex module and connmand does not obtain connectivity properly

I have build connmand for Toradex module, generally following instructions in High performance, low power Embedded Computing Systems | Toradex Developer Center

Mostly everything seems to work well but when attaching Toradex module in some router devices and their DHCP server, connectivity is not obtained properly. When I attach Toradex module to our corporal network, everything goes well, but when I attach to my desktop routers (Telewell, TPlink), then eth0 is not configured up properly with connmand.

A short period, ifconfig does print tun6to4 interface and seems to have correct address but then it does hide. (seen below)

root@colibri-vf:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:2d:49:e0:2b  
          inet6 addr: fe80::214:2dff:fe49:e02b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST DYNAMIC  MTU:1500  Metric:1
          RX packets:23198 errors:0 dropped:14825 overruns:0 frame:0
          TX packets:4252 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2009139 (1.9 MiB)  TX bytes:422938 (413.0 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:54424 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54424 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3922697 (3.7 MiB)  TX bytes:3922697 (3.7 MiB)

tun6to4   Link encap:UNSPEC  HWaddr AC-A8-00-D4-00-00-00-00-00-00-00-00-00-00-00-00  
          inet6 addr: ::172.168.0.212/96 Scope:Compat
          inet6 addr: 2002:aca8:d4::1/64 Scope:Global
          UP RUNNING NOARP  MTU:1472  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:2 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


root@colibri-vf:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:2d:49:e0:2b  
          inet6 addr: fe80::214:2dff:fe49:e02b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST DYNAMIC  MTU:1500  Metric:1
          RX packets:23210 errors:0 dropped:14836 overruns:0 frame:0
          TX packets:4259 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2010111 (1.9 MiB)  TX bytes:423502 (413.5 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:54426 errors:0 dropped:0 overruns:0 frame:0
          TX packets:54426 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3922907 (3.7 MiB)  TX bytes:3922907 (3.7 MiB)

In settings file, everything seems to be correct:

cat /var/lib/connman/ethernet_00142d49e02b_cable/settings

[ethernet_00142d49e02b_cable]
Name=Wired
AutoConnect=true
Modified=2016-03-30T12:22:06.569600Z
IPv4.method=dhcp
IPv6.method=auto
IPv6.privacy=disabled
IPv4.netmask_prefixlen=24
IPv4.local_address=172.168.0.212
IPv4.gateway=172.168.0.254
IPv4.DHCP.LastAddress=172.168.0.212

If I explicitly write through dbus interface and tell connmand to use method dhcp, situation is corrected, and ip address is obtained, but this is not possible in every situation. So this need to work automatically.

I builded up a Buildroot environment also. With Buildroot, Connmand works perfectly in this kind of situation also.

There is three log files attached, they are catched up with dbus-monitor:

OEcoreCorporalNetwork.log: Toradex OE-core environment in a corporal network
OEcoreDesktopRouter.log: Toradex OE-core environment in a desktop router

OEcoreDesktopRouterKickStart.log: I wrote through dbus connmand to use method DHCP with eth0

BRCorporalNetwork.log: Buildroot environment in a corporal network
BRDesktopRouter.log: Buildroot environment in a desktop router

My question is, what to do? Is there some tip test?

BR Ossi Syri, Ouman Oylink text

What versions of Software do you use (our image version, and Connman? What is buildroot using)?

Can you try with IPv6 turned off?

connmanctl> services
*AR Wired                ethernet_00142d4b1c54_cable
connmanctl> config ethernet_00142d4b1c54_cable --ipv6 off

The issue you are seeing might be related to this commit: main: Disable 6to4 by default. This commit is part of connman 1.30, which will be used in our V2.6 release (available soon).

For some reason, connmanctl is not included in my deploy…

I have added this:

CORE_IMAGE_EXTRA_INSTALL += "connman"

But only connmand is included. I have needed to give my own commands through dbus.

Is there something to do to make connmanctl available? (Again, Buildroot includes it automatically)

Versions of connmand,

Yocto, OpenEmbedded:

root@colibri-vf:~# connmand -v
1.28

And in Buildroot:

# connmand -v
1.31

In a Buildroot environment,

config ethernet_00142d49c085_cable --ipv6 off

Gives next content to config file

# cat /var/lib/connman/ethernet_00142d49c085_cable/settings 
[ethernet_00142d49c085_cable]
Name=Wired
AutoConnect=true
Modified=1970-01-01T20:45:13.379486Z
IPv4.method=dhcp
IPv4.DHCP.LastAddress=172.168.0.102
IPv6.method=off
IPv6.privacy=disabled

As said, connmanctl is not available in Yocto/OpenEmbedded environment.

I manage to give command through dbus and also on Yocto/OpenEmbedded environment I manage to disable IPcv6:

root@colibri-vf:~# cat /var/lib/connman/ethernet_00142d49e02b_cable/settings 
[ethernet_00142d49e02b_cable]
Name=Wired
AutoConnect=true
Modified=2016-03-31T05:15:37.363472Z
IPv4.method=dhcp
IPv6.method=off
IPv6.privacy=disabled
IPv4.netmask_prefixlen=24
IPv4.local_address=172.168.0.212
IPv4.gateway=172.168.0.254
IPv4.DHCP.LastAddress=10.2.74.53

Situation with different kind of DHCP servers is same as in the beginning…

What to do in next phase?

I disabled IPv6 in a kernel and now working. Maybe I need to make IPv6 possible later but now going on with this.

Ok, since Buildroot is using the newer version which includes the fix I mentioned, I guess that is the reason you are not seeing the issue with Buildroot.

connmanctl is part of our standard image. It is part of the package connman-client (Yocto/OpenEmbedded tends to split binaries generated from one source file (recipe) into multiple packages in order to allow fine grained control over what binaries should get deployed. I use layers.openembedded.org to quickly browse to the recipe in question).

With our V2.6 release we will deploy connman 1.30 which should include the fix. With that, you should be able to use IPv6 and connman in connection with those routers.

Hello, thanks for your help!

I found this: …/stuff/openembedded-core/meta/recipes-connectivity/connman/connman_1.28.bb

Question: is there ready config files for v. 1.30 ?

You could backport the recipe for 1.30 from oe-core’s jethro branch.

Note that connmanctl is built when you build the connman recipe but split in its own package connman-client.
So adding connman-client to your image as we do it here will give you the CLI tool.

Hello,

I managed to backport Connman 1.31 and connman-client to our build. I am able to obtain events property, also IPv6 is fully managed, fine!

Now question, seems like unplugged ethernet interface is not able to manage through connmand:

connmanctl> services ethernet_00142d49c085_cable 
/net/connman/service/ethernet_00142d49c085_cable
  Type = ethernet
  Security = [  ]
  State = online
  Favorite = True
  Immutable = False
  AutoConnect = True
  Name = Wired
  Ethernet = [ Method=auto, Interface=eth0, Address=00:14:2D:49:C0:85, MTU=1500 ]
  IPv4 = [ Method=dhcp, Address=172.168.0.102, Netmask=255.255.255.0, Gateway=172.168.0.254 ]
  IPv4.Configuration = [ Method=dhcp ]
  IPv6 = [  ]
  IPv6.Configuration = [ Method=auto, Privacy=disabled ]
  Nameservers = [ 172.168.0.254 ]
  Nameservers.Configuration = [  ]
  Timeservers = [ 172.168.0.254 ]
  Timeservers.Configuration = [  ]
  Domains = [ home.gateway ]
  Domains.Configuration = [  ]
  Proxy = [ Method=direct ]
  Proxy.Configuration = [  ]
  Provider = [  ]
connmanctl> [ 1936.176093] fec 400d1000.ethernet eth0: Link is Down
[ 1936.281583] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

connmanctl> services ethernet_00142d49c085_cable 
Error ethernet_00142d49c085_cable: Method "GetProperties" with signature "" on interface "net.connman.Service" doesn't exist

connmanctl> 

Behaviour is same also with earlier version, this is, this bad behaviour is not due backporting version 1.31

This same behaviour also with dbus-send:

root@colibri-vf:~# dbus-send --system --dest=net.connman --print-reply /net/connman/service/$(basename /var/lib/connman/ethernet_*) net.connman.Service.GetProperties
method return sender=:1.3 -> dest=:1.14 reply_serial=2
   array [
      dict entry(
         string "Type"
         variant             string "ethernet"
      )
      dict entry(
         string "Security"
         variant             array [
            ]
      )

etc...

And when unplugged:

root@colibri-vf:~# [ 2737.240060] fec 400d1000.ethernet eth0: Link is Down
[ 2737.338030] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

root@colibri-vf:~# dbus-send --system --dest=net.connman --print-reply /net/connman/service/$(basename /var/lib/connman/ethernet_*) net.connman.Service.GetProperties
Error org.freedesktop.DBus.Error.UnknownObject: Method "GetProperties" with signature "" on interface "net.connman.Service" doesn't exist

In practice this means, we are not able to configure IPv4 settings when offline, we are not able to obtain configured values from connmand when cable unplugged and this makes our life very hard. This means, we are able to give new settings for device and we are able to obtain given values from connmand only when plugged in and this is not possible. Is there something to do?