Reg Adding GPS NMEA & GPS RAW Capabilities to get GPS location using mmcli

Aleksander Morgado aleksander at aleksander.es
Mon Jun 22 07:36:22 UTC 2020


Hey

On Sat, Jun 20, 2020 at 3:39 PM Ramu <ramumr06 at gmail.com> wrote:
>
> I applied patches you mentioned for UDEV tags ... Seems to be working now..
>
> mmcli -m 0 --location-status
>   ------------------------
>   Location | capabilities: 3gpp-lac-ci, gps-raw, gps-nmea, gps-unmanaged
>            |      enabled: 3gpp-lac-ci
>            |      signals: no
>   ------------------------
>   GPS      | refresh rate: 30 seconds
>

Good!

> ### Enabling GPS working fine ###
>
> root at tcs-imx6:~# mmcli -m 0 --location-enable-gps-nmea
> successfully setup location gathering
> root at tcs-imx6:~# mmcli -m 0 --location-enable-gps-raw
> successfully setup location gathering
> root at tcs-imx6:~#
>

Ok.

> ### Do we need get any location Data here ??? ####
> root at tcs-imx6:~# mmcli -m 0 --location-get-gps-raw
> error: no actions specified
> root at tcs-imx6:~# mmcli -m 0 --location-get-gps-nmea
> error: no actions specified
>

The command you're looking for is --location-get.

> But the GPS data is comign on the ttyUSB1 port .. I have not connected any passive or active antenna for GPS as of now.. But seeing below data ...
>
> cat /dev/ttyUSB1

If you are using --location-enable-gps-nmea or
--location-enable-gps-raw you CANNOT touch the ttyUSB1 manually. You
cannot "cat" it or any other thing, because you would be hijacking the
data from ModemManager. If you need to cat or touch the ttyUSB1
manually, you instead need to --location-enable-gps-unmanaged, so that
MM takes care of starting the GPS engine, but then ignores the tty
with the GPS data.

> $GPVTG,,T,,M,,N,,K,N*2C
> $GPGSA,A,1,,,,,,,,,,,,,,,,*32
> $GPGGA,,,,,,0,,,,,,,,*66
> $GPRMC,,V,,,,,,,,,,N,V*29
> $GPGLL,,,,,,V,N*64
> $GPVTG,,T,,M,,N,,K,N*2C
> $GPGSA,A,1,,,,,,,,,,,,,,,,*32
> $GPGGA,,,,,,0,,,,,,,,*66
> $GPRMC,,V,,,,,,,,,,N,V*29
> $GPGLL,,,,,,V,N*64
> $GPVTG,,T,,M,,N,,K,N*2C
> $GPGSA,A,1,,,,,,,,,,,,,,,,*32
> $GPGGA,,,,,,0,,,,,,,,*66
> $GPRMC,,V,,,,,,,,,,N,V*29
> $GPGLL,,,,,,V,N*64
>

Given that your GPGGA trace doesn't give any location yet, the output
of --location-get will not give you lat/long info, but it will still
give you the list of NMEA traces received and read by ModemManager (as
long as you don't hijack the tty as said above).

Cheers!

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list