1

UPDATED See edit!

I have installed LineageOS 18.1 for Raspberry Pi 4 (which is an awesome piece of software) and everything seems to be working correctly. With the exception of GPS. I have an A9G connected to the Pi. It is connected to the first Pi's UART and I can see the data coming on ttyAMA0.

:/ # microcom -s 9600 /dev/ttyAMA0 
$GNGGA,092800.998,4955.7547,N,00900.2330,E,0,0,,102.0,M,48.0,M,,*5E
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$BDGSA,A,1,,,,,,,,,,,,,,,*0F
$GPGSV,1,1,00*79
$BDGSV,1,1,00*68
$GNRMC,092800.998,V,4955.7547,N,00900.2330,E,0.000,0.00,211021,,,N*55
$GNVTG,0.00,T,,M,0.000,N,0.000,K,N*2C
$GNGGA,092801.998,4955.7547,N,00900.2330,E,0,0,,102.0,M,48.0,M,,*5F
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$BDGSA,A,1,,,,,,,,,,,,,,,*0F
$GPGSV,1,1,00*79
$BDGSV,1,1,00*68
$GNRMC,092801.998,V,4955.7547,N,00900.2330,E,0.000,0.00,211021,,,N*54
$GNVTG,0.00,T,,M,0.000,N,0.000,K,N*2C
$GNGGA,092802.998,4955.7547,N,00900.2330,E,0,0,,102.0,M,48.0,M,,*5C

I changed the GPS receiver to use ttyAMA0 in /vendor/build.prop

# GPS ro.kernel.android.gps=ttyAMA0

I also trying with adding

ro.kernel.android.gpsttybaud = 9600

or

ro.kernel.android.gps.speed = 9600

But not a single App can receive GPS data. I have the feeling I am missing something very simple but essential.

Any help very appreciated

EDIT Ok, I am a step further. The first problem was apparently, what a bummer, a permission issue. I adjusted it in the file: /vendor/ueventd.rc

From:

/dev/ttyAMA0 0660 bluetooth bluetooth
To:

/dev/ttyAMA0 0660 system radio

Now it seems that the data is being received and correctly interpreted. But when I open a GPS testing App, the signal is flickering. It almost like if something else is reading from ttyACM0.

Is it possible?

just to clarify what I mean with "flickering", please take a look at https://cloud.sobi.pro/f/68f0398aea1549918376/

Radek Suski
  • 1,352
  • 1
  • 13
  • 23
  • 1
    I'm not sure how android works internally, but I would doubt it really uses NMEA sentences. Is there some documentation about that `ro.kernel.android.gps` module? – PMF Oct 21 '21 at 09:49
  • I am not entirely sure but there was another terminal defined before (ttyACM0) and reading different comment it actually looks like it expects a NMEA string on that console – Radek Suski Oct 21 '21 at 09:53
  • I'm not sure i understand: you get data in /dev/ttyAMA0, but then what it is the problem? Note: you may need a driver a la `microcom` (which initialize and translate serial port. Probably you cannot use directly the output or tty). But, do you know we have a sister site about raspberry? https://raspberrypi.stackexchange.com/ Maybe there you can find better answers – Giacomo Catenazzi Oct 21 '21 at 12:31
  • What do you mean by "flickering"? If something else is reading from the port, that wouldn't hurt, since this stream is anyway read-only and could be read by many at once. Even loosing a few packets wouldn't cause much damage typically. Is it jumping around, or what exactly is the behavior? – PMF Oct 21 '21 at 16:53
  • just to clarify what I mean with "flickering", please take a look at https://cloud.sobi.pro/f/68f0398aea1549918376/ I somehow it has now something to do with the stop bits or something similar – Radek Suski Oct 21 '21 at 17:50
  • 1
    Yea, that looks like it's sometimes loosing sync, but your GPS is also sending weird data: You have empty GSA sentences (these are the satellite positions) from two sources (GPGSDA and BDGSA). Also the RMC sentence is invalid, it should have an "A" in position 2, not a "V" for Void. Make sure your GPS has clear view to the sky first. – PMF Oct 21 '21 at 18:36

1 Answers1

0

I also had the same flickering issue. I can see it in a map program or with physics toolbox where I can see the GPS LAT LONG. It flickers between the "real" position and 0.00000 for the LAT and LONG.

I am using LineageOS17.1 on a Raspberry Pi 4

my Ultimate GPS USB is from Adafruit and is on /dev/ttyUSB0

I tried updating build.prop in both /vendor and /system with the

ro.kernel.android.gps.speed = 9600

and

ro.kernel.android.gps = ttyUSB0

The solution that I eventually used was to remove the r0.kernel... from both build.prop and use the app GPS Connector

https://play.google.com/store/apps/details?id=de.pilablu.gpsconnector&hl=en_US&gl=US

Enable in developer options under "select mock location app" you can select the GPS Connector.

You can have the GPS Connector app start at boot.

If you find a more elegant solution than using an app, please reply.