Re: MC7455 location support

2017-04-18 Thread Aleksander Morgado
On Mon, Apr 17, 2017 at 9:03 PM, Dan Williams  wrote:
> "version" is the QMI service version that this command first appeared
> in, and I'd guess Start appeared in v1.0 of QMI_SVC_LOC.  "since" is
> the libqmi version that this message was first defined in, so we'll use
> "1.19" since libqmi is 1.18 and this would be in the next release
> (1.19).

The next major libqmi stable release will be 1.20; so that is what the
"since:" field should have IMO.

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


Re: MC7455 location support

2017-04-17 Thread Dan Williams
On Sat, 2017-04-15 at 11:27 +, Karoly Pados wrote:
> Hi!
> 
> Sorry for the late reply, we have a 4-day holiday here and I spend
> less time at the computer.
> 
> > > But it does appear to support the LOC service (location) which is
> > > a
> > > newer service that ModemManager (and libqmi) doesn't yet support.
> > > So I
> > > think that's the current problem.
> > 
> > Ouch :/ Patches welcome!! :)
> 
> I can look into it, given there is some description or specification
> of the loc service protocol I can use. Do you have any pointers?
> Unfortunately I don't think I can allow myself the time to do full
> reverse engineering of the modem communication, so some doc about the
> QMI messages for the loc service would be nice (I'm not even familiar
> with QMI itself). 

It's pretty well described in the GobiAPI headers in libqmi git.

I started describing the boilerplate, but that took too long so I just
went ahead and did it:

https://cgit.freedesktop.org/libqmi/commit/?id=4da476f676678d83a5c73b94c4337c9a437fb6a1

Three parts are left for filling in the messages and TLVs; what I've
done is incomplete:

1) Messages: look in GobiConnectionMgmtAPIEnums.h for the message
numbers, eg:

   eQMI_LOC_START,  // 034 Start GPS session

which you can then translate into the first part of the JSON for a new
message in qmi-service-loc.json:

  {  "name": "Start",
 "type": "Message",
 "service" : "LOC",
 "id"  : "0x0022",
 "version" : "1.0",
 "since"   : "1.19",

"version" is the QMI service version that this command first appeared
in, and I'd guess Start appeared in v1.0 of QMI_SVC_LOC.  "since" is
the libqmi version that this message was first defined in, so we'll use
"1.19" since libqmi is 1.18 and this would be in the next release
(1.19).


2) TLVs: these are found in GobiConnectionMgmtAPIStructs.h with a bit
of searching.  Look for "LOCStart" and you'll find the applicable TLVs
for eQMI_LOC_START.  For example:

// Structure to describe request TLV 0x01 for LOCStart()
struct sLOCStartRequest_SessionID
{
   UINT8 mSessionID;
};

That means TLV ID 0x01 for the Start message of the LOC service, and it
has a single member: a uint8 session id.  That becomes this JSON:

 { "name"  : "Session ID",
   "id": "0x01",
   "mandatory" : "no",
   "type"  : "TLV",
   "since" : "1.19",
   "format": "guint8" },

Repeat for each of the TLVs you want to add; if it's unclear how to add
the JSON for one (and it will be, like for
sLOCStartRequest_ApplicationID) feel free to ask!


3) Enums: when you come across a TLV that includes an enum, like:

// Structure to describe request TLV 0x12 for LOCStart()
struct sLOCStartRequest_EnableIntermediateReports
{
   eQMILOCIntermediateReportState mEnableIntermediateReports;
};

we usually create a mirror libqmi enum.  So you go look up
eQMILOCIntermediateReportState GobiConnectionMgmtAPIEnums.h and find:

// Enum to describe QMI LOC Intermediate Report State
enum eQMILOCIntermediateReportState:UINT32
{
   eQMILOCIntermediateReportState_Enable = 1,
   eQMILOCIntermediateReportState_Disable= 2,
};

note the UINT32 there; we'll remember that for later in the JSON.  This
enum becomes the libqmi-glib enum in src/libmm-glib/qmi-enums-loc.h:

/**
 * QmiLocIntermediateReportState:
 * @QMI_LOC_INTERMEDIATE_REPORT_STATE_UNKNOWN: Unknown.
 * @QMI_LOC_INTERMEDIATE_REPORT_STATE_ENABLE: Enable intermediate state 
reporting.
 * @QMI_LOC_INTERMEDIATE_REPORT_STATE_DISABLE: Disable intermediate state 
reporting.
 *
 * Whether to enable or disable intermediate state reporting.
 *
 * Since: 1.19
 */
typedef enum {
QMI_LOC_INTERMEDIATE_REPORT_STATE_UNKNOWN = 0,
QMI_LOC_INTERMEDIATE_REPORT_STATE_ENABLE = 1,
QMI_LOC_INTERMEDIATE_REPORT_STATE_DISABLE = 2,
} QmiLocIntermediateReportState;


and then back in the JSON...  the TLV above becomes:

  { "name"  : "Intermediate Report State",
    "id": "0x12",
"mandatory" : "no",
"type"  : "TLV",
"since" : "1.0",
    "format": "guint32",
"public-format" : "QmiLocIntermediateReportState" } ] },

"format" is the QMI API size of the variable that libqmi uses when
converting the enum to the QMI protocol, while "public-format" is the
fancy enum that we've defined that will be used in the libqmi API.

Let us know if you have more questions...

Thanks!
Dan

> LG,
> Károly Pados
> 
> tec4data
> finding of facts!
> thoerl 35; 8621 thoerl; austria
> mob +43 680 5577 310
> uid atu44131505
> mail k...@tec4data.at
> http://www.tec4data.at
> 
> This email and any associated attachment are confidential.
> Unless you belong to the specified recipients, immediately notify the
> sender.
> The content may not be copied and given to third parties.
> ___
> 
> April 15, 2017 12:11 AM, "Aleksander Morgado" 

Re: MC7455 location support

2017-04-15 Thread Karoly Pados
Hi!

Sorry for the late reply, we have a 4-day holiday here and I spend less time at 
the computer.

>> But it does appear to support the LOC service (location) which is a
>> newer service that ModemManager (and libqmi) doesn't yet support. So I
>> think that's the current problem.
> 
> Ouch :/ Patches welcome!! :)

I can look into it, given there is some description or specification of the loc 
service protocol I can use. Do you have any pointers? Unfortunately I don't 
think I can allow myself the time to do full reverse engineering of the modem 
communication, so some doc about the QMI messages for the loc service would be 
nice (I'm not even familiar with QMI itself). 

LG,
Károly Pados

tec4data
finding of facts!
thoerl 35; 8621 thoerl; austria
mob +43 680 5577 310
uid atu44131505
mail k...@tec4data.at
http://www.tec4data.at

This email and any associated attachment are confidential.
Unless you belong to the specified recipients, immediately notify the sender.
The content may not be copied and given to third parties.
___

April 15, 2017 12:11 AM, "Aleksander Morgado"  wrote:

> On Thu, Apr 13, 2017 at 8:30 PM, Dan Williams  wrote:
> 
 also, if you have ModemManager debug logs, that would be great to
 see
 too so we can make sure things are being set up correctly.
>>> 
>>> Attached. Also output of mmcli -m 0 in separate file.
>> 
>> Thanks. This shows your device is in fact in QMI mode, and that the
>> firmware doesn't implement the "PDS" (Position Determination Service)
>> that is normally used for this.
>> 
>> But it does appear to support the LOC service (location) which is a
>> newer service that ModemManager (and libqmi) doesn't yet support. So I
>> think that's the current problem.
> 
> Ouch :/ Patches welcome!! :)
> 
> --
> 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


Re: MC7455 location support

2017-04-14 Thread Aleksander Morgado
On Thu, Apr 13, 2017 at 8:30 PM, Dan Williams  wrote:
>> > also, if you have ModemManager debug logs, that would be great to
>> > see
>> > too so we can make sure things are being set up correctly.
>>
>> Attached. Also output of mmcli -m 0 in separate file.
>
> Thanks.  This shows your device is in fact in QMI mode, and that the
> firmware doesn't implement the "PDS" (Position Determination Service)
> that is normally used for this.
>
> But it does appear to support the LOC service (location) which is a
> newer service that ModemManager (and libqmi) doesn't yet support.  So I
> think that's the current problem.

Ouch :/ Patches welcome!! :)


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


Re: MC7455 location support

2017-04-13 Thread Dan Williams
On Thu, 2017-04-13 at 17:21 +, Karoly Pados wrote:
> Hello,
> 
> > Ah, my mistake then. But I would have expected to see more location
> > methods supported if the modem was in QMI mode. Can you run:
> > 
> > qmicli --device-open-qmi -d /dev/cdc-wdm0 --get-service-version-
> > info
> 
> Attached. I needed to upgrade libqmi because my original version
> didn't have --device-open-qmi. I also recompiled MM after that before
> obtaining the attached files.
> 
> > also, if you have ModemManager debug logs, that would be great to
> > see
> > too so we can make sure things are being set up correctly.
> 
> Attached. Also output of mmcli -m 0 in separate file.

Thanks.  This shows your device is in fact in QMI mode, and that the
firmware doesn't implement the "PDS" (Position Determination Service)
that is normally used for this.

But it does appear to support the LOC service (location) which is a
newer service that ModemManager (and libqmi) doesn't yet support.  So I
think that's the current problem.

Dan

> > One other possibility: the modem is in MBIM mode, but ModemManager
> > has
> > some logic to use the MBIM QMI passthrough to set the Sierra "FCC
> > Auth"
> > command. MM doesn't yet have logic to try GPS through QMI while the
> > modem is in MBIM though.
> 
> How can I tell if this is what is happening? Can you tell from the
> debug log? It doesn't seem to mention "MBIM" at all. Or maybe I need
> to check this using another way?
> 
> All files I attached will tell you in the top how that output was
> created. I hope these will help narrow down what is missing. Let me
> know if there is anything else I can do.
> 
> Károly
> 
> 
> April 13, 2017 6:01 PM, "Dan Williams"  wrote:
> 
> > On Thu, 2017-04-13 at 09:41 +, Karoly Pados wrote:
> > 
> > > Hello,
> > > 
> > > Thanks for your reply. Are you sure the modem is not already in
> > > QMI
> > > mode? MM is clearly using QMI to communicate with it (and I can
> > > also
> > > use qmicli -p), and also below URL states that this modem is a
> > > QMI
> > > raw-ip only modem.
> > 
> > Ah, my mistake then. But I would have expected to see more location
> > methods supported if the modem was in QMI mode. Can you run:
> > 
> > qmicli --device-open-qmi -d /dev/cdc-wdm0 --get-service-version-
> > info
> > 
> > also, if you have ModemManager debug logs, that would be great to
> > see
> > too so we can make sure things are being set up correctly.
> > 
> > One other possibility: the modem is in MBIM mode, but ModemManager
> > has
> > some logic to use the MBIM QMI passthrough to set the Sierra "FCC
> > Auth"
> > command. MM doesn't yet have logic to try GPS through QMI while the
> > modem is in MBIM though.
> > 
> > Dan
> > 
> > > https://sigquit.wordpress.com/2017/01/07/modemmanager-in-openwrt-
> > > take-2
> > > 
> > > Though I also admit I am not 100% sure, because the protocol
> > > relations and communication possibilities with the modem are not
> > > yet
> > > clear to me (I am quite new to this topic).
> > > 
> > > Though I am a developer myself, I don't have much experience with
> > > different modems yet. So while I can gladly try to implement
> > > support
> > > for my modem's GNSS AT command set, it might end up being very
> > > model-
> > > specific. With some pointers though about which source files and
> > > APIs
> > > to start with (I don't have a clue yet about MM's code either), I
> > > might give it a go if you don't mind.
> > > 
> > > Regards,
> > > 
> > > Károly
> > > 
> > > April 12, 2017 5:58 PM, "Dan Williams"  wrote:
> > > 
> > > On Wed, 2017-04-12 at 13:21 +, Karoly Pados wrote:
> > > 
> > > > Hello,
> > > > 
> > > > I have a MC7455 form Sierra Wireless. It is working fine for
> > > > data
> > > > communication, but ModemManager doesn't seem to be able to
> > > > recognize
> > > > the locations services (GPS and A-GPS) provided by the modem. 
> > > > 
> > > > mmcli -m 0 --location-status
> > > > 
> > > > /org/freedesktop/ModemManager1/Modem/0
> > > > 
> > > > Location |   capabilities: '3gpp-lac-ci'
> > > > > enabled: '3gpp-lac-ci'
> > > > > signals: 'no'
> > > > 
> > > > If I start ModemManager with the --debug flag and then issue
> > > > AT-
> > > > commands using --command by hand, I can get a GPS fix and
> > > > retrieve
> > > > the location using raw AT commands. (This also means that in my
> > > > case
> > > > there is no need to unlock location services using a password.)
> > > > 
> > > > I read on this list that the modem needs to be in QMI-mode for
> > > > MM
> > > > to
> > > > support location data. I think this is already the case because
> > > > when
> > > > I start MM in debug mode I can see it is using QMI to
> > > > communicate.
> > > > 
> > > > Is there anything else I can do or need to check to make
> > > > location
> > > > data in MM working? Or any way I can help to implement support
> > > > for
> > > > it?
> > > 
> > > At the moment, no. The device is likely 

Re: MC7455 location support

2017-04-13 Thread Dan Williams
On Thu, 2017-04-13 at 09:41 +, Karoly Pados wrote:
> Hello,
> 
> Thanks for your reply. Are you sure the modem is not already in QMI
> mode? MM is clearly using QMI to communicate with it (and I can also
> use qmicli -p), and also below URL states that this modem is a QMI
> raw-ip only modem.

Ah, my mistake then.  But I would have expected to see more location
methods supported if the modem was in QMI mode.  Can you run:

qmicli --device-open-qmi -d /dev/cdc-wdm0 --get-service-version-info

also, if you have ModemManager debug logs, that would be great to see
too so we can make sure things are being set up correctly.

One other possibility: the modem is in MBIM mode, but ModemManager has
some logic to use the MBIM QMI passthrough to set the Sierra "FCC Auth"
command.  MM doesn't yet have logic to try GPS through QMI while the
modem is in MBIM though.

Dan

> https://sigquit.wordpress.com/2017/01/07/modemmanager-in-openwrt-
> take-2
> 
> Though I also admit I am not 100% sure, because the protocol
> relations and communication possibilities with the modem are not yet
> clear to me (I am quite new to this topic).
> 
> Though I am a developer myself, I don't have much experience with
> different modems yet. So while I can gladly try to implement support
> for my modem's GNSS AT command set, it might end up being very model-
> specific. With some pointers though about which source files and APIs
> to start with (I don't have a clue yet about MM's code either), I
> might give it a go if you don't mind.
> 
> Regards,
> 
> Károly
> 
> April 12, 2017 5:58 PM, "Dan Williams"  wrote:
> 
> > On Wed, 2017-04-12 at 13:21 +, Karoly Pados wrote:
> > 
> > > Hello,
> > > 
> > > I have a MC7455 form Sierra Wireless. It is working fine for data
> > > communication, but ModemManager doesn't seem to be able to
> > > recognize
> > > the locations services (GPS and A-GPS) provided by the modem. 
> > > 
> > > mmcli -m 0 --location-status
> > > 
> > > /org/freedesktop/ModemManager1/Modem/0
> > > 
> > > Location |   capabilities: '3gpp-lac-ci'
> > > >    enabled: '3gpp-lac-ci'
> > > >    signals: 'no'
> > > 
> > > If I start ModemManager with the --debug flag and then issue AT-
> > > commands using --command by hand, I can get a GPS fix and
> > > retrieve
> > > the location using raw AT commands. (This also means that in my
> > > case
> > > there is no need to unlock location services using a password.)
> > > 
> > > I read on this list that the modem needs to be in QMI-mode for MM
> > > to
> > > support location data. I think this is already the case because
> > > when
> > > I start MM in debug mode I can see it is using QMI to
> > > communicate.
> > > 
> > > Is there anything else I can do or need to check to make location
> > > data in MM working? Or any way I can help to implement support
> > > for
> > > it?
> > 
> > At the moment, no. The device is likely in MBIM mode which is why
> > you
> > don't get location data. There are two options we are exploring for
> > ModemManager:
> > 
> > 1) use the MBIM QMI passthrough to provide the location data that
> > QMI
> > can provide, which will work with this device because it's a
> > Qualcomm-
> > based one
> > 
> > 2) if that fails, see if we can use the AT ports for GPS
> > 
> > This is mainly just a problem for MBIM devices, because the MBIM
> > protocol specification does not contain any GPS-related options.
> > That
> > is left to vendor proprietary methods, as you've discovered :)
> > 
> > So TLDR; you can't do this yet but it's at least being thought
> > about/worked on. If you're interested in helping fix this, we can
> > use
> > either code or testing...
> > 
> > Thanks!
> > Dan
> > 
> > > My software:
> > > # uname -a
> > > Linux a13-olinuxino 4.9.21 #2 SMP Mon Apr 10 10:29:48 CEST 2017
> > > armv7l GNU/Linux
> > > # ModemManager --version
> > > ModemManager 1.6.2
> > > ...
> > > # qmicli --version
> > > qmicli 1.16.0
> > > ...
> > > 
> > > Thank you for your help, greetings,
> > > 
> > > Károly Pados
> > > 
> > > tec4data
> > > finding of facts!
> > > thoerl 35; 8621 thoerl; austria
> > > mob +43 680 5577 310
> > > uid atu44131505
> > > mail k...@tec4data.at
> > > http://www.tec4data.at
> > > 
> > > This email and any associated attachment are confidential.
> > > Unless you belong to the specified recipients, immediately notify
> > > the
> > > sender.
> > > The content may not be copied and given to third parties.
> > > _
> > > __
> > > ___
> > > 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: MC7455 location support

2017-04-13 Thread Karoly Pados
Hello,

Thanks for your reply. Are you sure the modem is not already in QMI mode? MM is 
clearly using QMI to communicate with it (and I can also use qmicli -p), and 
also below URL states that this modem is a QMI raw-ip only modem.

https://sigquit.wordpress.com/2017/01/07/modemmanager-in-openwrt-take-2

Though I also admit I am not 100% sure, because the protocol relations and 
communication possibilities with the modem are not yet clear to me (I am quite 
new to this topic).

Though I am a developer myself, I don't have much experience with different 
modems yet. So while I can gladly try to implement support for my modem's GNSS 
AT command set, it might end up being very model-specific. With some pointers 
though about which source files and APIs to start with (I don't have a clue yet 
about MM's code either), I might give it a go if you don't mind.

Regards,

Károly

April 12, 2017 5:58 PM, "Dan Williams"  wrote:

> On Wed, 2017-04-12 at 13:21 +, Karoly Pados wrote:
> 
>> Hello,
>> 
>> I have a MC7455 form Sierra Wireless. It is working fine for data
>> communication, but ModemManager doesn't seem to be able to recognize
>> the locations services (GPS and A-GPS) provided by the modem. 
>> 
>> mmcli -m 0 --location-status
>> 
>> /org/freedesktop/ModemManager1/Modem/0
>> 
>> Location |   capabilities: '3gpp-lac-ci'
>> |enabled: '3gpp-lac-ci'
>> |signals: 'no'
>> 
>> If I start ModemManager with the --debug flag and then issue AT-
>> commands using --command by hand, I can get a GPS fix and retrieve
>> the location using raw AT commands. (This also means that in my case
>> there is no need to unlock location services using a password.)
>> 
>> I read on this list that the modem needs to be in QMI-mode for MM to
>> support location data. I think this is already the case because when
>> I start MM in debug mode I can see it is using QMI to communicate.
>> 
>> Is there anything else I can do or need to check to make location
>> data in MM working? Or any way I can help to implement support for
>> it?
> 
> At the moment, no. The device is likely in MBIM mode which is why you
> don't get location data. There are two options we are exploring for
> ModemManager:
> 
> 1) use the MBIM QMI passthrough to provide the location data that QMI
> can provide, which will work with this device because it's a Qualcomm-
> based one
> 
> 2) if that fails, see if we can use the AT ports for GPS
> 
> This is mainly just a problem for MBIM devices, because the MBIM
> protocol specification does not contain any GPS-related options. That
> is left to vendor proprietary methods, as you've discovered :)
> 
> So TLDR; you can't do this yet but it's at least being thought
> about/worked on. If you're interested in helping fix this, we can use
> either code or testing...
> 
> Thanks!
> Dan
> 
>> My software:
>> # uname -a
>> Linux a13-olinuxino 4.9.21 #2 SMP Mon Apr 10 10:29:48 CEST 2017
>> armv7l GNU/Linux
>> # ModemManager --version
>> ModemManager 1.6.2
>> ...
>> # qmicli --version
>> qmicli 1.16.0
>> ...
>> 
>> Thank you for your help, greetings,
>> 
>> Károly Pados
>> 
>> tec4data
>> finding of facts!
>> thoerl 35; 8621 thoerl; austria
>> mob +43 680 5577 310
>> uid atu44131505
>> mail k...@tec4data.at
>> http://www.tec4data.at
>> 
>> This email and any associated attachment are confidential.
>> Unless you belong to the specified recipients, immediately notify the
>> sender.
>> The content may not be copied and given to third parties.
>> ___
>> ___
>> 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