Unsatisfactory GPS reception on PinePhone?
#21
(12-16-2020, 08:23 AM)Benatti Wrote:
(12-15-2020, 06:55 AM)Benatti Wrote: Estive tentando habilitar gps no meu pinephone 32G emmc / 3G RAM e não funcionou, observei que quando uso um "gps usb dongle" nele aparece /dev/ttyACM0 e /dev/gps0 e os programas marble e foxtrotgps funcionam e sem o "gps usb dongle" nós temos /dev/ttyUSB1 (gps) mas não temos /dev/ttyS1. Parece que o /dev/ttyS1 está fazendo falta para o gpsd, sendo que a saída de gpsmon é quase a mesma com ou sem "gps usb dongle".
Teria um comando AT para habilitar renomear ou criar /dev/ttyS1 e ver se resolve o problema?
Também encontrei diferença no funcionamento do foxtrot editando /etc/default/gpsd em DEVICES="/dev/ttyUSB1"
agradeço a atenção de todos.
esqueci de mencionar que estou usando mobian.
Sorry if I misunderstand the question - I had to use google translate

I may have missed some changes to Mobian, so the information below may be out of date. I may also be wrong.

Mobian normally uses ModemManager and Geoclue for location. It doesn't include configuration for gpsd on PinePhone so you would have to do that yourself. You would also need to stop ModemManager connecting to the gps port - something like:
Code:
mmcli -m 0 --location-disable-gps-nmea
mmcli -m 0 --location-enable-gps-unmanaged
The port should now be available for gpsd to connect to.
PostmarketOS used /etc/gpsd/device-hook to turn the gps on when needed. It may be possible to use this in Mobian to do this switching automatically when a client connects to gpsd.
  Reply
#22
(12-16-2020, 08:23 AM)Benatti Wrote:
(12-15-2020, 06:55 AM)Benatti Wrote: Estive tentando habilitar gps no meu pinephone 32G emmc / 3G RAM e não funcionou, observei que quando uso um "gps usb dongle" nele aparece /dev/ttyACM0 e /dev/gps0 e os programas marble e foxtrotgps funcionam e sem o "gps usb dongle" nós temos /dev/ttyUSB1 (gps) mas não temos /dev/ttyS1. Parece que o /dev/ttyS1 está fazendo falta para o gpsd, sendo que a saída de gpsmon é quase a mesma com ou sem "gps usb dongle".
Teria um comando AT para habilitar renomear ou criar /dev/ttyS1 e ver se resolve o problema?
Também encontrei diferença no funcionamento do foxtrot editando /etc/default/gpsd em DEVICES="/dev/ttyUSB1"
agradeço a atenção de todos.
esqueci de mencionar que estou usando mobian.

Google Portuguese >> English:
Quote:Benatti

I've been trying to enable gps on my pinephone 32G emmc / 3G RAM and it didn't work, I noticed that when I use a "gps usb dongle" it appears / dev / ttyACM0 and / dev / gps0 and the marble and foxtrotgps programs work and without the "usb gps dongle "we have / dev / ttyUSB1 (gps) but we don't have / dev / ttyS1. It looks like / dev / ttyS1 is missing for gpsd, with gpsmon output almost the same with or without "gps usb dongle". Would you have an AT command to enable renaming or create / dev / ttyS1 and see if it solves the problem? I also found a difference in the functioning of foxtrot by editing / etc / default / gpsd in DEVICES = "/ dev / ttyUSB1"

Quote:Benatti

Thank you all for the attention. forgot to mention that i'm using mobian.

I have not used the AT command and tty interface but my GPS finally worked today after seeding with AGPS again. Please see my previous posts on this thread. I used mmcli and alastair-dm's scripts:
https://gist.github.com/alastair-dm/2632...e555fa6628

For convenience, I called the first script from the second script so I only had to execute one script from the command prompt, as follows:

Code:
#!/bin/sh
#
# stop ModemManager, run python script to upload AGPS data then restart ModemManager

sudo systemctl disable ModemManager.service
sudo systemctl stop ModemManager.service

# now execute first script (added next line to alastair-dm's second script)[url=https://gist.github.com/alastair-dm][/url]
/home/mobian/load_agps_data.py

sudo systemctl enable ModemManager.service
sudo systemctl start ModemManager.service

Also, for line 83 of load_agps_data.py I am using
Code:
res = sendCmd('AT+QGPS=1,255,1000,0,10')

As with all my previous unsuccessful attempts, I used agps. Today it was agps-msb and one cannot use both agps-msb and agps-msa at the same time.

I don't know if the modified sendCmd or the msb version of agps make a difference but, after enabling running the scipts and
Code:
[code]mmcli -m 0 --location-enable-agps-msb


I typed:

Code:
mmcli -m 0 --location-enable-gps-raw
mmcli -m 0 --location-enable-gps-nmea

My internal GPS almost immediately sprang to like and worked very well today for the first time (finally)! I took a 2 hour drive with my phone under the windshield of my car. I experienced several 4G data dropouts, due to marginal cellular service in some areas. Nonetheless, the GPS kept working, as evidenced by:

Code:
mmcli -m 0 --location-status
mmcli -m 0 --location-get

Map worked between the 4G data dropouts. It is unfortunate the Map doesn't cache data. It is bad enough to keep losing the map but the program also consumes my very limited 4G data every time Map reconnects to the Internet and comes back online--loading the same data over and over. Dodgy  I hope a map caching feature can be added to Map soon.

I have not done apt dist-upgrade for over a week and will make a backup of my eMMC Mobian image before doing so. I'm concerned that a bug "fix" may impact my newly-won GPS functionality. It seems to me that eg25-manager is undergoing quite active debug at the moment.
  Reply
#23
(12-16-2020, 10:39 PM)calinb Wrote:
(12-16-2020, 08:23 AM)Benatti Wrote:
(12-15-2020, 06:55 AM)Benatti Wrote: Estive tentando habilitar gps no meu pinephone 32G emmc / 3G RAM e não funcionou, observei que quando uso um "gps usb dongle" nele aparece /dev/ttyACM0 e /dev/gps0 e os programas marble e foxtrotgps funcionam e sem o "gps usb dongle" nós temos /dev/ttyUSB1 (gps) mas não temos /dev/ttyS1. Parece que o /dev/ttyS1 está fazendo falta para o gpsd, sendo que a saída de gpsmon é quase a mesma com ou sem "gps usb dongle".
Teria um comando AT para habilitar renomear ou criar /dev/ttyS1 e ver se resolve o problema?
Também encontrei diferença no funcionamento do foxtrot editando /etc/default/gpsd em DEVICES="/dev/ttyUSB1"
agradeço a atenção de todos.
esqueci de mencionar que estou usando mobian.

Google Portuguese >> English:
Quote:Benatti

I've been trying to enable gps on my pinephone 32G emmc / 3G RAM and it didn't work, I noticed that when I use a "gps usb dongle" it appears / dev / ttyACM0 and / dev / gps0 and the marble and foxtrotgps programs work and without the "usb gps dongle "we have / dev / ttyUSB1 (gps) but we don't have / dev / ttyS1. It looks like / dev / ttyS1 is missing for gpsd, with gpsmon output almost the same with or without "gps usb dongle". Would you have an AT command to enable renaming or create / dev / ttyS1 and see if it solves the problem? I also found a difference in the functioning of foxtrot by editing / etc / default / gpsd in DEVICES = "/ dev / ttyUSB1"

Quote:Benatti

Thank you all for the attention. forgot to mention that i'm using mobian.

I have not used the AT command and tty interface but my GPS finally worked today after seeding with AGPS again. Please see my previous posts on this thread. I used mmcli and alastair-dm's scripts:
https://gist.github.com/alastair-dm/2632...e555fa6628

For convenience, I called the first script from the second script so I only had to execute one script from the command prompt, as follows:

Code:
#!/bin/sh
#
# stop ModemManager, run python script to upload AGPS data then restart ModemManager

sudo systemctl disable ModemManager.service
sudo systemctl stop ModemManager.service

# now execute first script (added next line to alastair-dm's second script)[url=https://gist.github.com/alastair-dm][/url]
/home/mobian/load_agps_data.py

sudo systemctl enable ModemManager.service
sudo systemctl start ModemManager.service

Also, for line 83 of load_agps_data.py I am using
Code:
res = sendCmd('AT+QGPS=1,255,1000,0,10')

As with all my previous unsuccessful attempts, I used agps. Today it was agps-msb and one cannot use both agps-msb and agps-msa at the same time.

I don't know if the modified sendCmd or the msb version of agps make a difference but, after enabling running the scipts and
Code:
[code]mmcli -m 0 --location-enable-agps-msb


I typed:

Code:
mmcli -m 0 --location-enable-gps-raw
mmcli -m 0 --location-enable-gps-nmea

My internal GPS almost immediately sprang to like and worked very well today for the first time (finally)! I took a 2 hour drive with my phone under the windshield of my car. I experienced several 4G data dropouts, due to marginal cellular service in some areas. Nonetheless, the GPS kept working, as evidenced by:

Code:
mmcli -m 0 --location-status
mmcli -m 0 --location-get

Map worked between the 4G data dropouts. It is unfortunate the Map doesn't cache data. It is bad enough to keep losing the map but the program also consumes my very limited 4G data every time Map reconnects to the Internet and comes back online--loading the same data over and over. Dodgy  I hope a map caching feature can be added to Map soon.

I have not done apt dist-upgrade for over a week and will make a backup of my eMMC Mobian image before doing so. I'm concerned that a bug "fix" may impact my newly-won GPS functionality. It seems to me that eg25-manager is undergoing quite active debug at the moment.

Agradeço a atenção de todos, mas não consegui fazer funcionar ainda, vou continuar tentando e se funcionar aviso por aqui.
  Reply
#24
(12-18-2020, 10:56 AM)Benatti Wrote:
Agradeço a atenção de todos, mas não consegui fazer funcionar ainda, vou continuar tentando e se funcionar aviso por aqui.

Google translation:
I appreciate everyone's attention, but I haven't been able to make it work yet, I will keep trying and if it works, notice here.
I am sorry it does not work for you. Based on mmcli commands, my phone GPS is not as sensitive as my other phones and it has trouble receiving sufficiently strong signals from satellites to find a position unless it has a very clear view of the sky.
  Reply
#25
When checking basic GPS functionality I disabled ModemManager and used picocom to access the two USB serial ports - one with local echo enabled to send the AT commands to the modem, and the other to view the NMEA output. That way you see exactly what's going in and out, and don't have to worry about anything ModemManager may be hiding from you.
  Reply
#26
(12-22-2020, 08:46 AM)wibble Wrote: When checking basic GPS functionality I disabled ModemManager and used picocom to access the two USB serial ports - one with local echo enabled to send the AT commands to the modem, and the other to view the NMEA output. That way you see exactly what's going in and out, and don't have to worry about anything ModemManager may be hiding from you.
Thanks, wibble. I still haven't installed picocom or learned about it yet. Perhaps it might help me find a means of improvement. However, until a map program supports the caching of map data and not substituting an error screen for a perfectly good map screen just because of a glitch in location, I'm not too motivated. There are too many gaps in cellular data coverage where I live to make Linux ap maps useful and it's actually a problem throughout all of rural Idaho. I'm tired of using and supporting spy phones though so I'll just carry a dedicated GPS (even my old Garmin) when I need to know my location until things improve.
  Reply
#27
You should investigate navit, or Pure Maps with the companion OSMScoutServer for caching map data, but both require a bit of manual configuration still. There's a fair bit on navit in this thread:
https://forum.pine64.org/showthread.php?tid=10697
  Reply
#28
(12-22-2020, 04:14 AM)calinb Wrote:
(12-18-2020, 10:56 AM)Benatti Wrote:
Agradeço a atenção de todos, mas não consegui fazer funcionar ainda, vou continuar tentando e se funcionar aviso por aqui.

Google translation:
I appreciate everyone's attention, but I haven't been able to make it work yet, I will keep trying and if it works, notice here.
I am sorry it does not work for you. Based on mmcli commands, my phone GPS is not as sensitive as my other phones and it has trouble receiving sufficiently strong signals from satellites to find a position unless it has a very clear view of the sky.
Olá pessoal, finalmente o gps do pinephone está funcionando, vamos ao passo a passo:
1 Instalei kde-marble, foxtrotgps, gpsd e gpsd-clients.

2 Editei o arquivo com o comando: sudo nano /etc/default/gpsd para ficar como assim:

# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="$GPS_LINE /dev/ttyUSB1"

# Other options you want to pass to gpsd
GPSD_OPTIONS=""

# Automatically hot add/remove USB GPS devices via gpsdctl
USBAUTO="true"
GPS_LINE=/dev/ttyUSB1

Nos testes que eu fiz, demorou bastante para funcionar a primeira vez, e constatei que com o celular exposto ao sol ele pega sinal mais rapido, parece que com o aquecimento do aparelho ele melhora a sensibilidade, quando o aparelho está frio não pegou sinal de satélite.

Não é preciso realizar os comandos :
sudo mmcli -m 0 --location-enable-agps-msb
sudo mmcli -m 0 --location-enable-gps-raw
sudo mmcli -m 0 --location-enable-gps-nmea
sudo mmcli -m 0 --location-get
sudo mmcli -m 0 --location-status

Sem acionar estes comandos foi só abrir o programa navegador de gps, eu testei tanto com marble quanto foxtrotgps e depois de algum tempo funcinou normalmente.

Sugiro o marble, parece que esta mais maduro. Consegui marcar ponto de saida e ponto de chegada, definir rota, ele realça a rota no mapa e falta viajar para teste de estrada com ele, mas isto vai demorar.

Voce pode usar o cabo serial/usb e monitorar no notebook com o programa cgps ou gpsmon no terminal, para verificar o andamento do processo de descoberta de satélites do gpsd.
Abraços, e boa passagem de ano a todos.
  Reply
#29
(12-24-2020, 11:40 AM)Benatti Wrote:
(12-22-2020, 04:14 AM)calinb Wrote:
(12-18-2020, 10:56 AM)Benatti Wrote:
Agradeço a atenção de todos, mas não consegui fazer funcionar ainda, vou continuar tentando e se funcionar aviso por aqui.

Google translation:
I appreciate everyone's attention, but I haven't been able to make it work yet, I will keep trying and if it works, notice here.
I am sorry it does not work for you. Based on mmcli commands, my phone GPS is not as sensitive as my other phones and it has trouble receiving sufficiently strong signals from satellites to find a position unless it has a very clear view of the sky.
Olá pessoal, finalmente o gps do pinephone está funcionando, vamos ao passo a passo:
1 Instalei kde-marble, foxtrotgps, gpsd e gpsd-clients.

2 Editei o arquivo com o comando: sudo nano /etc/default/gpsd para ficar como assim:

# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="$GPS_LINE /dev/ttyUSB1"

# Other options you want to pass to gpsd
GPSD_OPTIONS=""

# Automatically hot add/remove USB GPS devices via gpsdctl
USBAUTO="true"
GPS_LINE=/dev/ttyUSB1

Nos testes que eu fiz, demorou bastante para funcionar a primeira vez, e constatei que com o celular exposto ao sol ele pega sinal mais rapido, parece que com o aquecimento do aparelho ele melhora a sensibilidade, quando o aparelho está frio não pegou sinal de satélite.

Não é preciso realizar os comandos :
sudo mmcli -m 0 --location-enable-agps-msb
sudo mmcli -m 0 --location-enable-gps-raw
sudo mmcli -m 0 --location-enable-gps-nmea
sudo mmcli -m 0 --location-get
sudo mmcli -m 0 --location-status

Sem acionar estes comandos foi só abrir o programa navegador de gps, eu testei tanto com marble quanto foxtrotgps e depois de algum tempo funcinou normalmente.

Sugiro o marble, parece que esta mais maduro. Consegui marcar ponto de saida e ponto de chegada, definir rota, ele realça a rota no mapa e falta viajar para teste de estrada com ele, mas isto vai demorar.

Voce pode usar o cabo serial/usb e monitorar no notebook com o programa cgps ou gpsmon no terminal, para verificar o andamento do processo de descoberta de satélites do gpsd.
Abraços, e boa passagem de ano a todos.
Smile  I am happy to hear it is working! Thanks for the report. Very interesting about the cold. It was cold outside (Idaho, USA winters...brrrr) when I had problems too.

(12-23-2020, 06:42 PM)wibble Wrote: You should investigate navit, or Pure Maps with the companion OSMScoutServer for caching map data, but both require a bit of manual configuration still. There's a fair bit on navit in this thread:
https://forum.pine64.org/showthread.php?tid=10697
Thanks for the link, wibble!
  Reply
#30
I've been trying to get GPS working on my PinePhone running Manjaro CE (latest s/w updates) without much success. Here's my test procedure (I've written a short BASH script to automate most of this, from which I'm quoting below):

1) Reboot phone

2) Download xtra data for step 3

3) Stop & disable modem manager, then run alastair-dm's script for uploading the xtra data into the modem. I've modified this script to use the data downloaded in step 2. Since the modem is off while running the script, downloading would not be possible without Wifi. Finally, enable & start modem manager again.

Code:
function upload_gps_data {
    echo "loading AGPS data into modem via Python script"
    systemctl disable ModemManager.service
    systemctl stop ModemManager.service
    /home/manjaro/load_gps_data.py
    systemctl enable ModemManager.service
    systemctl start ModemManager.service
}

4) Wait for the modem to come up, then enable desired GPS capabilities in the modem. During all my tests, these were 10 seconds refresh rate, signal on, don't set supl

Code:
#
# $1    modem ID
# $2    GPS refresh rate in seconds
# $3    `signal` for activating signals, anything else for off
# $4    `supl` for activating supplemental servers, anything else for off
#
function set_gps_capabilities {

    echo "setting GPS capabilities for modem $1"

    mmcli -m "$1" \
        --location-enable-agps-msb \
        --location-enable-gps-nmea \
        --location-enable-gps-raw
    mmcli -m "$1" --location-set-gps-refresh-rate="$2"

    if [[ "$3" == "signal" ]]; then
        mmcli -m "$1" --location-set-enable-signal
    fi

    if [[ "$4" == "supl" ]]; then
        mmcli -m "$1" --location-set-supl-server=xtrapath1.izatcloud.net:80
    fi

    mmcli -m "$1" --location-status
}

5) Go for a walk, open field, no obstructions.

Observations:

- location status usually reports this:

Code:
[manjaro@manjaro-arm ~]$ mmcli -m 0 --location-status
  --------------------------------
  Location |         capabilities: 3gpp-lac-ci, gps-raw, gps-nmea, agps-msa, agps-msb
           |              enabled: 3gpp-lac-ci, gps-raw, gps-nmea, agps-msb
           |              signals: yes
  --------------------------------
  GPS      |         refresh rate: 10 seconds
           | supported assistance: xtra
           |   assistance servers: http://xtrapath2.izatcloud.net/xtra3grc.bin
           |                       http://xtrapath3.izatcloud.net/xtra3grc.bin
           |                       http://xtrapath1.izatcloud.net/xtra3grc.bin

- location get has this to say:

Code:
[manjaro@manjaro-arm ~]$ sudo mmcli -m 0 --location-get
  --------------------------
  3GPP |      operator code: 262
       |      operator name: 1
       | location area code: FFFE
       | tracking area code: 5222
       |            cell id: 01AC4800
  --------------------------
  GPS  |               nmea: $GPGSA,A,1,,,,,,,,,,,,,,,,*32
       |                     $GPRMC,,V,,,,,,,,,,N*53
       |                     $GPVTG,,T,,M,,N,,K,N*2C
       |                     $GPGGA,125451.31,,,,,0,,,,,,,,*4C

- checking the NMEA stream for visible satellites, I get this:

Code:
sudo cat /dev/ttyUSB1 | grep GPGSV
$GPGSV,1,1,01,31,55,268,,1*5B
$GPGSV,1,1,01,31,55,268,,1*5B
$GPGSV,1,1,01,31,55,267,,1*54
$GPGSV,1,1,01,31,55,267,,1*54
$GPGSV,1,1,01,31,55,267,,1*54

I've tried this several times during the past week, but never got anything else than the samples above, i.e. no satellites, no GPS fix. I also checked with the Maps application, and that occasionally gives me a location. However, it's usually pretty far off the actual position (100 to 200m), and since GPS actually doesn't see satellites, I guess that's location via the cell towers.

Questions:

- Am I missing anything?
- In step 4, should I enable agps-msb, gps-nmea, and gps-raw via separate calls to mmcli, in that order?
- Has anyone found a reproducible procedure for reliably getting GPS location?
- Could there be a hardware failure? Has anyone experienced an actual broken GPS receiver?
- What kind of performance can we expect at best from the particular GPS receiver that's built into the modem?

Kind regards,
Alex
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  my pinephone melted norayr 6 722 04-04-2024, 07:22 PM
Last Post: Zebulon Walton
  Pinephone refusing to charge while suspended tiol 1 1,028 04-02-2024, 10:54 AM
Last Post: joH_N_Doe64
  various tricks to open the pinephone shengchieh 2 644 03-23-2024, 09:27 AM
Last Post: Ferriah
  pinephone can provide more than 500mA to a usb-c displayport device? unrznbl 2 261 03-21-2024, 08:52 AM
Last Post: unrznbl
  pinephone keyboard + dock question tuxcall 7 2,654 02-05-2024, 03:17 PM
Last Post: wigan
  PinePhone Pro not booting (Cap error!, pctl timeout) jealda 2 1,329 11-16-2023, 05:03 AM
Last Post: DrYak
  Pinephone frame damages Uturn 2 914 10-23-2023, 02:49 AM
Last Post: Uturn
  PinePhone Keyboard KJ6OHG 11 7,900 08-23-2023, 03:25 AM
Last Post: Kali
  PinePhone constantly vibrating and won't take charge ImmyChan 5 5,351 07-23-2023, 03:49 PM
Last Post: kb-zealot
  Using optical drives with Pinephone cdforever 2 1,156 07-18-2023, 01:28 PM
Last Post: cdforever

Forum Jump:


Users browsing this thread: 2 Guest(s)