meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
location [2023/05/02 23:38]
boroli added python script to convert log file into gpx file
location [2023/05/03 02:12] (current)
boroli Add information if ADB is offline
Line 5: Line 5:
 **Warning**:​ a lot of people are reporting that the GPS has poor sensitivity,​ see https://​forum.pine64.org/​showthread.php?​tid=11680 **Warning**:​ a lot of people are reporting that the GPS has poor sensitivity,​ see https://​forum.pine64.org/​showthread.php?​tid=11680
  
-**Warning**: ​the GPS works only when an active SIM is present. (However it does not require SIM credit or a dataplan)+**Warning**: ​The ModemManager ​GPS functionality ​works only when an active SIM is present. (However it does not require SIM credit or a dataplan. And if you don't have a SIM card, then you can still access the GPS from the modem via gpsd)
  
 TL;DR When the Mobian first time setup wizard asks if you want to send location data to Mozilla Location Services answer "​Yes."​ Use either [[maps|Maps]] or install [[puremaps|PureMaps]]. Run one of those apps in the background (or foreground) when you're traveling around with WiFi and Mobile Data enabled. For vehicle navigation, position your phone to have a good view of the sky when inside, and keep it in the open every once in a while for at least a few minutes so that it can find the satellites. TL;DR When the Mobian first time setup wizard asks if you want to send location data to Mozilla Location Services answer "​Yes."​ Use either [[maps|Maps]] or install [[puremaps|PureMaps]]. Run one of those apps in the background (or foreground) when you're traveling around with WiFi and Mobile Data enabled. For vehicle navigation, position your phone to have a good view of the sky when inside, and keep it in the open every once in a while for at least a few minutes so that it can find the satellites.
Line 74: Line 74:
  
 <​code>​ <​code>​
-sudo mmcli -m --location-get+$ mmcli -m any --location-get
   --------------------------   --------------------------
   3GPP |      operator code: 302   3GPP |      operator code: 302
Line 82: Line 82:
        ​| ​           cell id: 086C5B39        ​| ​           cell id: 086C5B39
 ... Potentially some GNSS NMEA Information ... ... Potentially some GNSS NMEA Information ...
 +</​code>​
 +
 +
 +If you access ''​mmcli''​ directly from your phone, you don't need ''​sudo''​ rights, but if you access mmcli via ssh then you need ''​sudo mmcli''​. Otherwise you run into something like:
 +
 +<​code>​
 +error: couldn'​t get location from the modem: '​GDBus.Error:​org.freedesktop.ModemManager1.Error.Core.Unauthorized:​ PolicyKit authorization failed: not authorized for '​org.freedesktop.ModemManager1.Location''​
 </​code>​ </​code>​
  
Line 300: Line 307:
  
 The location had to be activated either with ModemManager before you go into Airplane mode: The location had to be activated either with ModemManager before you go into Airplane mode:
-<​code>​sudo mmcli -m any --location-enable-gps-nmea --location-enable-gps-raw</​code>​+<​code>​mmcli -m any --location-enable-gps-nmea --location-enable-gps-raw</​code>​
  or afterwards directly via [[https://​github.com/​the-modem-distro/​pinephone_modem_sdk/​issues/​53#​issuecomment-1019462666|AT command]] <​code>​sudo sh -c 'echo -ne "​AT+QGPS=1\r"​ > /​dev/​ttyUSB2'</​code>,​ otherwise gpsd might fail and can't produce any output from the modem.  or afterwards directly via [[https://​github.com/​the-modem-distro/​pinephone_modem_sdk/​issues/​53#​issuecomment-1019462666|AT command]] <​code>​sudo sh -c 'echo -ne "​AT+QGPS=1\r"​ > /​dev/​ttyUSB2'</​code>,​ otherwise gpsd might fail and can't produce any output from the modem.
  
Line 449: Line 456:
  
 WARNING!!! These scripts do NOT reset the log file. Make sure you manually delete it in certain intervals. This was done in case the phone or modem crashes during a trip, and you need/want to continue gps logging immediately without dealing with the log files. WARNING!!! These scripts do NOT reset the log file. Make sure you manually delete it in certain intervals. This was done in case the phone or modem crashes during a trip, and you need/want to continue gps logging immediately without dealing with the log files.
 +
 +If you get the error message:
 +<​code>​
 +adb: error: failed to get feature set: device offline
 +</​code>​
 +
 +You can manually activate ADB again with
 +
 +<​code>​
 +echo '​AT+ADBON'​ | sudo atinout - /​dev/​ttyUSB2 -
 +</​code>​
 +
 +and then check with, if the modem is online again:
 +
 +<​code>​
 +adb devices
 +</​code>​
 +
 +The output should look like
 +
 +<​code>​
 +List of devices attached
 +community_fw ​   device
 +</​code>​
 +
  
 ===== Convert log to gpx file ===== ===== Convert log to gpx file =====
Line 464: Line 496:
 loglist = logfile.readlines() loglist = logfile.readlines()
  
-today = datetime.now().strftime('​%Y-%m-%d'​)+today = datetime.utcnow().strftime('​%Y-%m-%d'​)
 outputFile = open("​gps_log_"​+today+"​.gpx",​ "​w"​) outputFile = open("​gps_log_"​+today+"​.gpx",​ "​w"​)