Re: Multiple Modems (USB Dongle) problem

2015-10-21 Thread Dan Williams
On Wed, 2015-10-21 at 10:12 -0500, Dan Williams wrote:
> On Mon, 2015-10-19 at 09:40 +0200, Aleksander Morgado wrote:
> > Hey John,
> > 
> > On Sat, Oct 17, 2015 at 3:16 PM, John Whitmore  wrote:
> > > This is a development list so possibly the wrong place for this question 
> > > but
> > > please redirect me as necessary.
> > >
> > 
> > No, this is the correct place to ask :)
> > 
> > > I've got a problem using two USB LTE Dongle modems of exactly the same
> > > model. They each have a different operators SIM installed. They will both 
> > > get
> > > added to the linux system (I'm using Arch on a RPi-2) as /dev/cdc-wdm0 and
> > > /dev/cdc-wdm1. BUt they will be added, I imagine, at random.
> > >
> > > Managing which is which is the job of UDEV rules so I've added the 
> > > necessary
> > > rules to create symbolic links to the two modems as /dev/three and
> > > /dev/vodafone.
> > >
> > > That all works great my problem is that in the network manager when I add 
> > > a
> > > connection it only offers me the devices /dev/cdc-wdm0 and /dev/cdc-wdm1. 
> > > NOT
> > > my new symbolic links.
> > >
> > 
> > Have you tried to rename the interfaces, as systemd does with the WWAN
> > net interfaces and the "predictable network interface names" setup?
> > You should need to do that before the MM udev rules are used.
> > 
> > > So given that it's the NetworkManager agian this might be considered the 
> > > wrong
> > > list.
> > >
> > > Maybe I should explain the system here. This is going into an RPi-2 in a 
> > > boat
> > > that floats about a lake. So mobile coverage will change between the two
> > > operators. I'm taking this one step at a time and ultimately I'd like the
> > > system to use which ever connection it can. That might be a problem as the
> > > boat needs to have a web site open on the browser. That web page is used 
> > > to
> > > upload data so the web page is opened and the boat floats about the lake
> > > populating forms in the web page. If the web page is connected via one
> > > connection and the connection changes that might cause a problem. I've 
> > > not got
> > > there yet. Like I say one step at a time.
> > >
> > > This might not even be a problem. I mean maybe the NetworkManager creates 
> > > a
> > > connection, but then the ModemManager has the intelligence to say that 
> > > you're
> > > trying to open the "vodafone" connection on the wrong modem and just take 
> > > care
> > > of it?
> > 
> > So, the thing here is that NetworkManager should allow binding a given
> > set of mobile broadband settings to a given specific device (based on
> > 'Equipment ID') or SIM (based on ICCID or even MCCMNC); e..g as it can
> > be done with binding settings to a network interface based on the MAC.
> > If that is done, NM would be intelligent enough to enable the correct
> > settings in each modem.
> > 
> > Dan, what's the status of this in NetworkManager? Was any change done 
> > recently?
> 
> Um, I wrote it on a plane last week and this week, but not upstream yet:
> 
> http://cgit.freedesktop.org/NetworkManager/NetworkManager/log/?h=dcbw/wwan-connection-filters

I renamed the branch after creating the review bug, it's now:

http://cgit.freedesktop.org/NetworkManager/NetworkManager/log/?h=dcbw/bgo756916-wwan-connection-filters

Dan

___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: Multiple Modems (USB Dongle) problem

2015-10-21 Thread Dan Williams
On Wed, 2015-10-21 at 17:56 +0200, poma wrote:
> On 21.10.2015 17:12, Dan Williams wrote:
> > On Mon, 2015-10-19 at 09:40 +0200, Aleksander Morgado wrote:
> >> Hey John,
> >>
> >> On Sat, Oct 17, 2015 at 3:16 PM, John Whitmore  wrote:
> >>> This is a development list so possibly the wrong place for this question 
> >>> but
> >>> please redirect me as necessary.
> >>>
> >>
> >> No, this is the correct place to ask :)
> >>
> >>> I've got a problem using two USB LTE Dongle modems of exactly the same
> >>> model. They each have a different operators SIM installed. They will both 
> >>> get
> >>> added to the linux system (I'm using Arch on a RPi-2) as /dev/cdc-wdm0 and
> >>> /dev/cdc-wdm1. BUt they will be added, I imagine, at random.
> >>>
> >>> Managing which is which is the job of UDEV rules so I've added the 
> >>> necessary
> >>> rules to create symbolic links to the two modems as /dev/three and
> >>> /dev/vodafone.
> >>>
> >>> That all works great my problem is that in the network manager when I add 
> >>> a
> >>> connection it only offers me the devices /dev/cdc-wdm0 and /dev/cdc-wdm1. 
> >>> NOT
> >>> my new symbolic links.
> >>>
> >>
> >> Have you tried to rename the interfaces, as systemd does with the WWAN
> >> net interfaces and the "predictable network interface names" setup?
> >> You should need to do that before the MM udev rules are used.
> >>
> >>> So given that it's the NetworkManager agian this might be considered the 
> >>> wrong
> >>> list.
> >>>
> >>> Maybe I should explain the system here. This is going into an RPi-2 in a 
> >>> boat
> >>> that floats about a lake. So mobile coverage will change between the two
> >>> operators. I'm taking this one step at a time and ultimately I'd like the
> >>> system to use which ever connection it can. That might be a problem as the
> >>> boat needs to have a web site open on the browser. That web page is used 
> >>> to
> >>> upload data so the web page is opened and the boat floats about the lake
> >>> populating forms in the web page. If the web page is connected via one
> >>> connection and the connection changes that might cause a problem. I've 
> >>> not got
> >>> there yet. Like I say one step at a time.
> >>>
> >>> This might not even be a problem. I mean maybe the NetworkManager creates 
> >>> a
> >>> connection, but then the ModemManager has the intelligence to say that 
> >>> you're
> >>> trying to open the "vodafone" connection on the wrong modem and just take 
> >>> care
> >>> of it?
> >>
> >> So, the thing here is that NetworkManager should allow binding a given
> >> set of mobile broadband settings to a given specific device (based on
> >> 'Equipment ID') or SIM (based on ICCID or even MCCMNC); e..g as it can
> >> be done with binding settings to a network interface based on the MAC.
> >> If that is done, NM would be intelligent enough to enable the correct
> >> settings in each modem.
> >>
> >> Dan, what's the status of this in NetworkManager? Was any change done 
> >> recently?
> > 
> > Um, I wrote it on a plane last week and this week, but not upstream yet:
> > 
> > http://cgit.freedesktop.org/NetworkManager/NetworkManager/log/?h=dcbw/wwan-connection-filters
> > 
> > Dan
> > 
> 
> I guess if you wrote it on a plane, you already upstream it.
> You have at least used a permanent marker?

Dry-erase; gotta be able to change it after it gets reviewed :)

Dan

___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: Multiple Modems (USB Dongle) problem

2015-10-21 Thread poma
On 21.10.2015 17:12, Dan Williams wrote:
> On Mon, 2015-10-19 at 09:40 +0200, Aleksander Morgado wrote:
>> Hey John,
>>
>> On Sat, Oct 17, 2015 at 3:16 PM, John Whitmore  wrote:
>>> This is a development list so possibly the wrong place for this question but
>>> please redirect me as necessary.
>>>
>>
>> No, this is the correct place to ask :)
>>
>>> I've got a problem using two USB LTE Dongle modems of exactly the same
>>> model. They each have a different operators SIM installed. They will both 
>>> get
>>> added to the linux system (I'm using Arch on a RPi-2) as /dev/cdc-wdm0 and
>>> /dev/cdc-wdm1. BUt they will be added, I imagine, at random.
>>>
>>> Managing which is which is the job of UDEV rules so I've added the necessary
>>> rules to create symbolic links to the two modems as /dev/three and
>>> /dev/vodafone.
>>>
>>> That all works great my problem is that in the network manager when I add a
>>> connection it only offers me the devices /dev/cdc-wdm0 and /dev/cdc-wdm1. 
>>> NOT
>>> my new symbolic links.
>>>
>>
>> Have you tried to rename the interfaces, as systemd does with the WWAN
>> net interfaces and the "predictable network interface names" setup?
>> You should need to do that before the MM udev rules are used.
>>
>>> So given that it's the NetworkManager agian this might be considered the 
>>> wrong
>>> list.
>>>
>>> Maybe I should explain the system here. This is going into an RPi-2 in a 
>>> boat
>>> that floats about a lake. So mobile coverage will change between the two
>>> operators. I'm taking this one step at a time and ultimately I'd like the
>>> system to use which ever connection it can. That might be a problem as the
>>> boat needs to have a web site open on the browser. That web page is used to
>>> upload data so the web page is opened and the boat floats about the lake
>>> populating forms in the web page. If the web page is connected via one
>>> connection and the connection changes that might cause a problem. I've not 
>>> got
>>> there yet. Like I say one step at a time.
>>>
>>> This might not even be a problem. I mean maybe the NetworkManager creates a
>>> connection, but then the ModemManager has the intelligence to say that 
>>> you're
>>> trying to open the "vodafone" connection on the wrong modem and just take 
>>> care
>>> of it?
>>
>> So, the thing here is that NetworkManager should allow binding a given
>> set of mobile broadband settings to a given specific device (based on
>> 'Equipment ID') or SIM (based on ICCID or even MCCMNC); e..g as it can
>> be done with binding settings to a network interface based on the MAC.
>> If that is done, NM would be intelligent enough to enable the correct
>> settings in each modem.
>>
>> Dan, what's the status of this in NetworkManager? Was any change done 
>> recently?
> 
> Um, I wrote it on a plane last week and this week, but not upstream yet:
> 
> http://cgit.freedesktop.org/NetworkManager/NetworkManager/log/?h=dcbw/wwan-connection-filters
> 
> Dan
> 

I guess if you wrote it on a plane, you already upstream it.
You have at least used a permanent marker?


___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: Multiple Modems (USB Dongle) problem

2015-10-21 Thread Dan Williams
On Mon, 2015-10-19 at 09:40 +0200, Aleksander Morgado wrote:
> Hey John,
> 
> On Sat, Oct 17, 2015 at 3:16 PM, John Whitmore  wrote:
> > This is a development list so possibly the wrong place for this question but
> > please redirect me as necessary.
> >
> 
> No, this is the correct place to ask :)
> 
> > I've got a problem using two USB LTE Dongle modems of exactly the same
> > model. They each have a different operators SIM installed. They will both 
> > get
> > added to the linux system (I'm using Arch on a RPi-2) as /dev/cdc-wdm0 and
> > /dev/cdc-wdm1. BUt they will be added, I imagine, at random.
> >
> > Managing which is which is the job of UDEV rules so I've added the necessary
> > rules to create symbolic links to the two modems as /dev/three and
> > /dev/vodafone.
> >
> > That all works great my problem is that in the network manager when I add a
> > connection it only offers me the devices /dev/cdc-wdm0 and /dev/cdc-wdm1. 
> > NOT
> > my new symbolic links.
> >
> 
> Have you tried to rename the interfaces, as systemd does with the WWAN
> net interfaces and the "predictable network interface names" setup?
> You should need to do that before the MM udev rules are used.
> 
> > So given that it's the NetworkManager agian this might be considered the 
> > wrong
> > list.
> >
> > Maybe I should explain the system here. This is going into an RPi-2 in a 
> > boat
> > that floats about a lake. So mobile coverage will change between the two
> > operators. I'm taking this one step at a time and ultimately I'd like the
> > system to use which ever connection it can. That might be a problem as the
> > boat needs to have a web site open on the browser. That web page is used to
> > upload data so the web page is opened and the boat floats about the lake
> > populating forms in the web page. If the web page is connected via one
> > connection and the connection changes that might cause a problem. I've not 
> > got
> > there yet. Like I say one step at a time.
> >
> > This might not even be a problem. I mean maybe the NetworkManager creates a
> > connection, but then the ModemManager has the intelligence to say that 
> > you're
> > trying to open the "vodafone" connection on the wrong modem and just take 
> > care
> > of it?
> 
> So, the thing here is that NetworkManager should allow binding a given
> set of mobile broadband settings to a given specific device (based on
> 'Equipment ID') or SIM (based on ICCID or even MCCMNC); e..g as it can
> be done with binding settings to a network interface based on the MAC.
> If that is done, NM would be intelligent enough to enable the correct
> settings in each modem.
> 
> Dan, what's the status of this in NetworkManager? Was any change done 
> recently?

Um, I wrote it on a plane last week and this week, but not upstream yet:

http://cgit.freedesktop.org/NetworkManager/NetworkManager/log/?h=dcbw/wwan-connection-filters

Dan


___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [PATCH] bearer-qmi: don't add auth settings if no user/pass/auth given

2015-10-21 Thread Dan Williams
On Tue, 2015-10-20 at 11:29 +0200, Aleksander Morgado wrote:
> Auth settings will be added in a QMI message only if at least one of these is
> requested:
>  * An explicit auth preference is requested.
>  * User string is given and isn't empty.
>  * Password string is given and isn't empty.
> ---
> 
> Any comment on this patch?

Looks fine to me.

Dan

> ---
>  src/mm-bearer-qmi.c | 22 --
>  1 file changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c
> index 408b9cd..803b19d 100644
> --- a/src/mm-bearer-qmi.c
> +++ b/src/mm-bearer-qmi.c
> @@ -222,6 +222,7 @@ static QmiMessageWdsStartNetworkInput *
>  build_start_network_input (ConnectContext *ctx)
>  {
>  QmiMessageWdsStartNetworkInput *input;
> +gboolean has_user, has_password;
> 
>  g_assert (ctx->running_ipv4 || ctx->running_ipv6);
>  g_assert (!(ctx->running_ipv4 && ctx->running_ipv6));
> @@ -231,12 +232,21 @@ build_start_network_input (ConnectContext *ctx)
>  if (ctx->apn && ctx->apn[0])
>  qmi_message_wds_start_network_input_set_apn (input, ctx->apn, NULL);
> 
> -if (ctx->auth != QMI_WDS_AUTHENTICATION_NONE) {
> -qmi_message_wds_start_network_input_set_authentication_preference 
> (input, ctx->auth, NULL);
> +has_user = (ctx->user && ctx->user[0]);
> +has_password = (ctx->password && ctx->password[0]);
> 
> -if (ctx->user)
> +/* Need to add auth info? */
> +if (has_user || has_password || ctx->auth != 
> QMI_WDS_AUTHENTICATION_NONE) {
> +/* We define a valid auth preference if we have either user or 
> password, or a explicit
> + * request for one to be set. If no explicit one was given, default 
> to PAP. */
> +qmi_message_wds_start_network_input_set_authentication_preference (
> +input,
> +(ctx->auth != QMI_WDS_AUTHENTICATION_NONE) ? ctx->auth : 
> QMI_WDS_AUTHENTICATION_PAP,
> +NULL);
> +
> +if (has_user)
>  qmi_message_wds_start_network_input_set_username (input, 
> ctx->user, NULL);
> -if (ctx->password)
> +if (has_password)
>  qmi_message_wds_start_network_input_set_password (input, 
> ctx->password, NULL);
>  }
> 
> @@ -1032,8 +1042,8 @@ _connect (MMBaseBearer *self,
>  g_object_unref (properties);
> 
>  if (auth == MM_BEARER_ALLOWED_AUTH_UNKNOWN) {
> -mm_dbg ("Using default (PAP) authentication method");
> -ctx->auth = QMI_WDS_AUTHENTICATION_PAP;
> +/* We'll default to PAP later if needed */
> +ctx->auth = QMI_WDS_AUTHENTICATION_NONE;
>  } else if (auth & (MM_BEARER_ALLOWED_AUTH_PAP |
> MM_BEARER_ALLOWED_AUTH_CHAP |
> MM_BEARER_ALLOWED_AUTH_NONE)) {
> --
> 2.6.1
> ___
> ModemManager-devel mailing list
> ModemManager-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: assertion 'g_utf8_validate (string, -1, NULL)' failed

2015-10-21 Thread Aleksander Morgado
Hey José,

>
> Hi, I am working with Telit LE910. It works properly with ModemManager using 
> QMI, but if I disable and enable the modem again, I get the following:
>
> root@ccimx6sbc:~# mmcli -m 0 -e
>
> ModemManager[698]:   Modem /org/freedesktop/ModemManager1/Modem/0: 
> state changed (disabled -> enabling)
>
> ModemManager[698]:   (ttyUSB2): port attributes not fully set
>
> ModemManager[698]:   (ttyUSB3): port attributes not fully set
>
> ModemManager[698]:   Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP 
> Registration state changed (unknown -> registering)
>
>
>
> (ModemManager:698): GLib-CRITICAL **: g_variant_new_string: assertion 
> 'g_utf8_validate (string, -1, NULL)' failed
>
>
>
> (ModemManager:698): GLib-CRITICAL **: g_variant_ref_sink: assertion 'value != 
> NULL' failed
>
> ModemManager[698]:   Modem /org/freedesktop/ModemManager1/Modem/0: 3GPP 
> Registration state changed (registering -> home)
>
> ModemManager[698]: Couldn't read SMS messages: QMI protocol error (17): 
> 'MissingArgument'
>
> ModemManager[698]: Couldn't read SMS messages: QMI protocol error (52): 
> 'DeviceNotReady'
>
> ModemManager[698]: Couldn't read SMS messages: QMI protocol error (48): 
> 'InvalidArgument'
>
> ModemManager[698]: Couldn't read SMS messages: QMI protocol error (48): 
> 'InvalidArgument'
>
> ModemManager[698]: Couldn't read SMS messages: QMI protocol error (17): 
> 'MissingArgument'
>
> ModemManager[698]: Couldn't read SMS messages: QMI protocol error (52): 
> 'DeviceNotReady'
>
> ModemManager[698]: Couldn't read SMS messages: QMI protocol error (48): 
> 'InvalidArgument'
>
> ModemManager[698]: Couldn't read SMS messages: QMI protocol error (48): 
> 'InvalidArgument'
>
> ModemManager[698]:   Modem /org/freedesktop/ModemManager1/Modem/0: 
> state changed (enabling -> registered)
>
> successfully enabled the modem
>
>
> Why are those asserts coming out? How can I fix those?

Which ModemManager version is this?

Can you MM with --debug to get full debug logs? See:
http://www.freedesktop.org/wiki/Software/ModemManager/Debugging/

I'd bet these are related to content of read SMS messages.

-- 
Aleksander
https://aleksander.es
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


assertion 'g_utf8_validate (string, -1, NULL)' failed

2015-10-21 Thread José
Hi, I am working with Telit LE910. It works properly with ModemManager
using QMI, but if I disable and enable the modem again, I get the following:

root@ccimx6sbc:~# mmcli -m 0 -e

ModemManager[698]:   Modem
/org/freedesktop/ModemManager1/Modem/0: state changed (disabled ->
enabling)

ModemManager[698]:   (ttyUSB2): port attributes not fully set

ModemManager[698]:   (ttyUSB3): port attributes not fully set

ModemManager[698]:   Modem
/org/freedesktop/ModemManager1/Modem/0: 3GPP Registration state
changed (unknown -> registering)



(ModemManager:698): GLib-CRITICAL **: g_variant_new_string: assertion
'g_utf8_validate (string, -1, NULL)' failed



(ModemManager:698): GLib-CRITICAL **: g_variant_ref_sink: assertion
'value != NULL' failed

ModemManager[698]:   Modem
/org/freedesktop/ModemManager1/Modem/0: 3GPP Registration state
changed (registering -> home)

ModemManager[698]: Couldn't read SMS messages: QMI protocol error
(17): 'MissingArgument'

ModemManager[698]: Couldn't read SMS messages: QMI protocol error
(52): 'DeviceNotReady'

ModemManager[698]: Couldn't read SMS messages: QMI protocol error
(48): 'InvalidArgument'

ModemManager[698]: Couldn't read SMS messages: QMI protocol error
(48): 'InvalidArgument'

ModemManager[698]: Couldn't read SMS messages: QMI protocol error
(17): 'MissingArgument'

ModemManager[698]: Couldn't read SMS messages: QMI protocol error
(52): 'DeviceNotReady'

ModemManager[698]: Couldn't read SMS messages: QMI protocol error
(48): 'InvalidArgument'

ModemManager[698]: Couldn't read SMS messages: QMI protocol error
(48): 'InvalidArgument'

ModemManager[698]:   Modem
/org/freedesktop/ModemManager1/Modem/0: state changed (enabling ->
registered)

successfully enabled the modem


Why are those asserts coming out? How can I fix those?
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel