Discussion:
Enable/disable Wi-Fi tethering when Wi-Fi dongle is not plugged in
(too old to reply)
Craig McQueen
2015-10-14 06:53:21 UTC
Permalink
I am working on a system where a USB dongle is used for Wi-Fi functionality. The Wi-Fi can be used in client or access point mode, configurable. However, it seems it's not possible to enable/disable tethering mode while the USB Wi-Fi device is not currently plugged in. E.g.:

# connmanctl tether wifi off
Error disabling wifi tethering: Method "SetProperty" with signature "sv" on interface "net.connman.Technology" doesn't exist

What options would there be for enabling/disabling tethering, while the Wi-Fi device is not currently plugged in?
--
Craig McQueen
Patrik Flykt
2015-10-14 08:01:28 UTC
Permalink
Post by Craig McQueen
I am working on a system where a USB dongle is used for Wi-Fi
functionality. The Wi-Fi can be used in client or access point mode,
configurable. However, it seems it's not possible to enable/disable
tethering mode while the USB Wi-Fi device is not currently plugged in.
# connmanctl tether wifi off
Error disabling wifi tethering: Method "SetProperty" with
signature "sv" on interface "net.connman.Technology" doesn't exist
What options would there be for enabling/disabling tethering, while
the Wi-Fi device is not currently plugged in?
If this dongle is the only WiFi device, removing it will cause the
technology to disappear as there are no devices this specific technology
is able to control. So no options for this, but see
TetheringTechnologies and PersistentTetheringMode in main.conf if the
use case is such that tethering state needs to be remembered.

Cheers,

Patrik
Craig McQueen
2015-10-15 02:37:38 UTC
Permalink
Post by Patrik Flykt
Post by Craig McQueen
I am working on a system where a USB dongle is used for Wi-Fi
functionality. The Wi-Fi can be used in client or access point mode,
configurable. However, it seems it's not possible to enable/disable
tethering mode while the USB Wi-Fi device is not currently plugged in.
# connmanctl tether wifi off
Error disabling wifi tethering: Method "SetProperty" with
signature "sv" on interface "net.connman.Technology" doesn't exist
What options would there be for enabling/disabling tethering, while
the Wi-Fi device is not currently plugged in?
If this dongle is the only WiFi device, removing it will cause the
technology to disappear as there are no devices this specific technology
is able to control. So no options for this, but see
TetheringTechnologies and PersistentTetheringMode in main.conf if the
use case is such that tethering state needs to be remembered.
I'm setting PersistentTetheringMode = true in /etc/connman/main.conf. I'm also providing an initial /var/lib/connman/settings which contains parameters for WiFi tethering enabled. So when a user plugs in a Wi-Fi USB dongle, it goes into tethering mode automatically.

However, when the Wi-Fi dongle is not plugged in, the D-Bus interface gives no indication that persistent tethering is enabled, and gives no ability to disable it.

Perhaps if persistent tethering mode is saved, then the technology should continue to be visible, albeit with some property that indicates hardware isn't available. E.g. Tethering = True, Powered = False, Hardware = False. Or something like that. Then it should be possible to at least disable the persistent tethering.

Similarly, I reckon it should be possible to see that configuration exists for a Wi-Fi network, and to remove it ("forget network"), even when the hardware isn't currently present or the network isn't currently detected. That is, all previously configured services should always appear in the list of services, with some property that indicates it isn't connected. E.g. Strength = 0, State = absent. Or something like that.

Another note: I notice that Connected = False when tethering is enabled and operational. I'm not sure what the rationale is for that, but perhaps that could be changed to Connected = True to clearly indicate when tethering is both enabled and operational.
--
Craig McQueen
Patrik Flykt
2015-10-19 07:43:12 UTC
Permalink
Hi,
Post by Craig McQueen
I'm setting PersistentTetheringMode = true in /etc/connman/main.conf.
I'm also providing an initial /var/lib/connman/settings which contains
parameters for WiFi tethering enabled. So when a user plugs in a Wi-Fi
USB dongle, it goes into tethering mode automatically.
However, when the Wi-Fi dongle is not plugged in, the D-Bus interface
gives no indication that persistent tethering is enabled, and gives no
ability to disable it.
There are exactly zero devices supporting WiFi, and there is also zero
knowledge of any possibly appearing at a later point either. So when
there are no devices of a certain technology, there is no point in
showing a technology that would somehow indicate something else...
Post by Craig McQueen
Perhaps if persistent tethering mode is saved, then the technology
should continue to be visible, albeit with some property that
indicates hardware isn't available. E.g. Tethering = True, Powered =
False, Hardware = False. Or something like that. Then it should be
possible to at least disable the persistent tethering.
Sorry, no. It will make everybody believe that hardware is
malfunctioning although it will never be present. A technology that
exists implies Hardware = true.
Post by Craig McQueen
Similarly, I reckon it should be possible to see that configuration
exists for a Wi-Fi network, and to remove it ("forget network"), even
when the hardware isn't currently present or the network isn't
currently detected. That is, all previously configured services should
always appear in the list of services, with some property that
indicates it isn't connected. E.g. Strength = 0, State = absent. Or
something like that.
Sorry, no. We have had this discussion before, and the Service API is by
definition showing existing services. It has been repeatedly asked from
people needing this kind of a features to specify a configuration API
where all the configured services can be listed. So far no proposals
have been received.
Post by Craig McQueen
Another note: I notice that Connected = False when tethering is
enabled and operational. I'm not sure what the rationale is for that,
but perhaps that could be changed to Connected = True to clearly
indicate when tethering is both enabled and operational.
Connected is defined to indicate that there is a service connected.

Cheers,

Patrik

Loading...