Hi Patrik,

On 10/13/2015 10:21 AM, Patrik Flykt wrote:

>       Hi,
>
> On Mon, 2015-10-12 at 14:26 +0000, John Ernberg wrote:
>
>> I'm using Connman in an embedded environment where a device will connect
>> to us over USB, this device will provide an ethernet interface on the
>> USB port, and the device will be in gadget mode.
>> Thus when they connect to us we load the cdc_ether driver and create an
>> Ethernet interface over the USB port.
>>
>> Being completely new to tethering in Connman and how it works, I'm
>> having some issues setting up Connman to provide a DHCP server on this
>> interface so the other device will receive an IP automatically once it
>> starts a DHCP client.
> If I understood the above thing correctly, ConnMan runs on a device that
> has a USB client and ConnMan needs to set up a DHCP server on it?

ConnMan runs on the embedded system, which is the USB host side.
And when an USB gadget connects, I want to start a DHCP server on the interface 
provided by cdc_ether
so that the USB gadget that connects can receive an IP by using a DHCP client.

> This
> is achieved by ensuring that both 'gadget' technology and 'gadget'
> tethering are enabled. Also verify that the interface is not listed
> in /etc/connman/main.conf NetworkInterfaceBlacklist option and that
> 'gadget' is either listed in TetheringTechnologies or
> TetheringTechnologies is unset.

I ensured that this is already configured as suggested in the 
/etc/connman/main.conf.

>
> Now that the 'gadget' technology has been enable once, ConnMan will
> remember its enabled state over reboots. With that in mind, one can then
> set PersistentTetheringMode to true in /etc/connman/main.conf. This
> preserves tethering state for all technologies over reboot, including
> 'gadget'.

I have parts of the file system as read only, so ConnMan does not remember 
things between reboots.

>
> If it is the opposite, i.e. ConnMan runs on the USB host end, the
> procedure is the same, but the technology is instead 'ethernet'. This
> affects the all ethernet devices on the machine, as USB ethernet dongles
> are indistinguishable from internal PCI connected ones.

This is configured as well in the /etc/connman/main.conf

>
> The networks that show up as services are the ones where ConnMan is a
> end host/client. Tethering creates a local network bridge, 'tether', and
> starts a DHCP server on it. The tethered network does not show up as a
> service, as it is not an upstream connection.

Ok, got it. I found the tether interface, the USB gadget side does not receive 
an IP however.
Could this be caused by that we do not always have any other active connections?
I.e. should this be done differently if I want to have a connection that is 
end-to-end, without bridging?

>
>> I have googled and read the documentation but I cannot figure out how to
>> do this properly.
>> The current method on the server side is to enable the gadget-technology
>> when it shows up, configure an IP, netmask and gateway, and then enable
>> tethering on it. Which results in the services not being listable, and
>> no IP being given to the other side. If I run ifconfig on my side, the
>> interface is up, but unconfigured.
> Here I lost track of which device is which. Please check the above and
> see if that fixes your problem.
>
> Cheers,
>
>       Patrik
>
> _______________________________________________
> connman mailing list
> connman@connman.net
> https://lists.connman.net/mailman/listinfo/connman

Thank you and best regards // John Ernberg
_______________________________________________
connman mailing list
connman@connman.net
https://lists.connman.net/mailman/listinfo/connman

Reply via email to