Re: [PATCH 2/2] broadband-modem: normalize also operator code

2017-03-31 Thread Dan Williams
On Sat, 2017-03-25 at 21:39 +0100, Aleksander Morgado wrote:
> The operator code (MCCMNC) may also be given encoded in the current
> charset (e.g. UCS2).

LGTM.

Dan

> Based on a patch from Colin Helliwell  >
> ---
>  plugins/altair/mm-broadband-modem-altair-lte.c | 2 +-
>  src/mm-broadband-modem.c   | 6 --
>  src/mm-modem-helpers.c | 4 ++--
>  src/mm-modem-helpers.h | 4 ++--
>  src/tests/test-modem-helpers.c | 7 ++-
>  5 files changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/plugins/altair/mm-broadband-modem-altair-lte.c
> b/plugins/altair/mm-broadband-modem-altair-lte.c
> index 1155a7a1..3cbc7ecb 100644
> --- a/plugins/altair/mm-broadband-modem-altair-lte.c
> +++ b/plugins/altair/mm-broadband-modem-altair-lte.c
> @@ -1128,7 +1128,7 @@ modem_3gpp_load_operator_name_finish
> (MMIfaceModem3gpp *self,
> error))
>  return NULL;
>  
> -mm_3gpp_normalize_operator_name (_name,
> MM_MODEM_CHARSET_UNKNOWN);
> +mm_3gpp_normalize_operator (_name,
> MM_MODEM_CHARSET_UNKNOWN);
>  if (operator_name)
>  mm_dbg ("loaded Operator Name: %s", operator_name);
>  return operator_name;
> diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c
> index 302fc3db..e98f8dc0 100644
> --- a/src/mm-broadband-modem.c
> +++ b/src/mm-broadband-modem.c
> @@ -3472,7 +3472,9 @@ modem_3gpp_load_operator_code_finish
> (MMIfaceModem3gpp *self,
> error))
>  return NULL;
>  
> -mm_dbg ("loaded Operator Code: %s", operator_code);
> +mm_3gpp_normalize_operator (_code, MM_BROADBAND_MODEM
> (self)->priv->modem_current_charset);
> +if (operator_code)
> +mm_dbg ("loaded Operator Code: %s", operator_code);
>  return operator_code;
>  }
>  
> @@ -3513,7 +3515,7 @@ modem_3gpp_load_operator_name_finish
> (MMIfaceModem3gpp *self,
> error))
>  return NULL;
>  
> -mm_3gpp_normalize_operator_name (_name,
> MM_BROADBAND_MODEM (self)->priv->modem_current_charset);
> +mm_3gpp_normalize_operator (_name, MM_BROADBAND_MODEM
> (self)->priv->modem_current_charset);
>  if (operator_name)
>  mm_dbg ("loaded Operator Name: %s", operator_name);
>  return operator_name;
> diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
> index 9266a5a0..b4556176 100644
> --- a/src/mm-modem-helpers.c
> +++ b/src/mm-modem-helpers.c
> @@ -3123,8 +3123,8 @@ mm_string_to_access_tech (const gchar *string)
>  /***
> **/
>  
>  void
> -mm_3gpp_normalize_operator_name (gchar  **operator,
> - MMModemCharset   cur_charset)
> +mm_3gpp_normalize_operator (gchar  **operator,
> +MMModemCharset   cur_charset)
>  {
>  g_assert (operator);
>  
> diff --git a/src/mm-modem-helpers.h b/src/mm-modem-helpers.h
> index 33af48b6..a74924e3 100644
> --- a/src/mm-modem-helpers.h
> +++ b/src/mm-modem-helpers.h
> @@ -294,8 +294,8 @@ gchar *mm_3gpp_facility_to_acronym
> (MMModem3gppFacility facility);
>  
>  MMModemAccessTechnology mm_string_to_access_tech (const gchar
> *string);
>  
> -void mm_3gpp_normalize_operator_name (gchar  **operator,
> -  MMModemCharset   cur_charset);
> +void mm_3gpp_normalize_operator (gchar  **operator,
> + MMModemCharset   cur_charset);
>  
>  gboolean mm_3gpp_parse_operator_id (const gchar *operator_id,
>  guint16 *mcc,
> diff --git a/src/tests/test-modem-helpers.c b/src/tests/test-modem-
> helpers.c
> index 98f30f83..ae0eec99 100644
> --- a/src/tests/test-modem-helpers.c
> +++ b/src/tests/test-modem-helpers.c
> @@ -876,13 +876,18 @@ typedef struct {
>  static const NormalizeOperatorTest normalize_operator_tests[] = {
>  /* charset unknown */
>  { "Verizon", MM_MODEM_CHARSET_UNKNOWN, "Verizon" },
> +{ "311480",  MM_MODEM_CHARSET_UNKNOWN, "311480"  },
>  /* charset configured as IRA (ASCII) */
>  { "Verizon", MM_MODEM_CHARSET_IRA, "Verizon" },
> +{ "311480",  MM_MODEM_CHARSET_IRA, "311480"  },
>  /* charset configured as GSM7 */
>  { "Verizon", MM_MODEM_CHARSET_GSM, "Verizon" },
> +{ "311480",  MM_MODEM_CHARSET_GSM, "311480"  },
>  /* charset configured as UCS2 */
>  { "0056006500720069007A006F006E", MM_MODEM_CHARSET_UCS2,
> "Verizon" },
> +{ "003300310031003400380030", MM_MODEM_CHARSET_UCS2,
> "311480"  },
>  { "Verizon",  MM_MODEM_CHARSET_UCS2,
> "Verizon" },
> +{ "311480",   MM_MODEM_CHARSET_UCS2,
> "311480"  },
>  };
>  
>  static void
> @@ -891,7 +896,7 @@ common_test_normalize_operator (const
> NormalizeOperatorTest *t)
>  gchar *str;
>  

Re: [PATCH 1/2] modem-helpers: if operator not in UCS2, see if already valid UTF-8

2017-03-31 Thread Dan Williams
On Sat, 2017-03-25 at 21:39 +0100, Aleksander Morgado wrote:
> The method doing the operator name normalization takes as input the
> current configured modem charset. If this is UCS2, we will now just
> assume this is a hint: the string may or may not come in hex/UCS2.
> 
> This logic makes the custom operator name loading in Huawei unneeded,
> if the modem is configured in UCS2, we still properly process
> operator
> names coming in plain ASCII.

LGTM.

Dan

> ---
>  plugins/huawei/mm-broadband-modem-huawei.c | 51 
> --
>  src/mm-modem-helpers.c | 26 +--
>  src/tests/test-modem-helpers.c | 45
> ++
>  3 files changed, 62 insertions(+), 60 deletions(-)
> 
> diff --git a/plugins/huawei/mm-broadband-modem-huawei.c
> b/plugins/huawei/mm-broadband-modem-huawei.c
> index 74e680b4..9f13b0f2 100644
> --- a/plugins/huawei/mm-broadband-modem-huawei.c
> +++ b/plugins/huawei/mm-broadband-modem-huawei.c
> @@ -2172,55 +2172,6 @@ modem_3gpp_disable_unsolicited_events
> (MMIfaceModem3gpp *self,
>  }
>  
>  /***
> **/
> -/* Operator Name loading (3GPP interface) */
> -
> -static gchar *
> -modem_3gpp_load_operator_name_finish (MMIfaceModem3gpp *self,
> -  GAsyncResult *res,
> -  GError **error)
> -{
> -const gchar *result;
> -gchar *operator_name = NULL;
> -
> -result = mm_base_modem_at_command_finish (MM_BASE_MODEM (self),
> res, error);
> -if (!result)
> -return NULL;
> -
> -if (!mm_3gpp_parse_cops_read_response (result,
> -   NULL, /* mode */
> -   NULL, /* format */
> -   _name,
> -   NULL, /* act */
> -   error))
> -return NULL;
> -
> -/* Despite +CSCS? may claim supporting UCS2, Huawei modems
> always report the
> - * operator name in ASCII in a +COPS response. Thus, we ignore
> the current
> - * charset claimed by the modem and assume the charset is IRA
> when parsing
> - * the operator name.
> - */
> -mm_3gpp_normalize_operator_name (_name,
> MM_MODEM_CHARSET_IRA);
> -if (operator_name)
> -mm_dbg ("loaded Operator Name: %s", operator_name);
> -
> -return operator_name;
> -}
> -
> -static void
> -modem_3gpp_load_operator_name (MMIfaceModem3gpp *self,
> -   GAsyncReadyCallback callback,
> -   gpointer user_data)
> -{
> -mm_dbg ("loading Operator Name (huawei)...");
> -mm_base_modem_at_command (MM_BASE_MODEM (self),
> -  "+COPS=3,0;+COPS?",
> -  3,
> -  FALSE,
> -  callback,
> -  user_data);
> -}
> -
> -/***
> **/
>  /* Create Bearer (Modem interface) */
>  
>  typedef struct {
> @@ -4603,8 +4554,6 @@ iface_modem_3gpp_init (MMIfaceModem3gpp *iface)
>  iface->enable_unsolicited_events_finish =
> modem_3gpp_enable_unsolicited_events_finish;
>  iface->disable_unsolicited_events =
> modem_3gpp_disable_unsolicited_events;
>  iface->disable_unsolicited_events_finish =
> modem_3gpp_disable_unsolicited_events_finish;
> -iface->load_operator_name = modem_3gpp_load_operator_name;
> -iface->load_operator_name_finish =
> modem_3gpp_load_operator_name_finish;
>  }
>  
>  static void
> diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
> index fc95e28f..9266a5a0 100644
> --- a/src/mm-modem-helpers.c
> +++ b/src/mm-modem-helpers.c
> @@ -3131,20 +3131,28 @@ mm_3gpp_normalize_operator_name
> (gchar  **operator,
>  if (*operator == NULL)
>  return;
>  
> -/* Some modems (Option & HSO) return the operator name as a
> hexadecimal
> - * string of the bytes of the operator name as encoded by the
> current
> - * character set.
> - */
> +/* Despite +CSCS? may claim supporting UCS2, Some modems (e.g.
> Huawei)
> + * always report the operator name in ASCII in a +COPS response.
> */
>  if (cur_charset == MM_MODEM_CHARSET_UCS2) {
> +gchar *tmp;
> +
> +tmp = g_strdup (*operator);
>  /* In this case we're already checking UTF-8 validity */
> -*operator = mm_charset_take_and_convert_to_utf8 (*operator,
> MM_MODEM_CHARSET_UCS2);
> +tmp = mm_charset_take_and_convert_to_utf8 (tmp,
> cur_charset);
> +if (tmp) {
> +g_clear_pointer (operator, g_free);
> +*operator = tmp;
> +goto out;
> +}
>  }
> -/* Ensure the operator name is valid UTF-8 so that we can send
> it
> - * through D-Bus and such.
> -  

Re: Flow control settings for RS232 modems

2017-03-31 Thread Dan Williams
On Sat, 2017-03-25 at 19:32 +0100, Aleksander Morgado wrote:
> Hey Dan, Daniele, Carlo & everyone,
> 
> This series of patches tries to implement proper flow control
> settings on the serial port, and is based on letting MM detect which
> are the supported modes with AT+IFC=?. This makes it unnecessary to
> subclass the flow control setting in plugins for modems that don't
> support XON/XOFF (what was being used as default), like the Telit
> plugin.

In general, patches 1-7 look good to me.  Only one comment on patch 8.

Dan

> The new logic will:
>   * Always open the serial ports without any flow control enabled.
>   * Query the modem which flow control methods are supported, with
> AT+IFC=?.
>   * If supported, prefer RTS/CTS over XON/XOFF, and notify the modem
> via AT+IFC=x,x our selection.
>   * When the port gets connected after an ATD call, reconfigure the
> TTY with the flow control attributes corresponding to the method we
> selected via AT+IFC.
>   * pppd may be run without any of the explicit options regarding
> flow control, which means that whatever was configured in the TTY is
> used.
>   * On port disconnection, we clear the flow control attributes of
> the TTY explicitly, although this is really not totally needed as we
> fully close and re-open the port (and during the re-open the port is
> opened without flow control enabled).
> 
> I prepared this logic for the Telit LE866-SV1, although it really is
> generic for every RS232 modem out there.
> 
> What do you guys think?
> 
> [PATCH 1/8] helpers: new parser for AT+IFC=?
> [PATCH 2/8] broadband-modem: query supported flow control modes
> [PATCH 3/8] wavecom: ignore custom flow control handling
> [PATCH 4/8] telit: ignore custom flow control handling
> [PATCH 5/8] port-serial: new internal method to run tcsetattr()
> [PATCH 6/8] port-serial: new method to explicitly set flow control
> [PATCH 7/8] port-serial: remove all default flow control settings
> [PATCH 8/8] broadband-bearer: once connected, set flow control
> ___
> 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: Failed to find primary AT port

2017-03-31 Thread Dan Williams
On Fri, 2017-03-31 at 21:09 +, Jan Graczyk wrote:
> Hello Dan,
> 
> There is no problem with connecting to this modem (mini PCIe Quectel
> UC20 modem module) from kermit and sending AT commands. However when
> I issue the following commands:
> 
>  mmcli -m 0 --simple-disconnect
>  mmcli -m 0 --simple-connect="pin=1234,apn=internet"
> 
> the ModemManager sends debug message "Failed to find primary AT port"
> to Linux console. However if I will power down and power up the
> development board the ModemManager starts running properly. The
> problem only happen when I issue the above disconnect and then
> connect command.

The UC20 should be using QMI, not AT ports.  qmi_wwan support for the
UC20 has been there since 2013.  But to use it, you need to:

1) ensure qmi_wwan has been built for your kernel
2) ensure you build ModemManager with libqmi support (--with-qmi=yes)

This will solve both your problems, most likely.

Dan

> Best Regards,   
> 
> Jan Graczyk
> 
> -Original Message-
> From: Dan Williams [mailto:d...@redhat.com] 
> Sent: Friday, March 31, 2017 1:51 PM
> To: Jan Graczyk ; modemmanager-devel@lists.freedeskto
> p.org
> Subject: Re: Failed to find primary AT port
> 
> On Fri, 2017-03-31 at 20:35 +, Jan Graczyk wrote:
> > Hello All,
> > 
> > I have a problem with ModemManager failing to find primary AT port.
> > Her is the ModemManager debug log:
> 
> What kind of modem is this?
> 
> Does it require a specific baud rate and/or serial settings?
> 
> Can you talk to the modem with 'minicom' on that port when
> ModemManager isn't running?
> 
> Dan
> 
> > root@linaro-alip:~# ModemManager --debug& [1] 1574 root@linaro-alip
> > :~# 
> > ModemManager[1574]:   [1490989871.011911] [main.c:140]
> > main(): 
> > ModemManager (version 1.4.0) starting in system bus...
> > ModemManager[1574]:  [1490989871.035558] [main.c:65]
> > bus_acquired_cb(): Bus acquired, creating manager...
> > ModemManager[1574]:  [1490989871.047317] [mm-plugin- 
> > manager.c:852] load_plugins(): Looking for plugins in
> > '/usr/lib/arm- 
> > linux-gnueabihf/ModemManager'
> > ModemManager[1574]:  [1490989871.049618] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Option'
> > ModemManager[1574]:  [1490989871.051062] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Novatel LTE'
> > ModemManager[1574]:  [1490989871.052389] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Linktop'
> > ModemManager[1574]:  [1490989871.053841] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Samsung'
> > ModemManager[1574]:  [1490989871.055357] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Sierra'
> > ModemManager[1574]:  [1490989871.056738] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Gobi'
> > ModemManager[1574]:  [1490989871.058087] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'X22X'
> > ModemManager[1574]:  [1490989871.059471] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'MTK'
> > ModemManager[1574]:  [1490989871.060811] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'AnyDATA'
> > ModemManager[1574]:  [1490989871.062214] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Pantech'
> > ModemManager[1574]:  [1490989871.063564] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Novatel'
> > ModemManager[1574]:  [1490989871.065070] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Nokia'
> > ModemManager[1574]:  [1490989871.066426] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Motorola'
> > ModemManager[1574]:  [1490989871.067906] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Huawei'
> > ModemManager[1574]:  [1490989871.069276] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'SimTech'
> > ModemManager[1574]:  [1490989871.070701] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Option High-Speed'
> > ModemManager[1574]:  [1490989871.072078] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Generic'
> > ModemManager[1574]:  [1490989871.073583] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Iridium'
> > ModemManager[1574]:  [1490989871.075071] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Altair LTE'
> > ModemManager[1574]:  [1490989871.076609] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Cinterion'
> > ModemManager[1574]:  [1490989871.078085] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Via CBP7'
> > ModemManager[1574]:  [1490989871.079495] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Telit'
> > ModemManager[1574]:  [1490989871.081009] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'ZTE'
> > ModemManager[1574]:  [1490989871.082448] [mm-plugin- 
> > manager.c:877] load_plugins(): Loaded plugin 'Wavecom'
> > ModemManager[1574]:  [1490989871.083927] [mm-plugin- 
> > 

RE: Failed to find primary AT port

2017-03-31 Thread Jan Graczyk
Hello Dan,

There is no problem with connecting to this modem (mini PCIe Quectel UC20 modem 
module) from kermit and sending AT commands. However when I issue the following 
commands:

 mmcli -m 0 --simple-disconnect
 mmcli -m 0 --simple-connect="pin=1234,apn=internet"

the ModemManager sends debug message "Failed to find primary AT port" to Linux 
console. However if I will power down and power up the development board the 
ModemManager starts running properly. The problem only happen when I issue the 
above disconnect and then connect command.

Best Regards,   

Jan Graczyk

-Original Message-
From: Dan Williams [mailto:d...@redhat.com] 
Sent: Friday, March 31, 2017 1:51 PM
To: Jan Graczyk ; modemmanager-devel@lists.freedesktop.org
Subject: Re: Failed to find primary AT port

On Fri, 2017-03-31 at 20:35 +, Jan Graczyk wrote:
> Hello All,
> 
> I have a problem with ModemManager failing to find primary AT port.
> Her is the ModemManager debug log:

What kind of modem is this?

Does it require a specific baud rate and/or serial settings?

Can you talk to the modem with 'minicom' on that port when ModemManager isn't 
running?

Dan

> root@linaro-alip:~# ModemManager --debug& [1] 1574 root@linaro-alip:~# 
> ModemManager[1574]:   [1490989871.011911] [main.c:140] main(): 
> ModemManager (version 1.4.0) starting in system bus...
> ModemManager[1574]:  [1490989871.035558] [main.c:65]
> bus_acquired_cb(): Bus acquired, creating manager...
> ModemManager[1574]:  [1490989871.047317] [mm-plugin- 
> manager.c:852] load_plugins(): Looking for plugins in '/usr/lib/arm- 
> linux-gnueabihf/ModemManager'
> ModemManager[1574]:  [1490989871.049618] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Option'
> ModemManager[1574]:  [1490989871.051062] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Novatel LTE'
> ModemManager[1574]:  [1490989871.052389] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Linktop'
> ModemManager[1574]:  [1490989871.053841] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Samsung'
> ModemManager[1574]:  [1490989871.055357] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Sierra'
> ModemManager[1574]:  [1490989871.056738] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Gobi'
> ModemManager[1574]:  [1490989871.058087] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'X22X'
> ModemManager[1574]:  [1490989871.059471] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'MTK'
> ModemManager[1574]:  [1490989871.060811] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'AnyDATA'
> ModemManager[1574]:  [1490989871.062214] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Pantech'
> ModemManager[1574]:  [1490989871.063564] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Novatel'
> ModemManager[1574]:  [1490989871.065070] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Nokia'
> ModemManager[1574]:  [1490989871.066426] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Motorola'
> ModemManager[1574]:  [1490989871.067906] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Huawei'
> ModemManager[1574]:  [1490989871.069276] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'SimTech'
> ModemManager[1574]:  [1490989871.070701] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Option High-Speed'
> ModemManager[1574]:  [1490989871.072078] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Generic'
> ModemManager[1574]:  [1490989871.073583] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Iridium'
> ModemManager[1574]:  [1490989871.075071] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Altair LTE'
> ModemManager[1574]:  [1490989871.076609] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Cinterion'
> ModemManager[1574]:  [1490989871.078085] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Via CBP7'
> ModemManager[1574]:  [1490989871.079495] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Telit'
> ModemManager[1574]:  [1490989871.081009] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'ZTE'
> ModemManager[1574]:  [1490989871.082448] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Wavecom'
> ModemManager[1574]:  [1490989871.083927] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Longcheer'
> ModemManager[1574]:  [1490989871.085477] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Nokia (Icera)'
> ModemManager[1574]:  [1490989871.086972] [mm-plugin- 
> manager.c:877] load_plugins(): Loaded plugin 'Ericsson MBM'
> ModemManager[1574]:  [1490989871.087122] [mm-plugin- 
> manager.c:902] load_plugins(): Successfully loaded 27 plugins
> ModemManager[1574]:  [1490989871.094817] [main.c:87]
> name_acquired_cb(): Service name 'org.freedesktop.ModemManager1' was 
> acquired
> ModemManager[1574]:  

Re: Failed to find primary AT port

2017-03-31 Thread Dan Williams
On Fri, 2017-03-31 at 20:35 +, Jan Graczyk wrote:
> Hello All,
> 
> I have a problem with ModemManager failing to find primary AT port.
> Her is the ModemManager debug log:

What kind of modem is this?

Does it require a specific baud rate and/or serial settings?

Can you talk to the modem with 'minicom' on that port when ModemManager
isn't running?

Dan

> root@linaro-alip:~# ModemManager --debug&
> [1] 1574
> root@linaro-alip:~# ModemManager[1574]:   [1490989871.011911]
> [main.c:140] main(): ModemManager (version 1.4.0) starting in system
> bus...
> ModemManager[1574]:  [1490989871.035558] [main.c:65]
> bus_acquired_cb(): Bus acquired, creating manager...
> ModemManager[1574]:  [1490989871.047317] [mm-plugin-
> manager.c:852] load_plugins(): Looking for plugins in '/usr/lib/arm-
> linux-gnueabihf/ModemManager'
> ModemManager[1574]:  [1490989871.049618] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Option'
> ModemManager[1574]:  [1490989871.051062] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Novatel LTE'
> ModemManager[1574]:  [1490989871.052389] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Linktop'
> ModemManager[1574]:  [1490989871.053841] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Samsung'
> ModemManager[1574]:  [1490989871.055357] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Sierra'
> ModemManager[1574]:  [1490989871.056738] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Gobi'
> ModemManager[1574]:  [1490989871.058087] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'X22X'
> ModemManager[1574]:  [1490989871.059471] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'MTK'
> ModemManager[1574]:  [1490989871.060811] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'AnyDATA'
> ModemManager[1574]:  [1490989871.062214] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Pantech'
> ModemManager[1574]:  [1490989871.063564] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Novatel'
> ModemManager[1574]:  [1490989871.065070] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Nokia'
> ModemManager[1574]:  [1490989871.066426] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Motorola'
> ModemManager[1574]:  [1490989871.067906] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Huawei'
> ModemManager[1574]:  [1490989871.069276] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'SimTech'
> ModemManager[1574]:  [1490989871.070701] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Option High-Speed'
> ModemManager[1574]:  [1490989871.072078] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Generic'
> ModemManager[1574]:  [1490989871.073583] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Iridium'
> ModemManager[1574]:  [1490989871.075071] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Altair LTE'
> ModemManager[1574]:  [1490989871.076609] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Cinterion'
> ModemManager[1574]:  [1490989871.078085] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Via CBP7'
> ModemManager[1574]:  [1490989871.079495] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Telit'
> ModemManager[1574]:  [1490989871.081009] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'ZTE'
> ModemManager[1574]:  [1490989871.082448] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Wavecom'
> ModemManager[1574]:  [1490989871.083927] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Longcheer'
> ModemManager[1574]:  [1490989871.085477] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Nokia (Icera)'
> ModemManager[1574]:  [1490989871.086972] [mm-plugin-
> manager.c:877] load_plugins(): Loaded plugin 'Ericsson MBM'
> ModemManager[1574]:  [1490989871.087122] [mm-plugin-
> manager.c:902] load_plugins(): Successfully loaded 27 plugins
> ModemManager[1574]:  [1490989871.094817] [main.c:87]
> name_acquired_cb(): Service name 'org.freedesktop.ModemManager1' was
> acquired
> ModemManager[1574]:  [1490989871.095004] [mm-base-
> manager.c:479] mm_base_manager_start(): Starting automatic device
> scan...
> ModemManager[1574]:  [1490989871.136373] [mm-base-
> manager.c:518] mm_base_manager_start(): Finished device scan...
> ModemManager[1574]:  [1490989871.139387] [mm-base-
> manager.c:314] device_added(): (tty/ttymxc0): port's parent platform
> driver is not whitelisted
> ModemManager[1574]:  [1490989871.142340] [mm-base-
> manager.c:314] device_added(): (tty/ttymxc1): port's parent platform
> driver is not whitelisted
> ModemManager[1574]:  [1490989871.144381] [mm-plugin-
> manager.c:739] mm_plugin_manager_find_device_support(): (Plugin
> Manager) [/sys/devices/soc0/soc/210.aips-bus/21ec000.serial]
> Checking device support...
> ModemManager[1574]:  [1490989871.145459] [mm-plugin.c:253]
> apply_pre_probing_filters(): (Option) 

Failed to find primary AT port

2017-03-31 Thread Jan Graczyk
Hello All,

I have a problem with ModemManager failing to find primary AT port. Her is the 
ModemManager debug log:

root@linaro-alip:~# ModemManager --debug&
[1] 1574
root@linaro-alip:~# ModemManager[1574]:   [1490989871.011911] 
[main.c:140] main(): ModemManager (version 1.4.0) starting in system bus...
ModemManager[1574]:  [1490989871.035558] [main.c:65] bus_acquired_cb(): 
Bus acquired, creating manager...
ModemManager[1574]:  [1490989871.047317] [mm-plugin-manager.c:852] 
load_plugins(): Looking for plugins in 
'/usr/lib/arm-linux-gnueabihf/ModemManager'
ModemManager[1574]:  [1490989871.049618] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Option'
ModemManager[1574]:  [1490989871.051062] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Novatel LTE'
ModemManager[1574]:  [1490989871.052389] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Linktop'
ModemManager[1574]:  [1490989871.053841] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Samsung'
ModemManager[1574]:  [1490989871.055357] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Sierra'
ModemManager[1574]:  [1490989871.056738] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Gobi'
ModemManager[1574]:  [1490989871.058087] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'X22X'
ModemManager[1574]:  [1490989871.059471] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'MTK'
ModemManager[1574]:  [1490989871.060811] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'AnyDATA'
ModemManager[1574]:  [1490989871.062214] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Pantech'
ModemManager[1574]:  [1490989871.063564] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Novatel'
ModemManager[1574]:  [1490989871.065070] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Nokia'
ModemManager[1574]:  [1490989871.066426] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Motorola'
ModemManager[1574]:  [1490989871.067906] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Huawei'
ModemManager[1574]:  [1490989871.069276] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'SimTech'
ModemManager[1574]:  [1490989871.070701] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Option High-Speed'
ModemManager[1574]:  [1490989871.072078] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Generic'
ModemManager[1574]:  [1490989871.073583] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Iridium'
ModemManager[1574]:  [1490989871.075071] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Altair LTE'
ModemManager[1574]:  [1490989871.076609] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Cinterion'
ModemManager[1574]:  [1490989871.078085] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Via CBP7'
ModemManager[1574]:  [1490989871.079495] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Telit'
ModemManager[1574]:  [1490989871.081009] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'ZTE'
ModemManager[1574]:  [1490989871.082448] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Wavecom'
ModemManager[1574]:  [1490989871.083927] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Longcheer'
ModemManager[1574]:  [1490989871.085477] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Nokia (Icera)'
ModemManager[1574]:  [1490989871.086972] [mm-plugin-manager.c:877] 
load_plugins(): Loaded plugin 'Ericsson MBM'
ModemManager[1574]:  [1490989871.087122] [mm-plugin-manager.c:902] 
load_plugins(): Successfully loaded 27 plugins
ModemManager[1574]:  [1490989871.094817] [main.c:87] name_acquired_cb(): 
Service name 'org.freedesktop.ModemManager1' was acquired
ModemManager[1574]:  [1490989871.095004] [mm-base-manager.c:479] 
mm_base_manager_start(): Starting automatic device scan...
ModemManager[1574]:  [1490989871.136373] [mm-base-manager.c:518] 
mm_base_manager_start(): Finished device scan...
ModemManager[1574]:  [1490989871.139387] [mm-base-manager.c:314] 
device_added(): (tty/ttymxc0): port's parent platform driver is not whitelisted
ModemManager[1574]:  [1490989871.142340] [mm-base-manager.c:314] 
device_added(): (tty/ttymxc1): port's parent platform driver is not whitelisted
ModemManager[1574]:  [1490989871.144381] [mm-plugin-manager.c:739] 
mm_plugin_manager_find_device_support(): (Plugin Manager) 
[/sys/devices/soc0/soc/210.aips-bus/21ec000.serial] Checking device 
support...
ModemManager[1574]:  [1490989871.145459] [mm-plugin.c:253] 
apply_pre_probing_filters(): (Option) [ttymxc2] filtered by drivers
ModemManager[1574]:  [1490989871.145571] [mm-plugin.c:326] 
apply_pre_probing_filters(): (Novatel LTE) [ttymxc2] filtered by vendor/product 
IDs
ModemManager[1574]:  [1490989871.145635] [mm-plugin.c:326] 
apply_pre_probing_filters(): (Linktop) [ttymxc2] filtered by vendor/product IDs
ModemManager[1574]:  [1490989871.145692] [mm-plugin.c:326] 
apply_pre_probing_filters(): (Samsung) 

Couldn't refresh signal quality: 'Serial command timed out'

2017-03-31 Thread Jan Graczyk
Hello All,

I have a problem with getting the proper signal level from ModemManager. Here 
is the Linux console output from ModemManager -debug session:

ModemManager[1580]:  [1490979773.483400] [mm-broadband-modem.c:1991] 
modem_load_signal_quality(): loading signal quality...
ModemManager[1580]:  [1490979773.483759] [mm-port-serial.c:1237] 
mm_port_serial_open(): (ttymxc2) device open count is 2 (open)
ModemManager[1580]:  [1490979773.484146] [mm-port-serial-at.c:440] 
debug_log(): (ttymxc2): --> 'AT+CIND?'
ModemManager[1580]:  [1490979776.462143] [mm-port-serial.c:1237] 
mm_port_serial_open(): (ttymxc2) device open count is 3 (open)
ModemManager[1580]:  [1490979776.462543] [mm-port-serial.c:1296] 
mm_port_serial_close(): (ttymxc2) device open count is 2 (close)
ModemManager[1580]:  [1490979776.462821] [mm-port-serial-at.c:440] 
debug_log(): (ttymxc2): --> 'AT+CSQ'
ModemManager[1580]:  [1490979779.462935] [mm-port-serial.c:1296] 
mm_port_serial_close(): (ttymxc2) device open count is 1 (close)
ModemManager[1580]:  [1490979779.463338] [mm-iface-modem.c:1221] 
signal_quality_check_ready(): Couldn't refresh signal quality: 'Serial command 
timed out'

This happen when I have issued the following command to ModemManager:

mmcli -m 0 --simple-disconnect

The command:
mmcli -m 0 --simple-connect="pin=1234,apn=internet"
does not bring the ModemManager back to receive proper signal quality.
What I need to do to get ModemManager properly detecting signal quality?

In order to get ModemManager updating signal quality I needed to power down and 
power up the development board.

Best Regards,

Jan Graczyk






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


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

2017-03-31 Thread Dan Williams
On Fri, 2017-03-31 at 07:23 +, Thomas Lang wrote:
> I will check this today.
> I tried a MC 7710 as well same problem --location-status gives that
> 3g location is enabled when I try --location-get I get not
> available. 
> Does the MC 7710   have the same problem as the Ericsson one?

If it's running in MBIM mode, yes.  If it's in QMI or DirectIP, then no
(because it uses AT ports for the 3GPP registration checks and thus we
get LAC/CID with "AT+CREG=2; AT+CREG?").

Dan

> -Ursprüngliche Nachricht-
> Von: Aleksander Morgado [mailto:aleksan...@aleksander.es] 
> Gesendet: Donnerstag, 23. März 2017 13:01
> An: Thomas Lang ; Dan Williams  om>; ModemManager (development)  .org>
> Betreff: Re: AW: h5321gw Problem with --location-get
> 
> 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
___
ModemManager-devel mailing list
ModemManager-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/modemmanager-devel


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

2017-03-31 Thread Thomas Lang
I will check this today.
I tried a MC 7710 as well same problem --location-status gives that 3g location 
is enabled when I try --location-get I get not available. 
Does the MC 7710   have the same problem as the Ericsson one?

-Ursprüngliche Nachricht-
Von: Aleksander Morgado [mailto:aleksan...@aleksander.es] 
Gesendet: Donnerstag, 23. März 2017 13:01
An: Thomas Lang ; Dan Williams ; 
ModemManager (development) 
Betreff: Re: AW: h5321gw Problem with --location-get

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