Re: 3G Modem DHCP time out

2013-03-27 Thread Bjørn Mork
This may be a problem introduced with the cdc_mbim driver in Linux 3.8. The 
problem is that we don't have userspace support for it yet.

See https://bugzilla.kernel.org/show_bug.cgi?id=54791 for more details. 

Ben Hutchins suggested that ModemManager could include a modprobe.d *.conf 
snippet setting ncm as preferred until the MBIM support is ready. But this 
might not be so easy as long as you need a 3.8.5 or newer kernel to have this 
option...

Ideas are welcome.


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


Re: SMS sending error with Telit module

2013-03-27 Thread Aleksander Morgado
On 27/03/13 10:41, Enrico Murador - Research  Development - CET wrote:
 When I try to send an SMS when connected (with MM 5.2), I get an error
 like cannot send an SMS while connected (maybe connection is made
 using only one USB port?). If data connection is not active, I still
 cannot send SMS, as explained in previous post...
 
 I've attached two debug logs, one from MM 5.2 (startup + successful data
 connection), one from MM7.99 (failed startup, so I cannot make data
 connection/SMS sending tests).
 


In MM 0.7.x, make sure you *unlock* the PIN (if needed) and *enable* the
modem before trying to send SMS, e.g. (assuming index 0 for SMS and modem):
 $ sudo mmcli -i 0 --pin=1234
 $ sudo mmcli -m 0 -e

The, you can play with sending SMS directly from the command line
interface, see:

https://sigquit.wordpress.com/2012/09/14/sms-goodies-in-modemmanager/

Also, not sure what you mean with 'failed' startup. In the logs I just
see that the modem was plugged in, nothing else.


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


Re: SMS sending error with Telit module

2013-03-27 Thread Enrico Murador - Research Development - CET


On 27/03/2013 14:11, Aleksander Morgado wrote:


In MM 0.7.x, make sure you *unlock* the PIN (if needed) and *enable* the
modem before trying to send SMS, e.g. (assuming index 0 for SMS and modem):
  $ sudo mmcli -i 0 --pin=1234
  $ sudo mmcli -m 0 -e

On rows 391/392 of modemLog-V7_99:

debug [1364372591.473118] [mm-at-serial-port.c:397] debug_log(): 
(ttyUSB2): -- 'CRLF+CPIN: READYCRLFCRLFOKCRLF'
debug [1364372591.476778] [mm-iface-modem.c:2692] 
update_lock_info_context_step(): SIM is ready, and no need for the after 
SIM unlock step...


Does this means that PIN is unlocked?


Also, not sure what you mean with 'failed' startup. In the logs I just
see that the modem was plugged in, nothing else.


On MM 5.2 log, I see that modem goes from DISABLED state to ENABLING, 
then ENABLED, then REGISTERED. After that I can start a data connection 
with nmcli con up id 
On MM 7.99 log, the only state change I see is: Modem: state changed 
(unknown - disabled). I've tried to make a connection with the wizard 
(it was a fresh install of 12.10, so no already existing mobile 
connections) , but it shows me no modems on the device selection list.


Maybe I should create a connection with previous NM(9.6) then upgrade NM 
and MM?

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


Re: SMS sending error with Telit module

2013-03-27 Thread Dan Williams
On Wed, 2013-03-27 at 14:39 +0100, Enrico Murador - Research 
Development - CET wrote:
 On 27/03/2013 14:11, Aleksander Morgado wrote:
 
  In MM 0.7.x, make sure you *unlock* the PIN (if needed) and *enable* the
  modem before trying to send SMS, e.g. (assuming index 0 for SMS and modem):
$ sudo mmcli -i 0 --pin=1234
$ sudo mmcli -m 0 -e
 On rows 391/392 of modemLog-V7_99:
 
 debug [1364372591.473118] [mm-at-serial-port.c:397] debug_log(): 
 (ttyUSB2): -- 'CRLF+CPIN: READYCRLFCRLFOKCRLF'
 debug [1364372591.476778] [mm-iface-modem.c:2692] 
 update_lock_info_context_step(): SIM is ready, and no need for the after 
 SIM unlock step...
 
 Does this means that PIN is unlocked?
 
  Also, not sure what you mean with 'failed' startup. In the logs I just
  see that the modem was plugged in, nothing else.
 
 On MM 5.2 log, I see that modem goes from DISABLED state to ENABLING, 
 then ENABLED, then REGISTERED. After that I can start a data connection 
 with nmcli con up id 
 On MM 7.99 log, the only state change I see is: Modem: state changed 
 (unknown - disabled). I've tried to make a connection with the wizard 
 (it was a fresh install of 12.10, so no already existing mobile 
 connections) , but it shows me no modems on the device selection list.
 
 Maybe I should create a connection with previous NM(9.6) then upgrade NM 
 and MM?

NetworkManager needs to be rebuilt with support for the new ModemManager
from git master.  Otherwise it only knows about MM 0.6 and earlier.  So
if you're using the stock NM from 12.10, it won't know how to talk to
latest MM.

Best thing to do there is to use the mmcli commands as Aleksander
suggested, so we can see if everything works correctly.  Then you can
move on to using an NM PPA or something to get a more up-to-date NM.

Dan

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


Re: SMS sending error with Telit module

2013-03-27 Thread Aleksander Morgado
On 27/03/13 14:39, Enrico Murador - Research  Development - CET wrote:
 In MM 0.7.x, make sure you *unlock* the PIN (if needed) and *enable* the
 modem before trying to send SMS, e.g. (assuming index 0 for SMS and
 modem):
   $ sudo mmcli -i 0 --pin=1234
   $ sudo mmcli -m 0 -e
 On rows 391/392 of modemLog-V7_99:
 
 debug [1364372591.473118] [mm-at-serial-port.c:397] debug_log():
 (ttyUSB2): -- 'CRLF+CPIN: READYCRLFCRLFOKCRLF'
 debug [1364372591.476778] [mm-iface-modem.c:2692]
 update_lock_info_context_step(): SIM is ready, and no need for the after
 SIM unlock step...
 
 Does this means that PIN is unlocked?

Yes. Still, you need to manually enable the modem with mmcli -e.

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


Re: SMS sending error with Telit module

2013-03-27 Thread Aleksander Morgado
On 27/03/13 14:46, Dan Williams wrote:
   Also, not sure what you mean with 'failed' startup. In the logs I just
   see that the modem was plugged in, nothing else.
  
  On MM 5.2 log, I see that modem goes from DISABLED state to ENABLING, 
  then ENABLED, then REGISTERED. After that I can start a data connection 
  with nmcli con up id 
  On MM 7.99 log, the only state change I see is: Modem: state changed 
  (unknown - disabled). I've tried to make a connection with the wizard 
  (it was a fresh install of 12.10, so no already existing mobile 
  connections) , but it shows me no modems on the device selection list.
  
  Maybe I should create a connection with previous NM(9.6) then upgrade NM 
  and MM?
 NetworkManager needs to be rebuilt with support for the new ModemManager
 from git master.  Otherwise it only knows about MM 0.6 and earlier.  So
 if you're using the stock NM from 12.10, it won't know how to talk to
 latest MM.
 
 Best thing to do there is to use the mmcli commands as Aleksander
 suggested, so we can see if everything works correctly.  Then you can
 move on to using an NM PPA or something to get a more up-to-date NM.

If you used Marius' PPP, you should already have the proper
NetworkManager installed; you may need to restart it, though.

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


Re: SMS sending error with Telit module

2013-03-27 Thread Enrico Murador - Research Development - CET


On 27/03/2013 14:46, Dan Williams wrote:

NetworkManager needs to be rebuilt with support for the new ModemManager
from git master.  Otherwise it only knows about MM 0.6 and earlier.  So
if you're using the stock NM from 12.10, it won't know how to talk to
latest MM.

Best thing to do there is to use the mmcli commands as Aleksander
suggested, so we can see if everything works correctly.  Then you can
move on to using an NM PPA or something to get a more up-to-date NM.

Dan

I've installed both MM and NM from PPA.

Last try was to downgrade to NM 9.6 and MM6.0, configure a mobile 
broadband connection (with Telit module), then upgrade to MM7.99 and 
NM9.7.995 (I used the Marius repositories), then restart the system.
Now, if I try to enable the connection (with nmcli con up id 
[connection]), i get something like No valid device found.
I tried to enable the modem with mmcli -m 0 -e, and get successfully 
enabled the modem but after that, nmcli gives the same no device found 
result; I tried also to send an SMS with the procedure outlined by 
Aleksander Morgado, but after I write

/|
sudo mmcli -m 0 --messaging-create-sms=text='Test 
message',number='+39**'|/


the call blocks, giving me only a character.

I tried also the sms-send.py script but gives me some DBus Exception 
errors and won't work.
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: SMS sending error with Telit module

2013-03-27 Thread Dan Williams
On Wed, 2013-03-27 at 16:37 +0100, Enrico Murador - Research 
Development - CET wrote:
 On 27/03/2013 14:46, Dan Williams wrote:
  NetworkManager needs to be rebuilt with support for the new ModemManager
  from git master.  Otherwise it only knows about MM 0.6 and earlier.  So
  if you're using the stock NM from 12.10, it won't know how to talk to
  latest MM.
 
  Best thing to do there is to use the mmcli commands as Aleksander
  suggested, so we can see if everything works correctly.  Then you can
  move on to using an NM PPA or something to get a more up-to-date NM.
 
  Dan
 I've installed both MM and NM from PPA.
 
 Last try was to downgrade to NM 9.6 and MM6.0, configure a mobile 
 broadband connection (with Telit module), then upgrade to MM7.99 and 
 NM9.7.995 (I used the Marius repositories), then restart the system.
 Now, if I try to enable the connection (with nmcli con up id 
 [connection]), i get something like No valid device found.
 I tried to enable the modem with mmcli -m 0 -e, and get successfully 
 enabled the modem but after that, nmcli gives the same no device found 
 result; I tried also to send an SMS with the procedure outlined by 
 Aleksander Morgado, but after I write
 /|
 sudo mmcli -m 0 --messaging-create-sms=text='Test 
 message',number='+39**'|/

I don't think he meant you to literally write /| and |/; that'll cause
the shell to give you the  prompt.

It should basically be:

mmcli -m 0 --messaging-create-sms=text='test',number='+39*'

note the path of the saved SMS.

mmcli -m 0 -s path of SMS --send

and that should work.

Dan

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


Re: SMS sending error with Telit module

2013-03-27 Thread Enrico Murador - Research Development - CET

On 27/03/2013 16:52, Dan Williams wrote:
I don't think he meant you to literally write /| and |/; that'll cause 
the shell to give you the  prompt. It should basically be: mmcli -m 0 
--messaging-create-sms=text='test',number='+39*' note the path 
of the saved SMS. mmcli -m 0 -s path of SMS --send and that should 
work. Dan 
The /| and |/ are not part of my original command, maybe was added by 
Thunderbird (Italic text)?

Anyway, I forgot the last double quotes!

Now I get a reply... but not very good:

...first I enable the modem:
:~$ sudo mmcli -m 0 -e
successfully enabled the modem

...then try to create SMS:
:~$ mmcli -m 0 --messaging-create-sms=text='Test 
message',number='+39**'

error: couldn't find modem at '/org/freedesktop/ModemManager1/Modem/0'

...and if I retry after a while:
:~$ mmcli -m 0 --messaging-create-sms=text='Test 
message',number='+39**'

error: modem not enabled yet


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


Re: SMS sending error with Telit module

2013-03-27 Thread Aleksander Morgado
On 27/03/13 17:13, Enrico Murador - Research  Development - CET wrote:
 On 27/03/2013 16:52, Dan Williams wrote:
 I don't think he meant you to literally write /| and |/; that'll cause
 the shell to give you the  prompt. It should basically be: mmcli -m 0
 --messaging-create-sms=text='test',number='+39*' note the path
 of the saved SMS. mmcli -m 0 -s path of SMS --send and that should
 work. Dan 
 The /| and |/ are not part of my original command, maybe was added by
 Thunderbird (Italic text)?
 Anyway, I forgot the last double quotes!
 
 Now I get a reply... but not very good:
 
 ...first I enable the modem:
 :~$ sudo mmcli -m 0 -e
 successfully enabled the modem
 
 ...then try to create SMS:
 :~$ mmcli -m 0 --messaging-create-sms=text='Test
 message',number='+39**'
 error: couldn't find modem at '/org/freedesktop/ModemManager1/Modem/0'
 
 ...and if I retry after a while:
 :~$ mmcli -m 0 --messaging-create-sms=text='Test
 message',number='+39**'
 error: modem not enabled yet
 

That sequence is extremely strange... Was there any MM crash in between?

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


Re: SMS sending error with Telit module

2013-03-27 Thread Enrico Murador - Research Development - CET


On 27/03/2013 17:36, Aleksander Morgado wrote:

That sequence is extremely strange... Was there any MM crash in between?

Yes... I've taken a quick look, the ModemManager PID changes just after 
the completion of mmcli -m 0 -e command (after writing successfully 
enabled).


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


Re: SMS sending error with Telit module

2013-03-27 Thread Aleksander Morgado
On 27/03/13 17:49, Enrico Murador - Research  Development - CET wrote:
 
 On 27/03/2013 17:36, Aleksander Morgado wrote:
 That sequence is extremely strange... Was there any MM crash in between?

 Yes... I've taken a quick look, the ModemManager PID changes just after
 the completion of mmcli -m 0 -e command (after writing successfully
 enabled).

Then, please manually run it like this:

$ sudo mv /usr/sbin/ModemManager /
$ sudo killall -9 ModemManager
$ sudo gdb --args /ModemManager --debug

Re-run the sequence, and once it crashes, and still within gdb, run
bt. That should give us the backtrace. Also attach the debug logs
whenever you get them. You may need to install additional packages
(debug symbols) to get a good backtrace, though. Or, otherwise, just get
the latest MM from git and compile it yourself.

After the test, just do this to recover the original place for the
ModemManager file:

$ sudo mv /ModemManager /usr/sbin


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


[MM][PATCH v5] serial: add support to optionally send line-feed at the end of AT commands.

2013-03-27 Thread ori inbar
---
 src/mm-at-serial-port.c | 40 ++--
 src/mm-at-serial-port.h |  2 ++
 src/mm-plugin.c | 19 +++
 src/mm-plugin.h |  1 +
 src/mm-port-probe.c |  5 +
 src/mm-port-probe.h |  1 +
 6 files changed, 62 insertions(+), 6 deletions(-)
 mode change 100644 = 100755 src/mm-at-serial-port.c

diff --git a/src/mm-at-serial-port.c b/src/mm-at-serial-port.c
old mode 100644
new mode 100755
index 7962622..346221a
--- a/src/mm-at-serial-port.c
+++ b/src/mm-at-serial-port.c
@@ -33,6 +33,7 @@ enum {
 PROP_REMOVE_ECHO,
 PROP_INIT_SEQUENCE_ENABLED,
 PROP_INIT_SEQUENCE,
+PROP_SEND_LF,
 LAST_PROP
 };
 
@@ -50,6 +51,7 @@ typedef struct {
 gboolean remove_echo;
 guint init_sequence_enabled;
 gchar **init_sequence;
+gboolean send_lf;
 } MMAtSerialPortPrivate;
 
 /*/
@@ -286,7 +288,7 @@ parse_unsolicited (MMSerialPort *port, GByteArray *response)
 /*/
 
 static GByteArray *
-at_command_to_byte_array (const char *command, gboolean is_raw)
+at_command_to_byte_array (const char *command, gboolean is_raw, gboolean 
send_lf)
 {
 GByteArray *buf;
 int cmdlen;
@@ -294,7 +296,7 @@ at_command_to_byte_array (const char *command, gboolean 
is_raw)
 g_return_val_if_fail (command != NULL, NULL);
 
 cmdlen = strlen (command);
-buf = g_byte_array_sized_new (cmdlen + 3);
+buf = g_byte_array_sized_new (cmdlen + 4);
 
 if (!is_raw) {
 /* Make sure there's an AT in the front */
@@ -306,8 +308,15 @@ at_command_to_byte_array (const char *command, gboolean 
is_raw)
 
 if (!is_raw) {
 /* Make sure there's a trailing carriage return */
-if (command[cmdlen - 1] != '\r')
-g_byte_array_append (buf, (const guint8 *) \r, 1);
+if ((cmdlen == 0) ||
+(command[cmdlen - 1] != '\r'  (cmdlen == 1 || command[cmdlen - 
2] != '\r')))
+ g_byte_array_append (buf, (const guint8 *) \r, 1);
+if (send_lf) {
+/* Make sure there's a trailing line-feed */
+if ((cmdlen == 0) ||
+(command[cmdlen - 1] != '\n'  (cmdlen == 1 || command[cmdlen 
- 2] != '\n')))
+ g_byte_array_append (buf, (const guint8 *) \n, 1);
+}
 }
 
 return buf;
@@ -323,12 +332,13 @@ mm_at_serial_port_queue_command (MMAtSerialPort *self,
  gpointer user_data)
 {
 GByteArray *buf;
+MMAtSerialPortPrivate *priv = MM_AT_SERIAL_PORT_GET_PRIVATE (self);
 
 g_return_if_fail (self != NULL);
 g_return_if_fail (MM_IS_AT_SERIAL_PORT (self));
 g_return_if_fail (command != NULL);
 
-buf = at_command_to_byte_array (command, is_raw);
+buf = at_command_to_byte_array (command, is_raw, priv-send_lf);
 g_return_if_fail (buf != NULL);
 
 mm_serial_port_queue_command (MM_SERIAL_PORT (self),
@@ -350,12 +360,13 @@ mm_at_serial_port_queue_command_cached (MMAtSerialPort 
*self,
 gpointer user_data)
 {
 GByteArray *buf;
+MMAtSerialPortPrivate *priv = MM_AT_SERIAL_PORT_GET_PRIVATE (self);
 
 g_return_if_fail (self != NULL);
 g_return_if_fail (MM_IS_AT_SERIAL_PORT (self));
 g_return_if_fail (command != NULL);
 
-buf = at_command_to_byte_array (command, is_raw);
+buf = at_command_to_byte_array (command, is_raw, priv-send_lf);
 g_return_if_fail (buf != NULL);
 
 mm_serial_port_queue_command_cached (MM_SERIAL_PORT (self),
@@ -475,6 +486,9 @@ mm_at_serial_port_init (MMAtSerialPort *self)
 priv-remove_echo = TRUE;
 /* By default, run init sequence during first port opening */
 priv-init_sequence_enabled = TRUE;
+
+/* By default, don't send line feed */
+priv-send_lf = FALSE;
 }
 
 static void
@@ -494,6 +508,9 @@ set_property (GObject *object, guint prop_id,
 g_strfreev (priv-init_sequence);
 priv-init_sequence = g_value_dup_boxed (value);
 break;
+case PROP_SEND_LF:
+priv-send_lf = g_value_get_boolean (value);
+break;
 default:
 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 break;
@@ -516,6 +533,9 @@ get_property (GObject *object, guint prop_id,
 case PROP_INIT_SEQUENCE:
 g_value_set_boxed (value, priv-init_sequence);
 break;
+case PROP_SEND_LF:
+g_value_set_boolean (value, priv-send_lf);
+break;
 default:
 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 break;
@@ -590,4 +610,12 @@ mm_at_serial_port_class_init (MMAtSerialPortClass *klass)
  Initialization sequence,
  G_TYPE_STRV,
  G_PARAM_READWRITE));
+
+g_object_class_install_property
+(object_class, PROP_SEND_LF,
+ g_param_spec_boolean 

[MM][PATCH] iface-modem-3gpp: handle access technology change in operator_loading state

2013-03-27 Thread ori inbar
This patch fixes a problem of disregarding CEREG/CGREG/CREG reported
access technology since we are in registering state - meaning we are
loading operator name+code. now even in this transition state the ACT
is updated.

---
 src/mm-iface-modem-3gpp.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c
index 7049ec8..d116e00 100644
--- a/src/mm-iface-modem-3gpp.c
+++ b/src/mm-iface-modem-3gpp.c
@@ -963,6 +963,10 @@ mm_iface_modem_3gpp_update_access_technologies 
(MMIfaceModem3gpp *self,
 MMModemAccessTechnology 
access_tech)
 {
 MMModem3gppRegistrationState state;
+RegistrationStateContext *ctx;
+
+ctx = get_registration_state_context (self);
+g_assert (ctx);
 
 g_object_get (self,
   MM_IFACE_MODEM_3GPP_REGISTRATION_STATE, state,
@@ -971,7 +975,8 @@ mm_iface_modem_3gpp_update_access_technologies 
(MMIfaceModem3gpp *self,
 /* Even if registration state didn't change, report access technology,
  * but only if something valid to report */
 if (state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME ||
-state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) {
+state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING ||
+ctx-reloading_operator) {
 if (access_tech != MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN)
 mm_iface_modem_update_access_technologies (MM_IFACE_MODEM (self),
access_tech,
-- 
1.7.12.4

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


Re: 3G Modem DHCP time out

2013-03-27 Thread Emmanuel Riboulet-Deyris
Thank's a lot Bjørn for pointing me this bug report. It appears that
it's exactly the bug I'm encountering (on the same laptop by the way).

I'm very far away from being an expert about that, but if I understand,
the simplest way to make thinks work currently with a 3.8.x kernel would
be to rebuild my kernel with the key CONFIG_USB_NET_CDC_MBIM set to n.
Is that correct ?

Thanks again,

E.

Le 26/03/2013 17:45, Bjørn Mork a écrit :
 This may be a problem introduced with the cdc_mbim driver in Linux 3.8. The 
 problem is that we don't have userspace support for it yet.

 See https://bugzilla.kernel.org/show_bug.cgi?id=54791 for more details. 

 Ben Hutchins suggested that ModemManager could include a modprobe.d *.conf 
 snippet setting ncm as preferred until the MBIM support is ready. But this 
 might not be so easy as long as you need a 3.8.5 or newer kernel to have this 
 option...

 Ideas are welcome.


 Bjørn

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