Hi Jonas,

Thanks for the patch.

With your patch, ofono is able to recognize LARA modems.

root@imx:/usr/lib/ofono/test# ./list-modems

[ /ublox_0 ]

    Online = 0

    Emergency = 0

    Features = gprs sim

    Revision = XX.XX

    Serial = XXXXXXXXXXX

    Interfaces = org.ofono.ConnectionManager org.ofono.LongTermEvolution org.ofono.AllowedAccessPoints org.ofono.SimManager

    Lockdown = 0

    Type = hardware

    Powered = 1

    Manufacturer = u-blox

    Model = LARA-R211

    [ org.ofono.ConnectionManager ]

        Attached = 0

        Powered = 1

        RoamingAllowed = 0

        Bearer = none

    [ org.ofono.LongTermEvolution ]

        DefaultAccessPointName =

    [ org.ofono.AllowedAccessPoints ]

    [ org.ofono.SimManager ]

        CardIdentifier = XXXXXXXXXXXXXXXXXX

        SubscriberNumbers =

        MobileCountryCode = XXX

        FixedDialing = 0

        MobileNetworkCode = XX

        PreferredLanguages = en nl

        LockedPins =

        BarredDialing = 0

        ServiceProviderName = Tata

        Retries = [pin2 = X] [puk = X] [pin = X] [puk2 = X]

        PinRequired = none

        SubscriberIdentity = XXXXXXXXXXXXXX

        Present = 1

root@imx:/usr/lib/ofono/test# ./enable-modem

Connecting modem /ublox_0...

root@imx:/usr/lib/ofono/test#

root@imx:/usr/lib/ofono/test#

root@imx:/usr/lib/ofono/test# ./create-internet-context <APN_name>

Found context /ublox_0/context1

Setting APN to <APN_name>

root@imx:/usr/lib/ofono/test# ./online-modem

Setting modem /ublox_0 online...

root@imx:/usr/lib/ofono/test# ./activate-context

Error activating /ublox_0/context1: org.ofono.Error.NotAttached: GPRS is not attached

Without ofono, I am able to activate the context and get GPRS. With ofono only I am getting below error.

Let me know if I am missing any configuration.

In source code (drivers/ubloxmodem/lte.c), I found AT commands specific to TOBY module for configuring the PDP context (Eg: UCGDFLT).

Whether any flow need to be modified for LARA-R2?

Regards,

Krishna

-----Original Message-----
From: Jonas Bonn [mailto:jonas@norrbonn.se]
Sent: Saturday, April 13, 2019 10:59 AM
To: ofono@ofono.org; krishnaks@iwavesystems.com
Cc: Jonas Bonn <jonas@norrbonn.se>
Subject: [PATCH 1/1] ublox: detect and support LARA R2 series

---

Hi Krishna,

This patch isn't tested, but this is roughly what you'd need to get the LARA R2 detected and running.  After that, it's just a matter of going through the details of where ofono has issues.

From what I can see at a quick glance at the documentation, there's nothing that particularly stands out here so I suspect things will mostly just work.  Give the patch a try and let me know how it goes.

Regards,

Jonas

 drivers/ubloxmodem/ubloxmodem.c | 9 +++++++++  drivers/ubloxmodem/ubloxmodem.h | 1 +

 plugins/udevng.c                | 2 ++

 3 files changed, 12 insertions(+)

diff --git a/drivers/ubloxmodem/ubloxmodem.c b/drivers/ubloxmodem/ubloxmodem.c index a52a67ea..85d72684 100644

--- a/drivers/ubloxmodem/ubloxmodem.c

+++ b/drivers/ubloxmodem/ubloxmodem.c

@@ -77,6 +77,15 @@ const struct ublox_model ublox_models[] = {

                .name = "TOBY-L4906",

                .flags = UBLOX_F_TOBY_L4,

        },

+       /* LARA L2 series */

+       {

+               .name = "LARA-R202",

+               .flags = UBLOX_F_LARA_R2,

+       },

+       {

+               .name = "LARA-R211",

+               .flags = UBLOX_F_LARA_R2,

+       },

        { /* sentinel */ },

 };

 

diff --git a/drivers/ubloxmodem/ubloxmodem.h b/drivers/ubloxmodem/ubloxmodem.h index 2c5b7433..7fe58df3 100644

--- a/drivers/ubloxmodem/ubloxmodem.h

+++ b/drivers/ubloxmodem/ubloxmodem.h

@@ -27,6 +27,7 @@ enum ublox_flags {

        UBLOX_F_TOBY_L2         = (1 << 0),

        UBLOX_F_TOBY_L4         = (1 << 1),

        UBLOX_F_HAVE_USBCONF    = (1 << 2),

+       UBLOX_F_LARA_R2         = (1 << 3),

 };

 

 struct ublox_model {

diff --git a/plugins/udevng.c b/plugins/udevng.c index f689b756..397ac931 100644

--- a/plugins/udevng.c

+++ b/plugins/udevng.c

@@ -1700,6 +1700,8 @@ static struct {

        { "ublox",      "cdc_acm",      "1546", "1010"  },

        { "ublox",      "cdc_ncm",      "1546", "1010"  },

        { "ublox",      "cdc_acm",      "1546", "1102"  },

+       { "ublox",      "cdc_acm",      "1546", "110a"  },

+       { "ublox",      "cdc_ncm",      "1546", "110a"  },

        { "ublox",      "rndis_host",   "1546", "1146"  },

        { "ublox",      "cdc_acm",      "1546", "1146"  },

        { "gemalto",    "option",       "1e2d", "0053"  },

--

2.20.1