Re: [PATCH] Fixed wrong MEM1 value passed to +CPMS

2017-03-23 Thread Carlo Lobrano
> didn't we say that waiting for #QSS:3 was discarded because it would
> take too long, even > 30s?

Yes, but I was thinking about the idea of retrying some commands later when
the SIM is ready

> I think so, yes. That indicates an earlier error, we don't know what
> happened, so we should just return error here as well, IMO.

Ok, I'll update the patch then

On Thu, 23 Mar 2017 at 19:39 Aleksander Morgado 
wrote:

> On Thu, Mar 23, 2017 at 5:32 PM, Carlo Lobrano 
> wrote:
> >> So why is current_sms_mem1_storage UNKNOWN? At which point did it
> >> fail, if it did? Did it fail doing AT+CPMS?
> >
> > Correct. AT+CPMS? returns with SIM Busy. It's something that will be
> better
> > addressed when "delay till #QSS: 3" will be implemented.
> >
>
> didn't we say that waiting for #QSS:3 was discarded because it would
> take too long, even > 30s?
>
> >> I agree that we shouldn't call any CPMS command passing "unknown" as
> >> storage, but defaulting to "SM" isn't a good approach either. [...]
> >> If it is UNKNOWN because init_current_storages() failed, we should
> >> also error out when trying to set_default_storage()
> >
> > I understand that. So, set_default_storage should return error directly
> when
> > it finds that mem1 is UNKNOWN. Is that right?
>
> I think so, yes. That indicates an earlier error, we don't know what
> happened, so we should just return error here as well, IMO.
>
>
> --
> Aleksander
> https://aleksander.es
>
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [PATCH] Fixed wrong MEM1 value passed to +CPMS

2017-03-23 Thread Aleksander Morgado
On Thu, Mar 23, 2017 at 5:32 PM, Carlo Lobrano  wrote:
>> So why is current_sms_mem1_storage UNKNOWN? At which point did it
>> fail, if it did? Did it fail doing AT+CPMS?
>
> Correct. AT+CPMS? returns with SIM Busy. It's something that will be better
> addressed when "delay till #QSS: 3" will be implemented.
>

didn't we say that waiting for #QSS:3 was discarded because it would
take too long, even > 30s?

>> I agree that we shouldn't call any CPMS command passing "unknown" as
>> storage, but defaulting to "SM" isn't a good approach either. [...]
>> If it is UNKNOWN because init_current_storages() failed, we should
>> also error out when trying to set_default_storage()
>
> I understand that. So, set_default_storage should return error directly when
> it finds that mem1 is UNKNOWN. Is that right?

I think so, yes. That indicates an earlier error, we don't know what
happened, so we should just return error here as well, IMO.


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


Re: LibMM-Glib Ansi C Example

2017-03-23 Thread Dan Williams
On Thu, 2017-03-23 at 18:17 +0100, Francesco Andrisani wrote:
> Hi,
> please can someone help me to find some examples for use libmm-glib
> into my
> C application?
> I want:
> - start a modem connection (with ppp interface)

Note that most modems do not use PPP these days.  But if yours does,
that's fine.  You can use "pon" and "poff" provided by ppp to manage
the connection if you like, or run pppd directly.

I saw your note to the NetworkManager list too; if you are using
NetworkManager then you don't need to talk to ModemManager for
connection start/stop; NM will do all that for you.  You would need to
watch MM for signal strength and such though.

Dan

> - Monitor established connection
> - Close modem connection

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


RE: mmcli -m 0 -e command fails

2017-03-23 Thread Jan Graczyk
Hello All,

The command AT+GCAP? returns ERROR. Also the AT command AT+CPIN? Returns +CME 
ERROR: SIM not inserted. I am checking whether the SIM card I am using is 
working or there is a development board hardware  issue.

Jan Graczyk

-Original Message-
From: Dan Williams [mailto:d...@redhat.com] 
Sent: Wednesday, March 22, 2017 7:03 PM
To: Jan Graczyk ; Aleksander Morgado 
Cc: modemmanager-devel@lists.freedesktop.org
Subject: Re: mmcli -m 0 -e command fails

On Thu, 2017-03-23 at 00:28 +, Jan Graczyk wrote:
> Hello Aleksander,
> 
> I have attached a file with the logs from ModemManager --debug 
> command.

The modem doesn't reply to any of the Capabilities requests commands and thus 
MM can't figure out what to do with the modem.

mm_port_serial_close(): (ttymxc2) device open count is 2 (close) debug_l
og(): (ttymxc2): --> 'AT+GCAP'
debug_log(): (ttymxc2): <--
'ERROR'
mm_serial_parser_v1_parse(): Got failure code
100: Unknown error
debug_log(): (ttymxc2): --> 'ATI'
debug_log():
(ttymxc2): <-- 'QuectelUC20Revision:
UC20GQBR03A14E1GOK'
debug_log(): (ttymxc2): -->
'AT+CPIN?'
debug_log(): (ttymxc2): <-- '+CME ERROR:
10'
mm_serial_parser_v1_parse(): Got failure code 10: SIM not inserted
debug_log(): (ttymxc2): --> 'AT+CGMM'
debug_log():
(ttymxc2): <-- 'UC20OK'

This could be due to the SIM failure.  But you could you run minicom or 
something and manually run "AT+GCAP" and "AT+GCAP?" for us?

Dan

> Best Regards,
> Jan Graczyk
> 
> -Original Message-
> From: ModemManager-devel [mailto:modemmanager-devel-boun...@lists.fre
> edesktop.org] On Behalf Of Aleksander Morgado
> Sent: Wednesday, March 22, 2017 4:55 PM
> To: Jan Graczyk 
> Cc: modemmanager-devel@lists.freedesktop.org
> Subject: Re: mmcli -m 0 -e command fails
> 
> Hey Jan,
> 
> On Thu, Mar 23, 2017 at 12:46 AM, Jan Graczyk  wrote:
> > But there I another problem with mmcli ‘enable’ command. Here is the 
> > output:
> > 
> > 
> > 
> > root@linaro-alip:~# mmcli -m 0
> > 
> > 
> > 
> > /org/freedesktop/ModemManager1/Modem/0 (device id 'unknown')
> > 
> >   -
> > 
> >   Hardware |   manufacturer: 'unknown'
> > 
> >    |  model: 'unknown'
> > 
> >    |   revision: 'unknown'
> > 
> >    |  supported: 'none'
> > 
> >    |current: 'none'
> > 
> >    |   equipment id: 'unknown'
> > 
> 
> This is bad, it couldn't load any of the HW information.
> 
> >   -
> > 
> >   System   | device:
> > '/sys/devices/soc0/soc/210.aips-bus/21ec000.serial'
> > 
> >    |drivers: 'imx-uart'
> > 
> >    | plugin: 'Generic'
> > 
> >    |   primary port: 'ttymxc2'
> > 
> >    |  ports: 'ttymxc2 (at)'
> > 
> >   -
> > 
> >   Numbers  |   own : 'unknown'
> > 
> >   -
> > 
> >   Status   |   lock: 'unknown'
> > 
> >    | unlock retries: 'unknown'
> > 
> >    |  state: 'unknown'
> > 
> >    |power state: 'unknown'
> > 
> >    |access tech: 'unknown'
> > 
> >    | signal quality: '0' (cached)
> > 
> 
> Bad bad, there really wasn't anything loaded at all...
> 
> >   -
> > 
> >   Modes|  supported: 'allowed: any; preferred: none'
> > 
> >    |current: 'allowed: any; preferred: none'
> > 
> >   -
> > 
> >   Bands|  supported: 'unknown'
> > 
> >    |current: 'unknown'
> > 
> >   -
> > 
> >   IP   |  supported: 'none'
> > 
> >   -
> > 
> >   SIM  |   path: 'none'
> > 
> > 
> > 
> >   -
> > 
> >   Bearers  |  paths: 'none'
> > 
> > 
> > 
> > root@linaro-alip:~#
> > 
> > root@linaro-alip:~#
> > 
> > root@linaro-alip:~# mmcli -m 0 -e
> > 
> > error: couldn't enable the modem:
> > 'GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Method Enable 
> > is not implemented on interface org.freedesktop.ModemManager1.Modem'
> > 
> > root@linaro-alip:~#
> > 
> > 
> > 
> > Is that there is a problem with SIM card?
> 
> Not with the SIM card; not yet. Looks like the TTY replied only to AT 
> probing and failed to reply to the remaining commands we sent to e.g.
> query manufacturer or model; all that is before the SIM card can be 
> used.
> 
> You'll need to run ModemManager daemon manually with --debug and grab 
> all the debug logs while you reproduce the issue, see:
> https://www.freedesktop.org/wiki/Software/ModemManager/Debugging/
> 
> --
> Aleksander
> https://aleksander.es
> ___
> ModemManager-devel mailing list
> ModemManager-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
> ___
> 

LibMM-Glib Ansi C Example

2017-03-23 Thread Francesco Andrisani
Hi,
please can someone help me to find some examples for use libmm-glib into my
C application?
I want:
- start a modem connection (with ppp interface)
- Monitor established connection
- Close modem connection

Thanks a lot

-- 

*Francesco Andrisani*
mailto:francesco.andris...@acotel.com
*Acotel Spa*
http://www.acotel.com
Via della Valle dei Fontanili, 29
00168 Roma
Tel +390661141200
Fax +39066149936


Le informazioni contenute nella comunicazione che precede possono essere
riservate e sono, comunque, destinate esclusivamente alla persona o
all’ente sopraindicati. La diffusione, distribuzione e/o copiatura non
autorizzata del documento trasmesso da parte di qualsiasi soggetto è
proibita. La sicurezza e la correttezza dei messaggi di posta elettronica
non possono essere garantite. Se avete ricevuto questo messaggio per
errore, Vi preghiamo di contattarci immediatamente. Grazie.

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any transmission. If you
receive this message in error, please immediately delete it and all copies
of it from your system, destroy any hard copies of it and notify the
sender. You must not, directly or indirectly, use, disclose, distribute,
print, or copy any part of this message if you are not the intended
recipient. Thanks
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: PPP modem differences

2017-03-23 Thread Colin Helliwell
Curiouser and curiouser  [I was so much surprised, that for the moment I 
quite forgot how to speak good English]

I thought I was maybe homing in on this problem. I started capturing the 
following investigations, ready to post this. Then I got to the end of writing 
up the info below and while double-checking the results found that, somewhere 
along the way, it had magically started working again with MM.
I wonder if there's some NV settings which had been lost and then found 
themselves restored by some act of my experiments. 
No, I'm not developing on a HAL9000 - though it's beginning to feel like it!

Understand if there's little enthusiasm for discussing it! :S   I just fear 
that whatever was screwed up might come back and bite me/us again in the future.

[Now to try adding NM back in too..]


= Written up *before* the above: ==

I restored a rootfs from just last week, which I'm 99+% sure was working with 
this modem - at the time I was trying to get to the bottom of problems with 
*terminating* the ppp, not establishing it the first place (lack of 'detach' on 
pppd)

But this is also not working with MM. But in experimenting with it, I found 
that leaving out MM and using pppd directly *can* work.
Well, works every other time (2nd/4th/etc). But I think that *may* be an 
un-related init problem, since the driver powers down the modem when all file 
handles are closed - it times out in the chat/connect ("Connect script 
failed"), rather than getting as far as the pppd LCP negotiation.


(Semi-)Working:

root@wg2xx-tx6s:~# pppd nodetach dump call nomgr
pppd options in effect:
debug   # (from /etc/ppp/peers/nomgr)
nodetach# (from command line)
holdoff 10  # (from /etc/ppp/peers/nomgr)
persist # (from /etc/ppp/peers/nomgr)
maxfail 1   # (from /etc/ppp/peers/nomgr)
dump# (from command line)
noauth  # (from /etc/ppp/peers/nomgr)
/dev/ttyMux0# (from /etc/ppp/peers/nomgr)
921600  # (from /etc/ppp/peers/nomgr)
lock# (from /etc/ppp/peers/nomgr)
connect /usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem.chat
# (from /etc/ppp/peers/nomgr)
crtscts # (from /etc/ppp/peers/nomgr)
modem   # (from /etc/ppp/peers/nomgr)
passive # (from /etc/ppp/peers/nomgr)
hide-password   # (from /etc/ppp/peers/nomgr)
novj# (from /etc/ppp/peers/nomgr)
noipdefault # (from /etc/ppp/peers/nomgr)
ipcp-restart 5  # (from /etc/ppp/peers/nomgr)
defaultroute# (from /etc/ppp/peers/nomgr)
usepeerdns  # (from /etc/ppp/peers/nomgr)
chat:  Mar 23 14:00:02 CONNECT
Script /usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem.chat 
finished (pid 1061), status = 0x0
Serial connection established.
using channel 3
Using interface ppp0
Connect: ppp0 <--> /dev/ttyMux0
sent [LCP ConfReq id=0x1]
rcvd [LCP ConfNak id=0x1 ]
sent [LCP ConfReq id=0x2]
rcvd [LCP ConfAck id=0x2]
rcvd [LCP ConfReq id=0x3 
]
No auth is possible
sent [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x5 
]
No auth is possible
sent [LCP ConfRej id=0x5 ]
rcvd [LCP ConfReq id=0x7]
sent [LCP ConfAck id=0x7]
kernel does not support PPP filtering
sent [CCP ConfReq id=0x1   ]
sent [IPCP ConfReq id=0x1   ]
rcvd [LCP ProtRej id=0x8 80 fd 01 01 00 0f 1a 04]
Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
rcvd [IPCP ConfReq id=0x1 ]
sent [IPCP ConfAck id=0x1 ]
rcvd [IPCP ConfNak id=0x1   ]
sent [IPCP ConfReq id=0x2   ]
rcvd [IPCP ConfAck id=0x2   ]
not replacing default route to eth0 [192.168.10.254]
local  IP address 10.8.49.163
remote IP address 192.168.254.254
primary   DNS address 10.206.128.1
secondary DNS address 10.206.128.1
Script /etc/ppp/ip-up started (pid 1062)
Script /etc/ppp/ip-up finished (pid 1062), status = 0x0


root@wg2xx-tx6s:~# cat /etc/ppp/peers/nomgr
ttyMux0
# Note: physical baud rate is determined in LinMux driver (linmuxcfg -b)
115200
lock
crtscts
modem
passive
novj
defaultroute
noipdefault
usepeerdns
noauth
hide-password
persist
holdoff 10
maxfail 1
debug
ipcp-restart 5
connect "/usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem.chat"

root@wg2xx-tx6s:~# cat /etc/ppp/chatscripts/mobile-modem.chat
ABORT 'BUSY'
ABORT 'NO CARRIER'
ABORT 'VOICE'
ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE'
ABORT 'NO ANSWER'
ABORT 'DELAYED'
REPORT CONNECT
TIMEOUT 20
#'' 'ATQ0'
'' 'AT'
#'OK-AT-OK' 'ATZ'
TIMEOUT 3
'OK' @/etc/ppp/chatscripts/pin
'OK\d-AT-OK' 'ATI'
#'OK' 'ATZ'
#'OK' 'ATQ0 V1 E1 S0=0   +FCLASS=0'
'OK' @/etc/ppp/chatscripts/mode
'OK-AT-OK' @/etc/ppp/chatscripts/apn
'OK' 'ATDT*99***1#'
TIMEOUT 30
CONNECT ''

root@wg2xx-tx6s:~# cat /etc/ppp/chatscripts/pin
AT

root@wg2xx-tx6s:~# cat /etc/ppp/chatscripts/mode
AT

root@wg2xx-tx6s:~# cat /etc/ppp/chatscripts/apn
AT+CGDCONT=1,"IP","wap.vodafone.co.uk"

===


> On 22 March 2017 at 15:59 Dan Williams  wrote:
> 

Re: [PATCH] Fixed wrong MEM1 value passed to +CPMS

2017-03-23 Thread Carlo Lobrano
> So why is current_sms_mem1_storage UNKNOWN? At which point did it
> fail, if it did? Did it fail doing AT+CPMS?

Correct. AT+CPMS? returns with SIM Busy. It's something that will be better
addressed when "delay till #QSS: 3" will be implemented.

> I agree that we shouldn't call any CPMS command passing "unknown" as
> storage, but defaulting to "SM" isn't a good approach either. [...]
> If it is UNKNOWN because init_current_storages() failed, we should
> also error out when trying to set_default_storage()

I understand that. So, set_default_storage should return error directly
when it finds that mem1 is UNKNOWN. Is that right?

On Thu, 23 Mar 2017 at 17:16 Aleksander Morgado 
wrote:

> On Thu, Mar 23, 2017 at 2:29 PM, Carlo Lobrano 
> wrote:
> > Let mem1_str defaulting to NULL when current_sms_mem1_storage is
> > MM_SMS_STORAGE_UNKNOWN
> >
> > modem_messaging_set_default_storage considers mem1 storage
> > string valid if *not NULL*, but, previously, when we could not get
> > current_sms_mem1_storage value right, mem1_str defaulted to "unknown"
> > and that string was used in +CPMS command, resulting in an ERROR.
> >
>
> The current_sms_mem1_storage shouldn't be UNKNOWN unless:
>   * init_current_storages() hasn't been run yet
>   * init_current_storages () failed.
>
> So why is current_sms_mem1_storage UNKNOWN? At which point did it
> fail, if it did? Did it fail doing AT+CPMS? in
> modem_messaging_init_current_storages()? Or is it that
> set_default_storage() was called before init_current_storages() was
> executed?
>
> I agree that we shouldn't call any CPMS command passing "unknown" as
> storage, but defaulting to "SM" isn't a good approach either. We
> actually test which are the supported storages at some point
> (modem_messaging_load_supported_storages()) to avoid assuming any of
> them is always available.
>
> If it is UNKNOWN because init_current_storages() failed, we should
> also error out when trying to set_default_storage()
>
> > ---
> >  src/mm-broadband-modem.c | 9 ++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
> > index 17b3253..776e6d1 100644
> > --- a/src/mm-broadband-modem.c
> > +++ b/src/mm-broadband-modem.c
> > @@ -5587,7 +5587,7 @@ modem_messaging_set_default_storage
> (MMIfaceModemMessaging *_self,
> >  MMBroadbandModem *self = MM_BROADBAND_MODEM (_self);
> >  gchar *cmd;
> >  GSimpleAsyncResult *result;
> > -gchar *mem1_str;
> > +gchar *mem1_str = NULL;
> >  gchar *mem_str;
> >
> >  result = g_simple_async_result_new (G_OBJECT (self),
> > @@ -5599,11 +5599,14 @@ modem_messaging_set_default_storage
> (MMIfaceModemMessaging *_self,
> >  self->priv->current_sms_mem2_storage = storage;
> >
> >  /* We provide the current sms storage for mem1 if not UNKNOWN */
> > -mem1_str = g_ascii_strup (mm_sms_storage_get_string
> (self->priv->current_sms_mem1_storage), -1);
> > +if (self->priv->current_sms_mem1_storage != MM_SMS_STORAGE_UNKNOWN)
> {
> > +mem1_str = g_ascii_strup (mm_sms_storage_get_string
> (self->priv->current_sms_mem1_storage), -1);
> > +}
> >
> >  mem_str = g_ascii_strup (mm_sms_storage_get_string (storage), -1);
> >  cmd = g_strdup_printf ("+CPMS=\"%s\",\"%s\",\"%s\"",
> > -   mem1_str ? mem1_str : "",
> > +   /* Empty value is not accepted and SM is the
> default one */
> > +   mem1_str ? mem1_str : "SM",
> > mem_str,
> > mem_str);
> >  mm_base_modem_at_command (MM_BASE_MODEM (self),
> > --
> > 2.9.3
> >
> > ___
> > ModemManager-devel mailing list
> > ModemManager-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
>
>
>
> --
> Aleksander
> https://aleksander.es
>
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: [PATCH] Fixed wrong MEM1 value passed to +CPMS

2017-03-23 Thread Aleksander Morgado
On Thu, Mar 23, 2017 at 2:29 PM, Carlo Lobrano  wrote:
> Let mem1_str defaulting to NULL when current_sms_mem1_storage is
> MM_SMS_STORAGE_UNKNOWN
>
> modem_messaging_set_default_storage considers mem1 storage
> string valid if *not NULL*, but, previously, when we could not get
> current_sms_mem1_storage value right, mem1_str defaulted to "unknown"
> and that string was used in +CPMS command, resulting in an ERROR.
>

The current_sms_mem1_storage shouldn't be UNKNOWN unless:
  * init_current_storages() hasn't been run yet
  * init_current_storages () failed.

So why is current_sms_mem1_storage UNKNOWN? At which point did it
fail, if it did? Did it fail doing AT+CPMS? in
modem_messaging_init_current_storages()? Or is it that
set_default_storage() was called before init_current_storages() was
executed?

I agree that we shouldn't call any CPMS command passing "unknown" as
storage, but defaulting to "SM" isn't a good approach either. We
actually test which are the supported storages at some point
(modem_messaging_load_supported_storages()) to avoid assuming any of
them is always available.

If it is UNKNOWN because init_current_storages() failed, we should
also error out when trying to set_default_storage()

> ---
>  src/mm-broadband-modem.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
> index 17b3253..776e6d1 100644
> --- a/src/mm-broadband-modem.c
> +++ b/src/mm-broadband-modem.c
> @@ -5587,7 +5587,7 @@ modem_messaging_set_default_storage 
> (MMIfaceModemMessaging *_self,
>  MMBroadbandModem *self = MM_BROADBAND_MODEM (_self);
>  gchar *cmd;
>  GSimpleAsyncResult *result;
> -gchar *mem1_str;
> +gchar *mem1_str = NULL;
>  gchar *mem_str;
>
>  result = g_simple_async_result_new (G_OBJECT (self),
> @@ -5599,11 +5599,14 @@ modem_messaging_set_default_storage 
> (MMIfaceModemMessaging *_self,
>  self->priv->current_sms_mem2_storage = storage;
>
>  /* We provide the current sms storage for mem1 if not UNKNOWN */
> -mem1_str = g_ascii_strup (mm_sms_storage_get_string 
> (self->priv->current_sms_mem1_storage), -1);
> +if (self->priv->current_sms_mem1_storage != MM_SMS_STORAGE_UNKNOWN) {
> +mem1_str = g_ascii_strup (mm_sms_storage_get_string 
> (self->priv->current_sms_mem1_storage), -1);
> +}
>
>  mem_str = g_ascii_strup (mm_sms_storage_get_string (storage), -1);
>  cmd = g_strdup_printf ("+CPMS=\"%s\",\"%s\",\"%s\"",
> -   mem1_str ? mem1_str : "",
> +   /* Empty value is not accepted and SM is the 
> default one */
> +   mem1_str ? mem1_str : "SM",
> mem_str,
> mem_str);
>  mm_base_modem_at_command (MM_BASE_MODEM (self),
> --
> 2.9.3
>
> ___
> ModemManager-devel mailing list
> ModemManager-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel



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


[PATCH] Fixed wrong MEM1 value passed to +CPMS

2017-03-23 Thread Carlo Lobrano
Let mem1_str defaulting to NULL when current_sms_mem1_storage is
MM_SMS_STORAGE_UNKNOWN

modem_messaging_set_default_storage considers mem1 storage
string valid if *not NULL*, but, previously, when we could not get
current_sms_mem1_storage value right, mem1_str defaulted to "unknown"
and that string was used in +CPMS command, resulting in an ERROR.

---
 src/mm-broadband-modem.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
index 17b3253..776e6d1 100644
--- a/src/mm-broadband-modem.c
+++ b/src/mm-broadband-modem.c
@@ -5587,7 +5587,7 @@ modem_messaging_set_default_storage 
(MMIfaceModemMessaging *_self,
 MMBroadbandModem *self = MM_BROADBAND_MODEM (_self);
 gchar *cmd;
 GSimpleAsyncResult *result;
-gchar *mem1_str;
+gchar *mem1_str = NULL;
 gchar *mem_str;
 
 result = g_simple_async_result_new (G_OBJECT (self),
@@ -5599,11 +5599,14 @@ modem_messaging_set_default_storage 
(MMIfaceModemMessaging *_self,
 self->priv->current_sms_mem2_storage = storage;
 
 /* We provide the current sms storage for mem1 if not UNKNOWN */
-mem1_str = g_ascii_strup (mm_sms_storage_get_string 
(self->priv->current_sms_mem1_storage), -1);
+if (self->priv->current_sms_mem1_storage != MM_SMS_STORAGE_UNKNOWN) {
+mem1_str = g_ascii_strup (mm_sms_storage_get_string 
(self->priv->current_sms_mem1_storage), -1);
+}
 
 mem_str = g_ascii_strup (mm_sms_storage_get_string (storage), -1);
 cmd = g_strdup_printf ("+CPMS=\"%s\",\"%s\",\"%s\"",
-   mem1_str ? mem1_str : "",
+   /* Empty value is not accepted and SM is the 
default one */
+   mem1_str ? mem1_str : "SM",
mem_str,
mem_str);
 mm_base_modem_at_command (MM_BASE_MODEM (self),
-- 
2.9.3

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


Re: AW: h5321gw Problem with --location-get

2017-03-23 Thread Aleksander Morgado
On 23/03/17 08:47, Thomas Lang wrote:
> Hmm. I tried at+CREG? To get the CellInfo. But I the response is empty. In 
> the Debug the info is present:
> 
> ModemManager[3184]:  [1490255043.880383] [mm-port-serial.c:1237] 
> mm_port_serial_open(): (cdc-wdm2) device open count is 2 (open)
> ModemManager[3184]:  [1490255043.880449] [mm-port-serial-at.c:440] 
> debug_log(): (cdc-wdm2): --> 'AT+CREG?'
> ModemManager[3184]:  [1490255043.917955] [mm-port-serial-at.c:440] 
> debug_log(): (cdc-wdm2): <-- '+CREG: 
> 2,1,"03B9","0EAD5D18",2OK'
> ModemManager[3184]:  [1490255043.918155] [mm-port-serial.c:1294] 
> _close_internal(): (cdc-wdm2) device open count is 1 (close)
> 
> Can I use the mmcli -m 0 --commnad=+CREG?

That is expected, because the response is processed by the unsolicited
message handlers, so you just get an empty string as return.

Do you see any 3GPP location info reported by mmcli --location-get-3gpp
after having sent +CREG with --command?

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


AW: h5321gw Problem with --location-get

2017-03-23 Thread Thomas Lang
Hmm. I tried at+CREG? To get the CellInfo. But I the response is empty. In the 
Debug the info is present:

ModemManager[3184]:  [1490255043.880383] [mm-port-serial.c:1237] 
mm_port_serial_open(): (cdc-wdm2) device open count is 2 (open)
ModemManager[3184]:  [1490255043.880449] [mm-port-serial-at.c:440] 
debug_log(): (cdc-wdm2): --> 'AT+CREG?'
ModemManager[3184]:  [1490255043.917955] [mm-port-serial-at.c:440] 
debug_log(): (cdc-wdm2): <-- '+CREG: 
2,1,"03B9","0EAD5D18",2OK'
ModemManager[3184]:  [1490255043.918155] [mm-port-serial.c:1294] 
_close_internal(): (cdc-wdm2) device open count is 1 (close)

Can I use the mmcli -m 0 --commnad=+CREG?

Thomas

On Wed, 2017-03-22 at 22:14 -0500, Dan Williams wrote:
> On Wed, 2017-03-22 at 20:34 +, Thomas Lang wrote:
> > Hi,
> > I'm trying to get the cellId info from an Ericsson module. I'm using 
> > the modemmanager version 1.6.4.
> 
> What firmware version?
> 
> Is the firmware MBIM-mode or AT-mode?

I updated my HS2350 (rebranded h5321gw) to MBIM-enabled firmware R3C11 and 
tested it out.

The MBIM protocol does not give ModemManager the LAC/CI at all, so MM can't 
actually tell you any of that.  And it's a bug in ModemManager that it says 
MBIM devices actually have 3gpp-lac-ci capability; that should be removed.

In the case of the Ericsson devices though, they still present an AT port, so 
it's possible we could get that information via the AT port while still 
controlling the modem with MBIM.  Unfortunately though, that's not implemented.

If you can manage to flash it back to R1D08 or whatever is the pre-MBIM 
firmware, it'll get used as a normal "MBM" modem and that would allow LAC/CI 
presentation.

Dan

> Dan
> 
> > tactilo@VirtualBox001:~$ mmcli -m 0 --location-status
> > 
> > /org/freedesktop/ModemManager1/Modem/0
> >   
> >   Location |   capabilities: '3gpp-lac-ci'
> >    |enabled: '3gpp-lac-ci'
> >    |signals: 'no'
> > tactilo@VirtualBox001:~$ mmcli -m 0 --location-get
> > 
> > /org/freedesktop/ModemManager1/Modem/0
> >   -
> >   3GPP location   | Not available
> >   -
> >   GPS NMEA traces | Not available
> >   -
> >   Raw GPS | Not available
> >   -
> >   CDMA BS | Not available
> > 
> > As you can see from the logs the status says 3gpp-lac-ci is 
> > supported and enabled but the location-get function response with 
> > not available.
> > How can I get the 3gpp location?
> > Kind regards,
> > Thomas
> > 
> > ___
> > ModemManager-devel mailing list
> > ModemManager-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
> 
> ___
> ModemManager-devel mailing list
> ModemManager-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: PPP modem differences

2017-03-23 Thread Colin Helliwell

> On 22 March 2017 at 15:59 Dan Williams  wrote:
> 
> On Wed, 2017-03-22 at 14:41 +, Colin Helliwell wrote:
> 
> > > On 22 March 2017 at 13:50 Dan Williams  wrote:
> > > 
> > > On Wed, 2017-03-22 at 13:23 +, colin.helliw...@ln-systems.com
> > > wrote:
> > > 
> > > > I know this might not be an issue with MM, but as there's also a
> > > > lot
> > > > of
> > > > modem-savvy people here.. :)
> > > > 
> > > > I've got the same system trying to make a ppp connection via MM.
> > > > I'm
> > > > using
> > > > the same SIM card, and running
> > > >  mmcli -m 0 --simple-connect="apn=mobile.o2.co.uk"
> > > >  pppd nodetach call provider
> > > 
> > > Quite puzzling; I haven't seen these kinds of requests originating
> > > from
> > > the modem before. But some thoughts:
> > > 
> > > 1) same modem hardware? If so, same firmware? If not, I wouldn't be
> > > surprised that different hardware is working differently, though I
> > > haven't seen these kind of challenges from the modem before.
> > 
> > Nope - both Cinterion, but different models.
> 
> That would do it.
> 
> > > 2) Modems do store some state in NVRAM. Sometimes that can include
> > > things like the default authentication mechanism (CHAP vs. PAP vs.
> > > none). Perhaps your second device has a different setting for that
> > > PDP
> > > context; what does AT+CGDCONT=? say between them?
> > 
> > I'd looked at those, and they seemed sane (as far as they go).
> > Working:
> > mmcli -m 0 --command="AT+CGDCONT?"
> > response: '+CGDCONT: 1,"IP","wap.vodafone.co.uk","0.0.0.0",0,0
> > +CGDCONT: 2,"IPV4V6","wap.vodafone.co.uk","",0,0'
> > [MM log showed cid 1 being used in the AT*99]
> > 
> > Non-working:
> > mmcli -m 0 --command="AT+CGDCONT?"
> > response: '+CGDCONT: 1,"IP","wap.vodafone.co.uk","0.0.0.0",0,0'
> 
> What do you get for AT^SGAUTH? for both devices?
> 

Working:
'^SGAUTH: 1,0,""
^SGAUTH: 2,0,""
^SGAUTH: 3,0,""'

Non-working:
'^SGAUTH: 3'

Which are the factory defaults in both cases.
Changing on the non-working does affect auth negotiation:
0 (None):
{none}

1 (PAP):
rcvd [LCP ConfReq id=0x3 
]
No auth is possible
sent [LCP ConfRej id=0x3 ]

2 (CHAP):
rcvd [LCP ConfReq id=0x3 
]
No auth is possible
sent [LCP ConfRej id=0x3 ]

3 (PAP & CHAP):
rcvd [LCP ConfReq id=0x3 
]
No auth is possible
sent [LCP ConfRej id=0x3 ]
rcvd [LCP ConfReq id=0x5 
]
No auth is possible
sent [LCP ConfRej id=0x5 ]

But even setting to 0 like the working one, still no connection:
Connect: ppp0 <--> /dev/ttyMux0
sent [LCP ConfReq id=0x1]
rcvd [LCP ConfNak id=0x1 ]
sent [LCP ConfReq id=0x2]
rcvd [LCP ConfAck id=0x2]
rcvd [LCP ConfReq id=0x3]
sent [LCP ConfAck id=0x3]
kernel does not support PPP filtering
sent [CCP ConfReq id=0x1   ]
sent [IPCP ConfReq id=0x1   ]
rcvd [LCP ProtRej id=0x4 80 fd 01 01 00 0f 1a 04]
Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
rcvd [LCP TermReq id=0x5]
LCP terminated by peer
sent [LCP TermAck id=0x5]
rcvd [LCP TermReq id=0x5]
sent [LCP TermAck id=0x5]
Connection terminated.
Modem hangup

Puzzled why the remote end requests a non-zero asyncmap, yet doesn't on the 
working one (same SIM/APN).
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


AW: h5321gw Problem with --location-get

2017-03-23 Thread Thomas Lang
Hi Dan,
please see:
  -
  Hardware |   manufacturer: 'Ericsson MBM'
   |  model: 'MBIM [0BDB:1926]'
   |   revision: 'R3C11 (Pro), R4D04 (App)'
   |  supported: 'gsm-umts'
   |current: 'gsm-umts'
   |   equipment id: ''
  -
  System   | device: '/sys/devices/pci:00/:00:0b.0/usb1/1-1'
   |drivers: 'cdc_wdm, cdc_acm, cdc_mbim'
   | plugin: 'Ericsson MBM'
   |   primary port: 'cdc-wdm2'
   |  ports: 'wwp0s11u1i6 (net), ttyACM0 (at), cdc-wdm2 (mbim), 
ttyACM1 (at), ttyACM2 (gps)'

Thomas

-Ursprüngliche Nachricht-
Von: Dan Williams [mailto:d...@redhat.com] 
Gesendet: Donnerstag, 23. März 2017 04:14
An: Thomas Lang ; ModemManager (development) 

Betreff: Re: h5321gw Problem with --location-get

On Wed, 2017-03-22 at 20:34 +, Thomas Lang wrote:
> Hi,
> I'm trying to get the cellId info from an Ericsson module. I'm using 
> the modemmanager version 1.6.4.

What firmware version?

Is the firmware MBIM-mode or AT-mode?

Dan

> tactilo@VirtualBox001:~$ mmcli -m 0 --location-status
> 
> /org/freedesktop/ModemManager1/Modem/0
>   
>   Location |   capabilities: '3gpp-lac-ci'
>    |enabled: '3gpp-lac-ci'
>    |signals: 'no'
> tactilo@VirtualBox001:~$ mmcli -m 0 --location-get
> 
> /org/freedesktop/ModemManager1/Modem/0
>   -
>   3GPP location   | Not available
>   -
>   GPS NMEA traces | Not available
>   -
>   Raw GPS | Not available
>   -
>   CDMA BS | Not available
> 
> As you can see from the logs the status says 3gpp-lac-ci is supported 
> and enabled but the location-get function response with not available.
> How can I get the 3gpp location?
> Kind regards,
> Thomas
> 
> ___
> ModemManager-devel mailing list
> ModemManager-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: h5321gw Problem with --location-get

2017-03-23 Thread Dan Williams
On Thu, 2017-03-23 at 01:00 -0500, Dan Williams wrote:
> On Wed, 2017-03-22 at 22:14 -0500, Dan Williams wrote:
> > On Wed, 2017-03-22 at 20:34 +, Thomas Lang wrote:
> > > Hi,
> > > I'm trying to get the cellId info from an Ericsson module. I'm
> > > using
> > > the modemmanager version 1.6.4.
> > 
> > What firmware version?
> > 
> > Is the firmware MBIM-mode or AT-mode?
> 
> I updated my HS2350 (rebranded h5321gw) to MBIM-enabled firmware
> R3C11
> and tested it out.
> 
> The MBIM protocol does not give ModemManager the LAC/CI at all, so MM
> can't actually tell you any of that.  And it's a bug in ModemManager
> that it says MBIM devices actually have 3gpp-lac-ci capability; that
> should be removed.
> 
> In the case of the Ericsson devices though, they still present an AT
> port, so it's possible we could get that information via the AT port
> while still controlling the modem with MBIM.  Unfortunately though,
> that's not implemented.
> 
> If you can manage to flash it back to R1D08 or whatever is the pre-
> MBIM 
> firmware, it'll get used as a normal "MBM" modem and that would allow
> LAC/CI presentation.

Or another thought:

1) rmmod cdc_mbim
2) plug the modem in

then MM will detect it as a regular Ericsson MBM modem using AT
commands and you should be able to get LAC/CI and location info.  You
probably won't be able to start a data connection though, since these
devices do not provide the psuedo-ethernet port which ModemManager
requires for Ericsson MBM modems.

Dan

> Dan
> 
> > Dan
> > 
> > > tactilo@VirtualBox001:~$ mmcli -m 0 --location-status
> > > 
> > > /org/freedesktop/ModemManager1/Modem/0
> > >   
> > >   Location |   capabilities: '3gpp-lac-ci'
> > >    |enabled: '3gpp-lac-ci'
> > >    |signals: 'no'
> > > tactilo@VirtualBox001:~$ mmcli -m 0 --location-get
> > > 
> > > /org/freedesktop/ModemManager1/Modem/0
> > >   -
> > >   3GPP location   | Not available
> > >   -
> > >   GPS NMEA traces | Not available
> > >   -
> > >   Raw GPS | Not available
> > >   -
> > >   CDMA BS | Not available
> > > 
> > > As you can see from the logs the status says 3gpp-lac-ci is
> > > supported
> > > and enabled but the location-get function response with not
> > > available.
> > > How can I get the 3gpp location?
> > > Kind regards,
> > > Thomas
> > > 
> > > ___
> > > ModemManager-devel mailing list
> > > ModemManager-devel@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
> > 
> > ___
> > ModemManager-devel mailing list
> > ModemManager-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
> 
> ___
> ModemManager-devel mailing list
> ModemManager-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


Re: h5321gw Problem with --location-get

2017-03-23 Thread Dan Williams
On Wed, 2017-03-22 at 22:14 -0500, Dan Williams wrote:
> On Wed, 2017-03-22 at 20:34 +, Thomas Lang wrote:
> > Hi,
> > I'm trying to get the cellId info from an Ericsson module. I'm
> > using
> > the modemmanager version 1.6.4.
> 
> What firmware version?
> 
> Is the firmware MBIM-mode or AT-mode?

I updated my HS2350 (rebranded h5321gw) to MBIM-enabled firmware R3C11
and tested it out.

The MBIM protocol does not give ModemManager the LAC/CI at all, so MM
can't actually tell you any of that.  And it's a bug in ModemManager
that it says MBIM devices actually have 3gpp-lac-ci capability; that
should be removed.

In the case of the Ericsson devices though, they still present an AT
port, so it's possible we could get that information via the AT port
while still controlling the modem with MBIM.  Unfortunately though,
that's not implemented.

If you can manage to flash it back to R1D08 or whatever is the pre-MBIM 
firmware, it'll get used as a normal "MBM" modem and that would allow
LAC/CI presentation.

Dan

> Dan
> 
> > tactilo@VirtualBox001:~$ mmcli -m 0 --location-status
> > 
> > /org/freedesktop/ModemManager1/Modem/0
> >   
> >   Location |   capabilities: '3gpp-lac-ci'
> >    |enabled: '3gpp-lac-ci'
> >    |signals: 'no'
> > tactilo@VirtualBox001:~$ mmcli -m 0 --location-get
> > 
> > /org/freedesktop/ModemManager1/Modem/0
> >   -
> >   3GPP location   | Not available
> >   -
> >   GPS NMEA traces | Not available
> >   -
> >   Raw GPS | Not available
> >   -
> >   CDMA BS | Not available
> > 
> > As you can see from the logs the status says 3gpp-lac-ci is
> > supported
> > and enabled but the location-get function response with not
> > available.
> > How can I get the 3gpp location?
> > Kind regards,
> > Thomas
> > 
> > ___
> > ModemManager-devel mailing list
> > ModemManager-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
> 
> ___
> ModemManager-devel mailing list
> ModemManager-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel