Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."

Today's Topics:

   1. Re: wifi AP disconnect(disconnect reason code 1) (Daniel Wagner)
   2. Re: Why can't connman automatically enable and connect to cellular 
network interface?
      (Daniel Wagner)
   3. Re: [PATCH v2 0/3] Simplify settings save code (Daniel Wagner)
   4. Re: How to set up cellular.config with AccessPointName?
      (Daniel Wagner)
   5. connman settings for modem APN (nick83ola)
   6. Re: connman settings for modem APN (Daniel Wagner)
   7. [PATCH v2 00/10] Update iwd plugin (Daniel Wagner)
   8. [PATCH v2 01/10] iwd: Parse SupportedModes from adapter proxy
      (Daniel Wagner)
   9. [PATCH v2 02/10] iwd: Update device object (Daniel Wagner)


----------------------------------------------------------------------

Date: Tue, 7 Jan 2020 09:04:19 +0100
From: Daniel Wagner <[email protected]>
Subject: Re: wifi AP disconnect(disconnect reason code 1)
To: Deepu Paul <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Hi Deepu,

On Mon, Jan 06, 2020 at 12:22:31PM +0000, Deepu Paul wrote:
> Hi Daniel,
> 
> The previous mail got bounced back as the attachment  size was greater than
> 500kb .
> 
> Attaching the logs again.

Thanks for the logs. Really helpful.

> one thing i am noticing is every-time during disconnect, there is
> a (Reason: 3=DEAUTH_LEAVING)[line 6790] during the re association
> after (Reason: 1=UNSPECIFIED)[line 5752].

IIRC, deauth leaving means the local device has decided to leave the
network. Though this doesn't make any difference for ConnMan. It's the
same code path. Only reason code 6 is handled differently.

> I am not sure if this is the issue with wpa_supplicant, can you please
> check the logs and let me know if this is initiated by the wpa_supplicant?

>From you previous email:

> In the second one it failed, in this scenario i don't see the interface state 
> change to 2(disconnected), in this case the state  change is (4, 5, 6, 8, 10)
> and seeing the message  "Probably roaming right now! Staying connected..."

That is what I suspected. So wpa_supplicant doesn't tell us excactly
what it is doing. Suddenldy we see state transitions and we have to
guess what's happending.

But then we get a new message which it the disconnect reason:

connmand[3595]: ../connman-1.37/src/rtnl.c:rtnl_message() NEWLINK len 72 type 
16 flags 0x0000 seq 0 pid 0
connmand[3595]: 
../connman-1.37/gsupplicant/supplicant.c:signal_interface_changed()
connmand[3595]: ../connman-1.37/gsupplicant/supplicant.c:interface_property() 
DisconnectReason
connmand[3595]: ../connman-1.37/gsupplicant/supplicant.c:signal_bss_removed()
connmand[3595]: 
../connman-1.37/gsupplicant/supplicant.c:update_network_signal() New network 
signal -90
connmand[3595]: ../connman-1.37/plugins/wifi.c:network_removed() name purpleline

Could it be, whenever it works you don't get an disconnect reason
after we assume wpa_supplicant is roaming?

Thanks,
Daniel

------------------------------

Date: Tue, 7 Jan 2020 09:15:05 +0100
From: Daniel Wagner <[email protected]>
Subject: Re: Why can't connman automatically enable and connect to
        cellular network interface?
To: JH <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Hi JH,

On Mon, Jan 06, 2020 at 08:57:04PM +1100, JH wrote:
> I looked back your advice that "any new cellular network would
> autoconnect without interaction of the user", could you elaborate how
> I can set up new cellular network for autoconnect?

autoconnect is a policy. I don't want to hardcode this, because for
some users, they want autoconnect out of the box, while others
don't. So far the approach we have in ConnMan is only do something
when we have an user telling us to do it.

> I have recently changed SIM and also cellular network, the original
> SIM used Telstra cellular network, I defined Name = Telstra in
> cellular.config, that worked fine.
> 
> Now I changed the SIM to Aeris, it does not have MNO but using ASN =
> iot-eu.aer.net, everything stopped working.
> 
> I am always wondering why I should define cellular network name in
> cellular.config, but apparently that is not an option, without the
> cellular network name in cellular.config, it just could noit work.

I'm sorry, I don't understand what you are saying.

> Why can't connman and ofono automatically connecting to cellular network
> based on SIM and network registration?

As I said, it's not impossible but rather a policy thing. I am not
against getting things sorted out that autoconnect works. But don't
expect me to do it.

Thanks,
Daniel

------------------------------

Date: Tue, 7 Jan 2020 09:23:56 +0100
From: Daniel Wagner <[email protected]>
Subject: Re: [PATCH v2 0/3] Simplify settings save code
To: Thomas Green <[email protected]>
Cc: "[email protected]" <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Hi Tom,

On Mon, Jan 06, 2020 at 08:59:30PM +0000, Thomas Green wrote:
> Sorry I was out so long.  I was having shoulder surgery.  I'm back now.

Uhh, hope it wasn't too bad. Speedy recovy!

> I've applied this patch and testing it in the use case we were looking at.

Thanks for giving the patches a try.

> Now, when at the end of the use case, the settings file for the ethernet
> controller have
> 
> IPv4.method=manual

Uh, that's the only thing in the settings file left?

> But have saved none of the IPv4 information, so any attempt to reconnect
> to the ethernet fails with an Input/Output error.

Alright, so that explains something. The other settings were also lost
but we only the gateway differently. In fact all the manual config
get's lost.

> Any clues where to go to from here?

IIRC, the steps are

1) service configure manual
2) disconnect service
3) reconnect service

?

Thanks,
Daniel

------------------------------

Date: Tue, 7 Jan 2020 09:30:18 +0100
From: Daniel Wagner <[email protected]>
Subject: Re: How to set up cellular.config with AccessPointName?
To: JH <[email protected]>
Cc: connman <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

Hi,

On Mon, Jan 06, 2020 at 06:54:04PM +1100, JH wrote:
> I cannot find any document for cellular.config syntax, can I I set up
> AccessPointName in cellular.config?

Provisioning and configuration happends in oFono.

> I tried following file, it did not work, I know if I have a correct
> Name = <SIM service provider>, it will work, but i don't know the name
> of the service provider, I only knows the AccessPointName for Aeris
> which I think that APN is a gateway to connect to its network.

Name is just a string for identifying the service. ConnMan doesn't use
the Name at all. The Name appears in just in the D-Bus interface.

> $ vi /var/lib/connman/cellular.config
> 
> [global]
> Name = cellular
> Description = Cellular
> 
> [service_cellular]
> Type = cellular
> AccessPointName = iot-eu.aer.net

APN provisioning is done in oFono.

Thanks,
Daniel

------------------------------

Date: Tue, 7 Jan 2020 16:38:47 +0000
From: nick83ola <[email protected]>
Subject: connman settings for modem APN
To: Daniel Wagner <[email protected]>
Cc: [email protected]
Message-ID:
        <cabph3umvrjhzogsntvvwcncohh4jkz44xcf+3eed8zxl+ca...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

Hi Daniel,

I have to manage a modem with connman through dbus and I'm willing to
work on the ofono plugin to add the APN handling but I'm not familiar
with connman code.

Connman is already creating a ofono internet context by default for
the modem but it doesn't offer the possibility to configure the APN
(and user/password) for the connection.

Where you would put the dbus method to set the APN for a particular
connection? I would prefer if possible only to connect to connman not
connman/ofono.

Thanks
Nicola Lunghi

------------------------------

Date: Tue, 7 Jan 2020 18:05:26 +0100
From: Daniel Wagner <[email protected]>
Subject: Re: connman settings for modem APN
To: nick83ola <[email protected]>
Cc: [email protected], "[email protected]" <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed

Hi,

On 07.01.20 17:38, nick83ola wrote:
> I have to manage a modem with connman through dbus and I'm willing to
> work on the ofono plugin to add the APN handling but I'm not familiar
> with connman code.
> 
> Connman is already creating a ofono internet context by default for
> the modem but it doesn't offer the possibility to configure the APN
> (and user/password) for the connection.

Correct.

> Where you would put the dbus method to set the APN for a particular
> connection? 

See oFono documentation on Connection Context.

> I would prefer if possible only to connect to connman not
> connman/ofono.

/*
  * The way this plugin works is following:
  *
  *   powered -> SubscriberIdentity or Online = True -> gprs, context ->
  *     attached -> netreg -> ready
  *
  * Depending on the modem type, this plugin will behave differently.
  *
  * GSM working flow:
  *
  * When a new modem appears, the plugin always powers it up. This
  * allows the plugin to create a connman_device. The core will call
  * modem_enable() if the technology is enabled. modem_enable() will
  * then set the modem online. If the technology is disabled then
  * modem_disable() will just set the modem offline. The modem is
  * always kept powered all the time.
  *
  * After setting the modem online the plugin waits for the
  * ConnectionManager and ConnectionContext to appear. When the context
  * signals that it is attached and the NetworkRegistration interface
  * appears, a new Service will be created and registered at the core.
  *
  * When asked to connect to the network (network_connect()) the plugin
  * will set the Active property on the context. If this operation is
  * successful the modem is connected to the network. oFono will inform
  * the plugin about IP configuration through the updating the context's
  * properties.
[...]

I have only a vague memory on this topic, but I think to remember that 
oFono will only show the CM if the APN was provisioned in oFono. Maybe I 
have false memory on it.

Thanks,
Daniel

------------------------------

Date: Tue,  7 Jan 2020 19:51:07 +0100
From: Daniel Wagner <[email protected]>
Subject: [PATCH v2 00/10] Update iwd plugin
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Message-ID: <[email protected]>

Still WIP

changes since v1:
 - Added manual scan suppprt
 - Added tethering support
 - Fixed handling of KnownNetwork when disconnecting

Daniel Wagner (10):
  iwd: Parse SupportedModes from adapter proxy
  iwd: Update device object
  iwd: Add KnownNetwork support
  iwd: Add KnownNetwork property to struct iwd_network
  iwd: Add Station API support
  iwd: Add AdHoc API support
  iwd: Add AccessPoint API support
  iwd: Re-add update_signal_strenght()
  iwd: Hookup manual scan trigger
  iwd: Add support for tethering

 plugins/iwd.c | 862 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 789 insertions(+), 73 deletions(-)

-- 
2.24.1

------------------------------

Date: Tue,  7 Jan 2020 19:51:08 +0100
From: Daniel Wagner <[email protected]>
Subject: [PATCH v2 01/10] iwd: Parse SupportedModes from adapter proxy
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Message-ID: <[email protected]>

The daemon supports more several operation modes. Extract the
information and store it in struct iwd_adapter.
---
 plugins/iwd.c | 46 ++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 44 insertions(+), 2 deletions(-)

diff --git a/plugins/iwd.c b/plugins/iwd.c
index ddc9201d03bc..4850dbf553a4 100644
--- a/plugins/iwd.c
+++ b/plugins/iwd.c
@@ -61,6 +61,9 @@ struct iwd_adapter {
        char *vendor;
        char *model;
        bool powered;
+       bool ad_hoc;
+       bool station;
+       bool ap;
 };
 
 struct iwd_device {
@@ -100,6 +103,27 @@ static const char *proxy_get_string(GDBusProxy *proxy, 
const char *property)
        return str;
 }
 
+static GSList *proxy_get_strings(GDBusProxy *proxy, const char *property)
+{
+       DBusMessageIter array, entry;
+       GSList *list = NULL;
+
+       if (!g_dbus_proxy_get_property(proxy, property, &array))
+               return NULL;
+
+       dbus_message_iter_recurse(&array, &entry);
+
+       while (dbus_message_iter_get_arg_type(&entry) == DBUS_TYPE_STRING){
+               const char *val;
+
+               dbus_message_iter_get_basic(&entry, &val);
+               list = g_slist_prepend(list, g_strdup(val));
+               dbus_message_iter_next(&entry);
+       }
+
+       return list;
+}
+
 static bool proxy_get_bool(GDBusProxy *proxy, const char *property)
 {
        DBusMessageIter iter;
@@ -725,6 +749,7 @@ static void create_adapter(GDBusProxy *proxy)
 {
        const char *path = g_dbus_proxy_get_path(proxy);
        struct iwd_adapter *iwda;
+       GSList *modes, *list;
 
        iwda = g_try_new0(struct iwd_adapter, 1);
 
@@ -748,8 +773,25 @@ static void create_adapter(GDBusProxy *proxy)
        iwda->model = g_strdup(proxy_get_string(proxy, "Model"));
        iwda->powered = proxy_get_bool(proxy, "Powered");
 
-       DBG("%s vendor '%s' model '%s' powered %d", path, iwda->vendor,
-               iwda->model, iwda->powered);
+       modes = proxy_get_strings(proxy, "SupportedModes");
+       for (list = modes; list; list = list->next) {
+               char *m = list->data;
+
+               if (!m)
+                       continue;
+
+               if (!strcmp(m, "ad-hoc"))
+                       iwda->ad_hoc = true;
+               else if (!strcmp(m, "station"))
+                       iwda->station = true;
+               else if (!strcmp(m, "ap"))
+                       iwda->ap = true;
+       }
+       g_slist_free_full(modes, g_free);
+
+       DBG("%s vendor '%s' model '%s' powered %d ad-hoc %d station %d ap %d",
+               path, iwda->vendor, iwda->model, iwda->powered,
+               iwda->ad_hoc, iwda->station, iwda->ap);
 
        g_dbus_proxy_set_property_watch(iwda->proxy,
                        adapter_property_change, NULL);
-- 
2.24.1

------------------------------

Date: Tue,  7 Jan 2020 19:51:09 +0100
From: Daniel Wagner <[email protected]>
Subject: [PATCH v2 02/10] iwd: Update device object
To: [email protected]
Cc: Daniel Wagner <[email protected]>
Message-ID: <[email protected]>

iwd moved the scanning property from the device API to a new
API. Therefore just drop it here and add back when we introduce the
new station API.

Add the device mode property which tells us how the device is
operated.
---
 plugins/iwd.c | 102 +++++---------------------------------------------
 1 file changed, 10 insertions(+), 92 deletions(-)

diff --git a/plugins/iwd.c b/plugins/iwd.c
index 4850dbf553a4..7222dd80e89d 100644
--- a/plugins/iwd.c
+++ b/plugins/iwd.c
@@ -73,7 +73,7 @@ struct iwd_device {
        char *name;
        char *address;
        bool powered;
-       bool scanning;
+       char *mode;
 
        struct connman_device *device;
 };
@@ -388,85 +388,6 @@ static struct connman_technology_driver tech_driver = {
        .remove         = cm_tech_remove,
 };
 
-static unsigned char calculate_strength(int strength)
-{
-       unsigned char res;
-
-       /*
-        * Network's maximum signal strength expressed in 100 * dBm.
-        * The value is the range of 0 (strongest signal) to -10000
-        * (weakest signal)
-        *
-        * ConnMan expects it in the range from 100 (strongest) to 0
-        * (weakest).
-        */
-       res = (unsigned char)((strength * -10000) / 100);
-
-       return res;
-}
-
-static void _update_signal_strength(const char *path, int16_t signal_strength)
-{
-       struct iwd_network *iwdn;
-
-       iwdn = g_hash_table_lookup(networks, path);
-       if (!iwdn)
-               return;
-
-       if (!iwdn->network)
-               return;
-
-       connman_network_set_strength(iwdn->network,
-                                       calculate_strength(signal_strength));
-}
-
-static void ordered_networks_cb(DBusMessage *message, void *user_data)
-{
-       DBusMessageIter array, entry;
-
-       DBG("");
-
-       if (!dbus_message_iter_init(message, &array))
-               return;
-
-       if (dbus_message_iter_get_arg_type(&array) != DBUS_TYPE_ARRAY)
-               return;
-
-       dbus_message_iter_recurse(&array, &entry);
-       while (dbus_message_iter_get_arg_type(&entry) == DBUS_TYPE_STRUCT) {
-               DBusMessageIter value;
-               const char *path, *name, *type;
-               int16_t signal_strength;
-
-
-               dbus_message_iter_recurse(&entry, &value);
-
-               dbus_message_iter_get_basic(&value, &path);
-
-               dbus_message_iter_next(&value);
-               dbus_message_iter_get_basic(&value, &name);
-
-               dbus_message_iter_next(&value);
-               dbus_message_iter_get_basic(&value, &signal_strength);
-
-               dbus_message_iter_next(&value);
-               dbus_message_iter_get_basic(&value, &type);
-
-               _update_signal_strength(path, signal_strength);
-
-               dbus_message_iter_next(&entry);
-       }
-}
-
-static void update_signal_strength(struct iwd_device *iwdd)
-{
-       if (!g_dbus_proxy_method_call(iwdd->proxy,
-                                       "GetOrderedNetworks",
-                                       NULL, ordered_networks_cb,
-                                       NULL, NULL))
-               DBG("GetOrderedNetworks() failed");
-}
-
 static const char *security_remap(const char *security)
 {
        if (!g_strcmp0(security, "open"))
@@ -654,17 +575,14 @@ static void device_property_change(GDBusProxy *proxy, 
const char *name,
                iwdd->powered = powered;
 
                DBG("%s powered %d", path, iwdd->powered);
-       } else if (!strcmp(name, "Scanning")) {
-               dbus_bool_t scanning;
-
-               dbus_message_iter_get_basic(iter, &scanning);
-               iwdd->scanning = scanning;
-
-               DBG("%s scanning %d", path, iwdd->scanning);
+       } else if (!strcmp(name, "Mode")) {
+               const char *mode;
 
-               if (!iwdd->scanning)
-                       update_signal_strength(iwdd);
+               dbus_message_iter_get_basic(iter, &mode);
+               g_free(iwdd->mode);
+               iwdd->mode = g_strdup(mode);
 
+               DBG("%s mode %s", path, iwdd->mode);
        }
 }
 
@@ -824,11 +742,11 @@ static void create_device(GDBusProxy *proxy)
        iwdd->name = g_strdup(proxy_get_string(proxy, "Name"));
        iwdd->address = g_strdup(proxy_get_string(proxy, "Address"));
        iwdd->powered = proxy_get_bool(proxy, "Powered");
-       iwdd->scanning = proxy_get_bool(proxy, "Scanning");
+       iwdd->mode = g_strdup(proxy_get_string(proxy, "Mode"));
 
-       DBG("adapter %s name %s address %s powered %d scanning %d",
+       DBG("adapter %s name %s address %s powered %d mode %s",
                iwdd->adapter, iwdd->name, iwdd->address,
-               iwdd->powered, iwdd->scanning);
+               iwdd->powered, iwdd->mode);
 
        g_dbus_proxy_set_property_watch(iwdd->proxy,
                        device_property_change, NULL);
-- 
2.24.1

------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list -- [email protected]
To unsubscribe send an email to [email protected]


------------------------------

End of connman Digest, Vol 51, Issue 7
**************************************

Reply via email to