gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] gpsd - AT command control on modems


From: Gary E. Miller
Subject: Re: [gpsd-dev] gpsd - AT command control on modems
Date: Sat, 13 Jul 2019 17:08:31 -0700

Yo Luca!

On Sat, 13 Jul 2019 18:32:11 +0200
Luca Weiss <address@hidden> wrote:

> Hi Gary,
> sorry for not replying earlier but I didn't get your reply (or any of
> the other replies here) into my inbox, so I just now accidentally saw
> in the webinterface that there have been replies. I'm not subscribed
> to the list, so maybe you used "Reply" instead of "Reply all" ?

I don't do private consults, except to paying clients.  So all
my replies will be on the list.  And that way other people can
also help.

> Anyways, replying to your reply:
> 
> > Dunno why you would use the socket AND specify the device.  
> 
> I copied the command from somewhere; I'll use the service file in
> Alpine for launching gpsd next time, it was just a quick way to get
> it working.

Certainly not a usage we recommend.

> > Afterwards, not before?  USB2 not USB1?  
> 
> Doesn't matter, if before or after from what I can tell.
> 
> Yes, ttyUSB2, because that's used for "AT command communication" and
> ttyUSB1 is used for "GPS NMEA message output" according to a document
> from Quectel.

Since gpsd will not be on USB2 you'll have to send the command
some other way.  Prolly just "echo".

> > Don't bother,  That would be very hard.  Just do:
> >         # echo ""AT+QGPSEND" > /dev/ttyUSB2  
> 
> What's bugging me there is that the modem is still doing all the hard
> work with GPS even when nobody is using the gps coordinates and is
> probably using a lot of energy (remember, it's a phone with a
> battery^^).

No way I can tell without seeing the doc.

> > > I've also seen that ofono provides a "location reporting api"; and
> > > there's also modemmanager which provides seemingly the same
> > > functionality;  
> > 
> > No idea.  Might be soemthing easy and standard, might be bizarre and
> > proprietary.
> > 
> > we would need some doc to know.  
> 
> The modem has a lot of weird assistance data stuff that I don't quite 
> understand, partly because - as far as I understand it - some tool is
> needed to upload the assistance data (which can be downloaded from a
> website as a file) to the modem and then some AT commands have to be
> run to use that file.

No modern GPS needs assistance data.  That just speeds up the
start, which for a new GPS should still be under 2 minutes.

> But other than that, the only important commands for the GNSS part of
> the modem are:
> 
> AT+QGPS=1 for turning ON the GNSS
> AT+QGPSEND for turning OFF the GNSS
> 
> The command manual can be found at [1]

Got it, that helps.

> Also replying to Paul:
> 
> > How about adding that to /etc/gpsd/device-hook (see man gpsd)?  
> 
> Does the deactivation hook get called when no application is using
> gpsd anymore - which would fit the power requirements mentioned
> above? Thanks for the pointer!

Yes, there is an activate and a deactivate.  Not commonly used so
may need some playing with.

The code is in gpsd_run_device_hook() in the file libgpsd_core.c.
The important code is:

        (void)snprintf(buf, sizeof(buf), "%s %s %s",
                       DEVICEHOOKPATH, device_name, hook);

DEVICEHOOKPATH is the script to run.  device_name is arg[1] and
hook is ACTIVATE or DEACTIVATE.  So you can code up a simple script.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin

Attachment: pgpzpWeKJJndt.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]