Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-30 Thread Marius Kotsbak

Den 30. aug. 2012 00:24, skrev Aleksander Morgado:


I did, but maybe hit a bad timing. Anyway, master version now builds and
connection still works with my ZTE modem, but I got a crash with the
Sierra modem (which is not Icera):

ERROR:mm-port-probe.c:531:serial_probe_at_icera_result_processor:
assertion failed: (g_variant_is_of_type (result, G_VARIANT_TYPE_BOOLEAN))

which means that it is unusable with this modem now (at
72602a395105006736ecf5829ba33ffcefce3692).

Interesting; can you get me debug logs of the issue? Or better, a
stacktrace after running ModemManager with G_DEBUG=fatal_warnings; e.g.:
sudo G_DEBUG=fatal_warnings gdb --args /usr/sbin/ModemManager --debug


Ah, now I see why i didn't get the same results as Bjørn. My device was 
in Direct IP mode (supposed to use the sierra_net module), not QMI mode. 
That means it is probably a regression since MM_05 unrelated to the qmi 
branch merge. Anyway, I send you the trace outside the list.


--
Marius

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-30 Thread Marius Kotsbak

Den 30. aug. 2012 00:24, skrev Aleksander Morgado:

I actually got the connection up now using the method above (mmcli +
ifup wwan0) so it seems to be close to functional now.


Regarding connectivity; QMI-powered MM is fully functional. Missing
things include messaging and location, which are scheduled for next
weeks.


Okay. What about selection of network technology (2/3/4G/LTE) and
preference between them?

I am not sure if this command is the one to use, but it does not work:

$ mmcli -m 1 --set-preferred-mode lte
error: setting preferred mode requires list of allowed modes


You need to set a list of allowed modes and only then you can select one
of them to be preferred.


I find that a bit strange, as it seems to have the list from the status 
(mmcli -m X):


  -
  Modes|  supported: '2g, 3g, 4g'
   |allowed: '2g, 3g, 4g'
   |  preferred: 'none'
  -


  The modem may not support the combination you
provide, though. You set allowed modes with --set-allowed-modes; e.g.:

  --set-allowed-modes=2g|3g --set-preferred-mode=3g


Yes that works, just with quotes around the pipe that the shell would 
interpret:


mmcli -m 0 --set-allowed-modes='2g|3g|4g'


I see:

ModemManager[27013]: warn  couldn't load current allowed/preferred
modes: 'Loading allowed modes is not supported by this device'


Seems your device doesn't have a recent enough NAS service version in
order to be able to select allowed modes.



Yes, so it seems (for device ZTE MF820D, even with the latest 
firmware...). At least I am able to force 3G or LTE.


For the Sierra MC7710, it also does not work:

$ mmcli -m 0 --set-preferred-mode 4g --set-allowed-modes 4g

That is also strange, as it is possible to set preference using custom 
AT command AT!SELRAT (or maybe it is only allowed modes?). Are you sure 
it is working?


I also see that not all combinations work. 3g and 4g allowed are okay, 
but not:


--set-allowed-modes='3g|4g'
error: couldn't set allowed modes: 
'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unsupported: 
Setting allowed modes is not supported by this device'


Also this works:

$ mmcli -m 0 --set-allowed-modes='2g|3g|4g'
successfully set allowed modes in the modem

--
Marius

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-30 Thread Aleksander Morgado
On 08/30/2012 01:30 PM, Marius Kotsbak wrote:
 
 For the Sierra MC7710, it also does not work:
 
 $ mmcli -m 0 --set-preferred-mode 4g --set-allowed-modes 4g
 
 That is also strange, as it is possible to set preference using custom
 AT command AT!SELRAT (or maybe it is only allowed modes?). Are you sure
 it is working?
 
 I also see that not all combinations work. 3g and 4g allowed are okay,
 but not:
 
 --set-allowed-modes='3g|4g'
 error: couldn't set allowed modes:
 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unsupported:
 Setting allowed modes is not supported by this device'
 
 Also this works:
 
 $ mmcli -m 0 --set-allowed-modes='2g|3g|4g'
 successfully set allowed modes in the modem

Are all these previous outputs from the Sierra MC7710?

BTW, if you set only one value as allowed-mode, there's no need to set a
preferred-mode.

Cheers

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-30 Thread Marius Kotsbak

Den 30. aug. 2012 14:05, skrev Aleksander Morgado:

On 08/30/2012 01:30 PM, Marius Kotsbak wrote:

For the Sierra MC7710, it also does not work:

$ mmcli -m 0 --set-preferred-mode 4g --set-allowed-modes 4g

That is also strange, as it is possible to set preference using custom
AT command AT!SELRAT (or maybe it is only allowed modes?). Are you sure
it is working?

I also see that not all combinations work. 3g and 4g allowed are okay,
but not:

--set-allowed-modes='3g|4g'
error: couldn't set allowed modes:
'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unsupported:
Setting allowed modes is not supported by this device'

Also this works:

$ mmcli -m 0 --set-allowed-modes='2g|3g|4g'
successfully set allowed modes in the modem

Are all these previous outputs from the Sierra MC7710?

BTW, if you set only one value as allowed-mode, there's no need to set a
preferred-mode.

Cheers



Yes, but it seems like it works almost as the ZTE modem, both not able 
to set preference (the default preference is probably LTE-3G-2G).


--
Marius

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-30 Thread Aleksander Morgado


 I did, but maybe hit a bad timing. Anyway, master version now builds and
 connection still works with my ZTE modem, but I got a crash with the
 Sierra modem (which is not Icera):

 ERROR:mm-port-probe.c:531:serial_probe_at_icera_result_processor:
 assertion failed: (g_variant_is_of_type (result, G_VARIANT_TYPE_BOOLEAN))

 which means that it is unusable with this modem now (at
 72602a395105006736ecf5829ba33ffcefce3692).

 Interesting; can you get me debug logs of the issue? Or better, a
 stacktrace after running ModemManager with G_DEBUG=fatal_warnings; e.g.:
 sudo G_DEBUG=fatal_warnings gdb --args /usr/sbin/ModemManager --debug
 
 Ah, now I see why i didn't get the same results as Bjørn. My device was
 in Direct IP mode (supposed to use the sierra_net module), not QMI mode.
 That means it is probably a regression since MM_05 unrelated to the qmi
 branch merge. Anyway, I send you the trace outside the list.

Please retry now; I fixed the generic Icera check during port probing.

And note: you are the first one testing the port of the Sierra plugin
(so thanks thanks); but be aware that more nasty issues may happen, just
report them if possible.

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-30 Thread Aleksander Morgado

 And note: you are the first one testing the port of the Sierra plugin
 (so thanks thanks); but be aware that more nasty issues may happen, just
 report them if possible.

Forgot to say; there are some additional fixes to get ported from
MM06/MM05 to git master regarding the Sierra plugin (disabling echo
removal); that's a known issue to handle there.

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-30 Thread Aleksander Morgado
On 08/30/2012 02:10 PM, Marius Kotsbak wrote:
 Den 30. aug. 2012 14:05, skrev Aleksander Morgado:
 On 08/30/2012 01:30 PM, Marius Kotsbak wrote:
 For the Sierra MC7710, it also does not work:

 $ mmcli -m 0 --set-preferred-mode 4g --set-allowed-modes 4g

 That is also strange, as it is possible to set preference using custom
 AT command AT!SELRAT (or maybe it is only allowed modes?). Are you sure
 it is working?

 I also see that not all combinations work. 3g and 4g allowed are okay,
 but not:

 --set-allowed-modes='3g|4g'
 error: couldn't set allowed modes:
 'GDBus.Error:org.freedesktop.ModemManager1.Error.Core.Unsupported:
 Setting allowed modes is not supported by this device'


This message is a bit misleading. Setting allowed modes *is* supported
by the device, just the specific combination passed is not supported.


 Also this works:

 $ mmcli -m 0 --set-allowed-modes='2g|3g|4g'
 successfully set allowed modes in the modem
 Are all these previous outputs from the Sierra MC7710?

 BTW, if you set only one value as allowed-mode, there's no need to set a
 preferred-mode.

 Cheers

 
 Yes, but it seems like it works almost as the ZTE modem, both not able
 to set preference (the default preference is probably LTE-3G-2G).
 

Interesting to see that 2g|3g|4g is supported but just 3g|4g isn't. I
bet that 2g|3g is supported.

I just checked and there's currently no support for 'preferred' mode
when using the Set Technology Preference QMI command (which is the
default command used, even if deprecated). When using the new Set
System Selection Preference (if you configure including
--with-newest-qmi-commands, which I wouldn't do yet), we do use the
preferred setup to select between 2G or 3G (GSM/WCDMA acquisition order
preference), but that doesn't apply to 4G either.

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: 'usb' -- 'usbmisc' transition (was: Re: [MM qmi-support] Set Operating Mode on shutdown and more..)

2012-08-30 Thread Dan Williams
On Tue, 2012-08-21 at 11:44 +0200, Aleksander Morgado wrote:
 Hey Bjørn,
 
   3) I still wonder how to handle the usb = usbmisc transition.  For now
   I've just been searching and replacing, but that is of course not
   supportable.  And it isn't really a one-to-one replacement either.
   There are places where usb actually refer to the subsystem and not 
   the
   class.
   
   Should usbmisc be added as an additional device class, keeping usb,
   or should there be some kernel version checking code there?
   
  
   Can you give me your diff to look at where you did the changes? I guess
   we should try to support both cases, regardless of the kernel version,
   if somehow possible.
  
  This is my diff which is sort of working for me, but I haven't sanity
  checked it so there are probably errors here:
 
 I pushed some fixes to the 'qmi-support' branch of ModemManager trying
 to cope with the 'usb'-'usbmisc' transition. Basically, I'm assuming
 that either one or the other may appear, trying to avoid the need for a
 runtime kernel version check. Could you test that in the newest kernels
 with 'usbmisc'? It seems to work ok for the older ones with 'usb'.

I tried searching for the usbmisc stuff but couldn't find much upstream.
What's actually happening here and what devices are affected?  The code
I found looked like drivers for mostly embedded stuff.

Dan

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-29 Thread Marius Kotsbak
On Aug 6, 2012 2:54 PM, Aleksander Morgado aleksan...@lanedo.com wrote:


  More or less, yes. You have the 'mmcli' utility in that branch,
though,
  so you can skip writing raw dbus-send commands and play with the cli
  instead, like this (assuming only one modem connected, so index 0):
 
  Show modem info and status:
 $ mmcli -m 0
 
  Send PIN:
 $ sudo mmcli -i 0 --pin=1234
 
  Enable modem:
 $ sudo mmcli -m 0 -e
 
  Connect:
 $ sudo mmcli -m 0 --simple-connect=apn=internet
 
  After this step, is it supposed to be possible to run a DHCP query
  against the wwan0 device? When I try, it just hangs (No response to
  DHCPDISCOVER). All look fine in the ModemManager output ((9/9): All
  done), and connection works fine with the same version of libqmi with
  the script that does this instead of the above steps:
 
  echo AT+CGDCONT=1,IP,internet.netcom.no  /dev/ttyUSB2
  qmi-network /dev/cdc-wdm0 start
 
  (I used 'sudo mmcli -m 0 --simple-connect=apn=internet.netcom.no)
 

 No, the 'qmi-support' branch is still not able to get you connected,
 work is still in progress. Whenever it's ready, hopefully during the
 following weeks, I will let you know in the ML.

I actually got the connection up now using the method above (mmcli + ifup
wwan0) so it seems to be close to functional now.

How is the status of a NM that can use this new MM? Which parts/tasks are
missing there?

Btw: seems like the latest MM branch code did not build.

--
Marius
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-29 Thread Aleksander Morgado

  More or less, yes. You have the 'mmcli' utility in that branch,
 though,
  so you can skip writing raw dbus-send commands and play with the cli
  instead, like this (assuming only one modem connected, so index 0):
 
  Show modem info and status:
 $ mmcli -m 0
 
  Send PIN:
 $ sudo mmcli -i 0 --pin=1234
 
  Enable modem:
 $ sudo mmcli -m 0 -e
 
  Connect:
 $ sudo mmcli -m 0 --simple-connect=apn=internet
 
  After this step, is it supposed to be possible to run a DHCP query
  against the wwan0 device? When I try, it just hangs (No response to
  DHCPDISCOVER). All look fine in the ModemManager output ((9/9): All
  done), and connection works fine with the same version of libqmi with
  the script that does this instead of the above steps:
 
  echo AT+CGDCONT=1,IP,internet.netcom.no
 http://internet.netcom.no  /dev/ttyUSB2
  qmi-network /dev/cdc-wdm0 start
 
  (I used 'sudo mmcli -m 0 --simple-connect=apn=internet.netcom.no
 http://internet.netcom.no)
 

 No, the 'qmi-support' branch is still not able to get you connected,
 work is still in progress. Whenever it's ready, hopefully during the
 following weeks, I will let you know in the ML.
 
 I actually got the connection up now using the method above (mmcli +
 ifup wwan0) so it seems to be close to functional now.
 

Regarding connectivity; QMI-powered MM is fully functional. Missing
things include messaging and location, which are scheduled for next weeks.

 How is the status of a NM that can use this new MM? Which parts/tasks
 are missing there?

Like, everything is missing. The idea is to modify NM to talk to MM
through the new libmm-glib. My personal list of things TODO includes now
2 big items only: multipart support merge in MM git master and then the
NM integration. Any help with the second one is very appreciated, now
that all MM plugins are ported.

 
 Btw: seems like the latest MM branch code did not build.
 

Make sure you have the latest libqmi (from git master) before trying to
build the qmi-support branch in ModemManager :-)


-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-29 Thread Marius Kotsbak

Den 29. aug. 2012 15:52, skrev Aleksander Morgado:


I actually got the connection up now using the method above (mmcli +
ifup wwan0) so it seems to be close to functional now.


Regarding connectivity; QMI-powered MM is fully functional. Missing
things include messaging and location, which are scheduled for next weeks.


Okay. What about selection of network technology (2/3/4G/LTE) and 
preference between them?


I am not sure if this command is the one to use, but it does not work:

$ mmcli -m 1 --set-preferred-mode lte
error: setting preferred mode requires list of allowed modes

I see:

ModemManager[27013]: warn  couldn't load current allowed/preferred 
modes: 'Loading allowed modes is not supported by this device'





How is the status of a NM that can use this new MM? Which parts/tasks
are missing there?

Like, everything is missing. The idea is to modify NM to talk to MM
through the new libmm-glib. My personal list of things TODO includes now
2 big items only: multipart support merge in MM git master and then the
NM integration. Any help with the second one is very appreciated, now
that all MM plugins are ported.


Btw: seems like the latest MM branch code did not build.


Make sure you have the latest libqmi (from git master) before trying to
build the qmi-support branch in ModemManager :-)




I did, but maybe hit a bad timing. Anyway, master version now builds and 
connection still works with my ZTE modem, but I got a crash with the 
Sierra modem (which is not Icera):


ERROR:mm-port-probe.c:531:serial_probe_at_icera_result_processor: 
assertion failed: (g_variant_is_of_type (result, G_VARIANT_TYPE_BOOLEAN))


which means that it is unusable with this modem now (at 
72602a395105006736ecf5829ba33ffcefce3692).


--
Marius

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-29 Thread Aleksander Morgado

 I actually got the connection up now using the method above (mmcli +
 ifup wwan0) so it seems to be close to functional now.

 Regarding connectivity; QMI-powered MM is fully functional. Missing
 things include messaging and location, which are scheduled for next
 weeks.
 
 Okay. What about selection of network technology (2/3/4G/LTE) and
 preference between them?
 
 I am not sure if this command is the one to use, but it does not work:
 
 $ mmcli -m 1 --set-preferred-mode lte
 error: setting preferred mode requires list of allowed modes
 

You need to set a list of allowed modes and only then you can select one
of them to be preferred. The modem may not support the combination you
provide, though. You set allowed modes with --set-allowed-modes; e.g.:

 --set-allowed-modes=2g|3g --set-preferred-mode=3g

 I see:
 
 ModemManager[27013]: warn  couldn't load current allowed/preferred
 modes: 'Loading allowed modes is not supported by this device'
 

Seems your device doesn't have a recent enough NAS service version in
order to be able to select allowed modes.


 How is the status of a NM that can use this new MM? Which parts/tasks
 are missing there?
 Like, everything is missing. The idea is to modify NM to talk to MM
 through the new libmm-glib. My personal list of things TODO includes now
 2 big items only: multipart support merge in MM git master and then the
 NM integration. Any help with the second one is very appreciated, now
 that all MM plugins are ported.

 Btw: seems like the latest MM branch code did not build.

 Make sure you have the latest libqmi (from git master) before trying to
 build the qmi-support branch in ModemManager :-)


 
 I did, but maybe hit a bad timing. Anyway, master version now builds and
 connection still works with my ZTE modem, but I got a crash with the
 Sierra modem (which is not Icera):
 
 ERROR:mm-port-probe.c:531:serial_probe_at_icera_result_processor:
 assertion failed: (g_variant_is_of_type (result, G_VARIANT_TYPE_BOOLEAN))
 
 which means that it is unusable with this modem now (at
 72602a395105006736ecf5829ba33ffcefce3692).
 

Interesting; can you get me debug logs of the issue? Or better, a
stacktrace after running ModemManager with G_DEBUG=fatal_warnings; e.g.:
sudo G_DEBUG=fatal_warnings gdb --args /usr/sbin/ModemManager --debug

Thanks,

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-06 Thread Aleksander Morgado

 
 Is this branch working now with master version of Network manager
 including the gnome applet?
 

Not yet, no. The 'qui-support' branch is to be considered unstable, as
I'm still hacking into it extensively. That branch is then based on git
master, which is more stable, but not integrated yet with NM.

Cheers!

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-06 Thread Marius Kotsbak
On Aug 6, 2012 8:38 AM, Aleksander Morgado aleksan...@lanedo.com wrote:


 
  Is this branch working now with master version of Network manager
  including the gnome applet?
 

 Not yet, no. The 'qui-support' branch is to be considered unstable, as
 I'm still hacking into it extensively. That branch is then based on git
 master, which is more stable, but not integrated yet with NM.

So that means it could only be tested with what it does by itself when it
discovers modems, and by sending dbus messages manually?

-Marius
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-06 Thread Aleksander Morgado

 
  Is this branch working now with master version of Network manager
  including the gnome applet?
 

 Not yet, no. The 'qui-support' branch is to be considered unstable, as
 I'm still hacking into it extensively. That branch is then based on git
 master, which is more stable, but not integrated yet with NM.
 
 So that means it could only be tested with what it does by itself when
 it discovers modems, and by sending dbus messages manually?
 

More or less, yes. You have the 'mmcli' utility in that branch, though,
so you can skip writing raw dbus-send commands and play with the cli
instead, like this (assuming only one modem connected, so index 0):

Show modem info and status:
 $ mmcli -m 0

Send PIN:
 $ sudo mmcli -i 0 --pin=1234

Enable modem:
 $ sudo mmcli -m 0 -e

Connect:
 $ sudo mmcli -m 0 --simple-connect=apn=internet

Disconnect:
 $ sudo mmcli -m 0 --simple-disconnect

Disable modem:
 $ sudo mmcli -m 0 -d

And so on, just run this to get a full list of commands available:
 $ mmcli --help-all

Also note that the 'qmi-support' branch still lacks quite a lot of steps
regarding network registration and connection, so those will fallback to
AT commands instead right now. I hope to have the branch ready for
connections in the following weeks.

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-06 Thread Marius Kotsbak

Den 06. aug. 2012 11:28, skrev Aleksander Morgado:

Is this branch working now with master version of Network manager
including the gnome applet?


Not yet, no. The 'qui-support' branch is to be considered unstable, as
I'm still hacking into it extensively. That branch is then based on git
master, which is more stable, but not integrated yet with NM.

So that means it could only be tested with what it does by itself when
it discovers modems, and by sending dbus messages manually?


More or less, yes. You have the 'mmcli' utility in that branch, though,
so you can skip writing raw dbus-send commands and play with the cli
instead, like this (assuming only one modem connected, so index 0):

Show modem info and status:
  $ mmcli -m 0

Send PIN:
  $ sudo mmcli -i 0 --pin=1234

Enable modem:
  $ sudo mmcli -m 0 -e

Connect:
  $ sudo mmcli -m 0 --simple-connect=apn=internet

Disconnect:
  $ sudo mmcli -m 0 --simple-disconnect

Disable modem:
  $ sudo mmcli -m 0 -d

And so on, just run this to get a full list of commands available:
  $ mmcli --help-all


Okay, thanks, that looks a lot nicer.



Also note that the 'qmi-support' branch still lacks quite a lot of steps
regarding network registration and connection, so those will fallback to
AT commands instead right now. I hope to have the branch ready for
connections in the following weeks.



Ah, I was unsure if AT commands were required in addition to QMI 
commands, as I did not see any options to set APN in the libqmi application.


I successfully used these scripts to connect and disconnect without 
using NM/MM:


https://gist.github.com/3253225

https://gist.github.com/3253231

They are working fine as a workaround until the full support is ready.

--
Marius

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-06 Thread Aleksander Morgado

 Is this branch working now with master version of Network manager
 including the gnome applet?

 Not yet, no. The 'qui-support' branch is to be considered unstable, as
 I'm still hacking into it extensively. That branch is then based on git
 master, which is more stable, but not integrated yet with NM.
 So that means it could only be tested with what it does by itself when
 it discovers modems, and by sending dbus messages manually?

 More or less, yes. You have the 'mmcli' utility in that branch, though,
 so you can skip writing raw dbus-send commands and play with the cli
 instead, like this (assuming only one modem connected, so index 0):

 Show modem info and status:
   $ mmcli -m 0

 Send PIN:
   $ sudo mmcli -i 0 --pin=1234

 Enable modem:
   $ sudo mmcli -m 0 -e

 Connect:
   $ sudo mmcli -m 0 --simple-connect=apn=internet

 Disconnect:
   $ sudo mmcli -m 0 --simple-disconnect

 Disable modem:
   $ sudo mmcli -m 0 -d

 And so on, just run this to get a full list of commands available:
   $ mmcli --help-all
 
 Okay, thanks, that looks a lot nicer.
 

 Also note that the 'qmi-support' branch still lacks quite a lot of steps
 regarding network registration and connection, so those will fallback to
 AT commands instead right now. I hope to have the branch ready for
 connections in the following weeks.

 
 Ah, I was unsure if AT commands were required in addition to QMI
 commands, as I did not see any options to set APN in the libqmi
 application.
 

That is still to be done.

 I successfully used these scripts to connect and disconnect without
 using NM/MM:
 
 https://gist.github.com/3253225
 
 https://gist.github.com/3253231
 
 They are working fine as a workaround until the full support is ready.
 

Note to self: don't break the qmi-network script functionality in libqmi :-)

Cheers!

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-06 Thread Marius Kotsbak

Den 06. aug. 2012 12:07, skrev Aleksander Morgado:



More or less, yes. You have the 'mmcli' utility in that branch, though,
so you can skip writing raw dbus-send commands and play with the cli
instead, like this (assuming only one modem connected, so index 0):

Show modem info and status:
   $ mmcli -m 0

Send PIN:
   $ sudo mmcli -i 0 --pin=1234

Enable modem:
   $ sudo mmcli -m 0 -e

Connect:
   $ sudo mmcli -m 0 --simple-connect=apn=internet


After this step, is it supposed to be possible to run a DHCP query 
against the wwan0 device? When I try, it just hangs (No response to 
DHCPDISCOVER). All look fine in the ModemManager output ((9/9): All 
done), and connection works fine with the same version of libqmi with 
the script that does this instead of the above steps:


echo AT+CGDCONT=1,IP,internet.netcom.no  /dev/ttyUSB2
qmi-network /dev/cdc-wdm0 start

(I used 'sudo mmcli -m 0 --simple-connect=apn=internet.netcom.no)

--
Marius

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-06 Thread Aleksander Morgado

 More or less, yes. You have the 'mmcli' utility in that branch, though,
 so you can skip writing raw dbus-send commands and play with the cli
 instead, like this (assuming only one modem connected, so index 0):

 Show modem info and status:
$ mmcli -m 0

 Send PIN:
$ sudo mmcli -i 0 --pin=1234

 Enable modem:
$ sudo mmcli -m 0 -e

 Connect:
$ sudo mmcli -m 0 --simple-connect=apn=internet
 
 After this step, is it supposed to be possible to run a DHCP query
 against the wwan0 device? When I try, it just hangs (No response to
 DHCPDISCOVER). All look fine in the ModemManager output ((9/9): All
 done), and connection works fine with the same version of libqmi with
 the script that does this instead of the above steps:
 
 echo AT+CGDCONT=1,IP,internet.netcom.no  /dev/ttyUSB2
 qmi-network /dev/cdc-wdm0 start
 
 (I used 'sudo mmcli -m 0 --simple-connect=apn=internet.netcom.no)
 

No, the 'qmi-support' branch is still not able to get you connected,
work is still in progress. Whenever it's ready, hopefully during the
following weeks, I will let you know in the ML.

Cheers!

-- 
Aleksander
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-08-03 Thread Marius Kotsbak
2012/7/31 Bjørn Mork bj...@mork.no

 Hello,

 I am playing a bit with the qmi-support branch, which seems to be
 getting close to operational.  Nice work!


I am having trouble now building that branch:

 mm-broadband-modem-qmi.c: In function ‘set_allowed_modes_context_step’:
mm-broadband-modem-qmi.c:2165:9: error: implicit declaration of function
‘qmi_message_nas_set_system_selection_preference_input_set_preference_duration’
[-Werror=implicit-function-declaration]
mm-broadband-modem-qmi.c: In function ‘get_3gpp_access_technology’:
mm-broadband-modem-qmi.c:2581:59: error:
‘QmiMessageNasNetworkScanOutputRadioAccessTechnologyElement’ has no member
named ‘rat’
cc1: all warnings being treated as errors
make[3]: *** [ModemManager-mm-broadband-modem-qmi.o] Error 1

I have in advance built and installed libqmi from git://
anongit.freedesktop.org/libqmi.

--
Marius
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-07-31 Thread Aleksander Morgado
Hey!

You're truly trying *a lot* of untested code :-)

 
 I am playing a bit with the qmi-support branch, which seems to be
 getting close to operational.  Nice work!
 
 But I have a few issues I don't like, as usual :-)
 

Don't worry, I think I already owe you a couple of beers for all this
testing!


 
 I don't think ModemManager should mess too much with the operating mode.
 At most it could enable online mode if not already there, and possibly
 reset back to the initial mode on exit.  But to do this it needs to save
 the initial mode and understand the allowed transitions.  I really think
 it's best not to touch this at all for now...
 
 In any case, if the quest is to save power, then at least use
 low-power and not offline.  I can switch back and forth between
 these modes:
 
 
 bjorn@nemi:/usr/local/src/git/modemmanager$ qmicli -d /dev/cdc-wdm1 
 --dms-set-operating-mode=low-power
 [/dev/cdc-wdm1] Operating mode set successfully
 bjorn@nemi:/usr/local/src/git/modemmanager$ qmicli -d /dev/cdc-wdm1 
 --dms-get-operating-mode
 [/dev/cdc-wdm1] Operating mode retrieved:
 Mode: 'low-power'
 HW restricted: 'no'
 bjorn@nemi:/usr/local/src/git/modemmanager$ qmicli -d /dev/cdc-wdm1 
 --dms-set-operating-mode=online
 [/dev/cdc-wdm1] Operating mode set successfully
 bjorn@nemi:/usr/local/src/git/modemmanager$ qmicli -d /dev/cdc-wdm1 
 --dms-get-operating-mode
 [/dev/cdc-wdm1] Operating mode retrieved:
 Mode: 'online'
 HW restricted: 'no'
 


Using the low power mode should be safe I guess, just pushed a fix for
this. Thanks for the tip.


 
 
 2) I seem to lose all but one data port on multi-port devices:
 
 ModemManager[5836]: debug [1343739886.255573] [mm-plugin-manager.c:299] 
 plugin_supports_port_ready(): (Gobi): (tty/ttyUSB1) found best plugin for port
 ModemManager[5836]: info  [1343739886.255610] [mm-device.c:427] 
 mm_device_create_modem(): Creating modem with plugin 'Gobi' and '7' ports
 ModemManager[5836]: debug [1343739886.255644] [gobi/mm-plugin-gobi.c:44] 
 create_modem(): QMI-powered Gobi modem found...
 ModemManager[5836]: debug [1343739886.256795] [mm-base-modem.c:247] 
 mm_base_modem_grab_port(): (cdc-wdm0) type 'qmi' claimed by 
 /sys/devices/pci:00/:00:1d.7/usb8/8-4
 ModemManager[5836]: debug [1343739886.256859] [mm-base-modem.c:247] 
 mm_base_modem_grab_port(): (cdc-wdm1) type 'qmi' claimed by 
 /sys/devices/pci:00/:00:1d.7/usb8/8-4
 ModemManager[5836]: debug [1343739886.256908] [mm-base-modem.c:247] 
 mm_base_modem_grab_port(): (wwan0) type 'net' claimed by 
 /sys/devices/pci:00/:00:1d.7/usb8/8-4
 ModemManager[5836]: debug [1343739886.256961] [mm-base-modem.c:247] 
 mm_base_modem_grab_port(): (wwan1) type 'net' claimed by 
 /sys/devices/pci:00/:00:1d.7/usb8/8-4
 ModemManager[5836]: debug [1343739886.257076] [mm-base-modem.c:247] 
 mm_base_modem_grab_port(): (ttyUSB2) type 'at' claimed by 
 /sys/devices/pci:00/:00:1d.7/usb8/8-4
 ModemManager[5836]: warn  [1343739886.257145] [mm-plugin.c:664] 
 mm_plugin_create_modem(): Could not grab port (tty/ttyUSB1): 'Cannot add port 
 'tty/ttyUSB1', unhandled serial type'
 ModemManager[5836]: debug [1343739886.257206] [mm-base-modem.c:247] 
 mm_base_modem_grab_port(): (ttyUSB0) type 'qcdm' claimed by 
 /sys/devices/pci:00/:00:1d.7/usb8/8-4
 ModemManager[5836]: debug [1343739886.257235] [mm-base-modem.c:626] 
 log_port(): (/sys/devices/pci:00/:00:1d.7/usb8/8-4) tty/ttyUSB2 
 primary
 ModemManager[5836]: debug [1343739886.257258] [mm-base-modem.c:626] 
 log_port(): (/sys/devices/pci:00/:00:1d.7/usb8/8-4) net/wwan0 data
 ModemManager[5836]: debug [1343739886.257279] [mm-base-modem.c:626] 
 log_port(): (/sys/devices/pci:00/:00:1d.7/usb8/8-4) tty/ttyUSB0 qcdm
 ModemManager[5836]: debug [1343739886.257300] [mm-base-modem.c:626] 
 log_port(): (/sys/devices/pci:00/:00:1d.7/usb8/8-4) usbmisc/cdc-wdm0 
 qmi
 ModemManager[5836]: info  [1343739886.257350] [mm-iface-modem.c:979] 
 mm_iface_modem_update_state(): Modem: state changed (unknown - initializing)
 ModemManager[5836]: info  [1343739886.257635] [mm-manager.c:149] 
 find_device_support_ready(): Modem for device at 
 '/sys/devices/pci:00/:00:1d.7/usb8/8-4' successfully created
 ModemManager[5836]: [/dev/cdc-wdm0] Checking version info (10 retries)...
 
 
 Don't know how the abstraction should be here, but it would be nice to
 be able to use both wwan0 and wwan1 (and possibly also do PPP on
 ttyUSB2).  Note that these cannot be seen as separate modems.  They
 share the SIM interface and all QMI services except WDS.
 


The new API allows users to create more than one bearer; when it's done
we'll allow to do all that. I must say, I didn't really cover yet the
case of multiple QMI ports in the same device, that's why you're only
seeing one there. Another thing for my TODO list.


 Do also note that the above setup is working by pure luck.  The code
 really should try to match the wwanX and 

Re: [MM qmi-support] Set Operating Mode on shutdown and more..

2012-07-31 Thread Bjørn Mork
Aleksander Morgado aleksan...@lanedo.com writes:

 Hey!

 You're truly trying *a lot* of untested code :-)

Oh, yeah.  It's a lot easier to find bugs then :-)

 The new API allows users to create more than one bearer; when it's done
 we'll allow to do all that. I must say, I didn't really cover yet the
 case of multiple QMI ports in the same device, that's why you're only
 seeing one there. Another thing for my TODO list.


Thanks.


 Do also note that the above setup is working by pure luck.  The code
 really should try to match the wwanX and cdc-wdmY devices by USB
 interface and not by USB device.  If we ignore the unfortunate 3.4 and
 3.5 kernels, then a matching wwanX and cdc-wdmY set will always share
 the same parent USB interface on QMI devices.
 
 Having the same parent USB device is *not* sufficient.  You cannot
 control wwan0 using cdc-wdm1 in the above example.
 


 Oh, interesting. So, each cdc-wdm *always* has a specific wwan port
 paired, then, right? 

Yes, for QMI devices.  Keep in mind that cdc-wdm devices aren't
necessarily QMI.  We already have the AT command type from Ericsson.
And I hope we soon will have MBIM cdc-wdm devices too.

Unfortunately, there are exceptions to the USB interface grouping in
Linux 3.4 and 3.5 due to the split between the qmi_wwan and cdc_wdm
drivers for devices with separate control and data interface.  But AFAIK
there is no multi-port device with separate control and data interface.

 I'll give a look at the logic of multiple QMI/wwan
 ports one of these days.

Yes, I hope there will be more of them in the future.   But I believe
many current devices can support simultaneous ppp and wwan, and as such
be seen as having multiple data ports.

 Do you (does anyonoe) know any individual/company who would be willing
 to sponsor some of these newer QMI-powered modems for developers?

Nope, sorry.  MBIM devices would also be nice, but I don't even know
where to buy one of those.

 3) I still wonder how to handle the usb = usbmisc transition.  For now
 I've just been searching and replacing, but that is of course not
 supportable.  And it isn't really a one-to-one replacement either.
 There are places where usb actually refer to the subsystem and not the
 class.
 
 Should usbmisc be added as an additional device class, keeping usb,
 or should there be some kernel version checking code there?
 

 Can you give me your diff to look at where you did the changes? I guess
 we should try to support both cases, regardless of the kernel version,
 if somehow possible.


This is my diff which is sort of working for me, but I haven't sanity
checked it so there are probably errors here:


diff --git a/plugins/generic/mm-plugin-generic.c 
b/plugins/generic/mm-plugin-generic.c
index e4d4716..ef44cae 100644
--- a/plugins/generic/mm-plugin-generic.c
+++ b/plugins/generic/mm-plugin-generic.c
@@ -70,7 +70,7 @@ create_modem (MMPlugin *self,
 G_MODULE_EXPORT MMPlugin *
 mm_plugin_create (void)
 {
-static const gchar *subsystems[] = { tty, net, usb, NULL };
+static const gchar *subsystems[] = { tty, net, usbmisc, NULL };
 
 return MM_PLUGIN (
 g_object_new (MM_TYPE_PLUGIN_GENERIC,
diff --git a/plugins/gobi/mm-plugin-gobi.c b/plugins/gobi/mm-plugin-gobi.c
index e8fa108..cab0bfb 100644
--- a/plugins/gobi/mm-plugin-gobi.c
+++ b/plugins/gobi/mm-plugin-gobi.c
@@ -61,7 +61,7 @@ create_modem (MMPlugin *self,
 G_MODULE_EXPORT MMPlugin *
 mm_plugin_create (void)
 {
-static const gchar *subsystems[] = { tty, net, usb, NULL };
+static const gchar *subsystems[] = { tty, net, usbmisc, NULL };
 static const gchar *drivers[] = { qcserial, NULL };
 
 return MM_PLUGIN (
diff --git a/plugins/pantech/mm-plugin-pantech.c 
b/plugins/pantech/mm-plugin-pantech.c
index b7957f0..3f37e84 100644
--- a/plugins/pantech/mm-plugin-pantech.c
+++ b/plugins/pantech/mm-plugin-pantech.c
@@ -85,7 +85,7 @@ grab_port (MMPlugin *self,
 G_MODULE_EXPORT MMPlugin *
 mm_plugin_create (void)
 {
-static const gchar *subsystems[] = { tty, net, usb, NULL };
+static const gchar *subsystems[] = { tty, net, usbmisc, NULL };
 static const guint16 vendor_ids[] = { 0x106c, 0 };
 
 return MM_PLUGIN (
diff --git a/src/80-mm-candidate.rules b/src/80-mm-candidate.rules
index 01ba912..58287eb 100644
--- a/src/80-mm-candidate.rules
+++ b/src/80-mm-candidate.rules
@@ -11,6 +11,6 @@ ACTION!=add|change|move, GOTO=mm_candidate_end
 
 SUBSYSTEM==tty, ENV{ID_MM_CANDIDATE}=1
 SUBSYSTEM==net, ENV{ID_MM_CANDIDATE}=1
-KERNEL==cdc-wdm*, SUBSYSTEM==usb, ENV{ID_MM_CANDIDATE}=1
+KERNEL==cdc-wdm*, SUBSYSTEM==usbmisc, ENV{ID_MM_CANDIDATE}=1
 
 LABEL=mm_candidate_end
diff --git a/src/mm-base-modem.c b/src/mm-base-modem.c
index 70cdb0e..adab407 100644
--- a/src/mm-base-modem.c
+++ b/src/mm-base-modem.c
@@ -165,7 +165,7 @@ mm_base_modem_grab_port (MMBaseModem *self,
 /* Only allow 'tty' and 'net' ports */
 if (!g_str_equal (subsys, net) 
 !g_str_equal (subsys, tty) 
-!(g_str_equal (subsys,