3

I am creating a USB gadget with Yocto, which loads the gadget kernel modules and is recognized by my host as a network interface (usb0). On the gadget, I have connman installed and running. I am using the default configuration (no /etc/connman/main.conf), though I have tried to manually enable the gadget in /var/lib/connman/settings:

~# cat /var/lib/connman/settings
[global]
OfflineMode=false

[Gadget]
Enable=true
Tethering=true

However, when I try to get an IP from the host (with e.g. dhcpcd usb0), it does not seem to find a DHCP server, and I get an IPv4LL instead. The journalctl of my host looks like this:

avahi-daemon[812]: Registering new address record>
dhcpcd[875]: usb0: soliciting an IPv6 router
dhcpcd[875]: usb0: soliciting a DHCP lease
dhcpcd[875]: usb0: probing for an IPv4LL address
dhcpcd[875]: usb0: using IPv4LL address 169.254.1>
avahi-daemon[812]: Joining mDNS multicast group o>
avahi-daemon[812]: New relevant interface usb0.IP>
dhcpcd[875]: usb0: adding route to 169.254.0.0/16
avahi-daemon[812]: Registering new address record>
dhcpcd[875]: usb0: no IPv6 Routers available

Note that on the gadget, I created a service profile to give an IP to the usb0 interface, which gets:

3: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP8000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 66:7e:25:f1:3d:cf brd ff:ff:ff:ff:ff:ff
    inet 10.42.0.2/24 brd 10.42.0.255 scope global usb0
       valid_lft forever preferred_lft forever
    inet6 fe80::647e:25ff:fef1:3dcf/64 scope link 
       valid_lft forever preferred_lft forever

This is the service config:

[service_gadget]
Type = gadget
IPv4 = 10.42.0.2/255.255.255.0/10.42.0.1

What could I be missing for Connman to start a DHCP server and successfully assign an IP to the host usb0 interface when it asks for one?

1
  • 1
    BTW there is really something I don't get: yocto, connman and networkmanager do exist as tags on stackoverflow, but still everytime I ask a question about them, it gets downvoted. Though I see tons of questions about configuring nginx and similar that are not directly about programming, and those are not downvoted/closed. Is that because nginx is more used by developers, and yocto is not? In that case, shouldn't the yocto tag be removed completely from SO? And what about all the questions about using git or docker in CLI? Commented Feb 20, 2021 at 18:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.