[YotaPhone] zertyz:
Hi, there, Yotaphone 2 friends!

I bring wonderful news, in case some of you hasn't update yet to Marshmallow: it is now possible to have your GPS/GLONASS working perfectly -- it even almost worked inside a 1km tunnel, berried in some 100/200m of granite!!

Unfortunately, I lost track of my claims, but I'll leve here the info, in case some of you want to research.

1. The Problem:

The GPS problem in Yotaphone 2 comes from Lollipop, not from the device, modem or firmware.... It happens that Lollipop tries to inject the AGPS data in a wrong format, which causes the GPS daemon to segfault -- and this affected other devices as well, which, BTW, have published a fix, different from our case with Yotaphone.

The bug happens every 5 minutes when you have the mobile data enabled. Meaning: every five minutes, your GPS connection is dropped, the GPS daemon process is restarted, a GPS lock has to be acquired... sometimes you don't have time to lock before another 5 minutes have passed and the GPS daemon is killed again; other times, you'll experience some time with a good GPS reception, until 5 minutes since the last drop gets by... you got it.

If you want to check these claims, put your phone in airplane mode or disable data and you'll see that you'll run GPS applications with no issues -- maybe you won't be able to run Waze this way, but...

2. The solution

A simple edit on /system/etc/gps.conf solves the issue.

To edit this file, however, you'll have to:

a) have your phone rooted;

b) mount /system in read-write mode, to be able to edit this file;

c) edit the file using the terminal and the editor called "vi" or by using another tool like "ES Explorer".

Remember two important things:

- I tested it only on Lollipop (I still didn't upgrade). I hope the bug is solved for Marshmallow and this fix isn't needed, however one might find some settings worth, specially the enabling of GLONASS reception.

- Please make a backup of your old gps.conf in case something goes wrong.

At the end of the post, I'll transcribe my whole gps.conf file, which has fixes for the mentioned bug and other improvements -- including a working GLONASS reception, which seems to have been ingnored in Lollipop (!?)

If someone wants to know how these kind of things happens in the software world, please bear in mind that the Yotaphone 2 engineers, who made a wonderful piece of hardware, probably did a hard work on testing their software the first time (on kitkat), but probably did not repeat their comprehensive quality assurance process and test cases for Lollipop or even Marshmallow. Who could have imagined google would provide a buggy release, after all?

No more talking, here goes my gps.conf file in the hope that it will be useful:

#Uncommenting these urls would only enable

#the power up auto injection and force injection(test case).

#XTRA_SERVER_1=http://xtrapath1.izatcloud.net/xtra2.bin

#XTRA_SERVER_2=http://xtrapath2.izatcloud.net/xtra2.bin

#XTRA_SERVER_3=http://xtrapath3.izatcloud.net/xtra2.bin

# the standard data servers

AGPS=http://xtra1.gpsonextra.net/xtra.bin

XTRA_SERVER_1=http://xtra3.gpsonextra.net/xtra.bin

XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin

XTRA_SERVER_3=http://xtra4.gpsonextra.net/xtra.bin

# enable the agps parsing

DEFAULT_AGPS_ENABLE=TRUE

DEFAULT_USER_PLANE=TRUE

DEFAULT_SSL_ENABLE=FALSE

# we declare the quality we need

QOS_ACCURACY=50

QOS_TIME_OUT_AGPS=95

QOS_TIME_OUT_STANDALONE=80

QosVerticalThreshold=500

QosHorizontalThreshold=1000

# better and faster aGPS

AssistMethodType=1

AgpsUse=1

AgpsServerType=1

AgpsServerIp=3232235555

AgpsMtConf=0

AgpsMtResponseType=1

#Version check for XTRA

#DISABLE = 0

#AUTO = 1

#XTRA2 = 2

#XTRA3 = 3

XTRA_VERSION_CHECK=0

# Error Estimate

# _SET = 1

# _CLEAR = 0

ERR_ESTIMATE=0

#Test before using any of those servers!

#NTP_SERVER=time.gpsonextra.net

# Brazil

NTP_SERVER=br.pool.ntp.org

#Asia

# NTP_SERVER=asia.pool.ntp.org

#Europe

# NTP_SERVER=europe.pool.ntp.org

#North America

# NTP_SERVER=north-america.pool.ntp.org

# DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info

# 4 - Debug, 5 - Verbose

# If DEBUG_LEVEL is commented, Android's logging levels will be used

DEBUG_LEVEL = 2

# Intermediate position report, 1=enable, 0=disable

#INTERMEDIATE_POS=0

INTERMEDIATE_POS=1

# Below bit mask configures how GPS functionalities

# should be locked when user turns off GPS on Settings

# Set bit 0x1 if MO GPS functionalities are to be locked

# Set bit 0x2 if NI GPS functionalities are to be locked

# default - non is locked for backward compatibility

#GPS_LOCK = 0

# supl version 1.0

SUPL_VER=0x10000

# Emergency SUPL, 1=enable, 0=disable

SUPL_ES=1

#Choose PDN for Emergency SUPL

#1 - Use emergency PDN

#0 - Use regular SUPL PDN for Emergency SUPL

USE_EMERGENCY_PDN_FOR_EMERGENCY_SUPL=1

#SUPL_MODE is a bit mask set in config.xml per carrier by default.

#If it is uncommented here, this value will over write the value from

#config.xml.

#MSA=0X2

#MSB=0X1

#SUPL_MODE=

# GPS Capabilities bit mask

# SCHEDULING = 0x01

# MSB = 0x02

# MSA = 0x04

# ON_DEMAND_TIME = 0x10

# GEOFENCE = 0x20

# default = ON_DEMAND_TIME | MSA | MSB | SCHEDULING | GEOFENCE

#CAPABILITIES=0x37

#CAPABILITIES=0x31

# the modem capabilities, using 3G,

# using Glonass via 3G,

# using standalone LG method

CAPABILITIES=0x37

LPP_PROFILE=0

A_GLONASS_POS_PROTOCOL_SELECT=0x2

LGE_GPS_POSITION_MODE=0

# Accuracy threshold for intermediate positions

# less accurate positions are ignored, 0 for passing all positions

# ACCURACY_THRES=5000

ACCURACY_THRES=3000

################################

##### AGPS server settings #####

################################

# FOR SUPL SUPPORT, set the following

# SUPL_HOST=supl.host.com or IP

# SUPL_PORT=1234

# we replace the not working supl.google.com

# with the more geo-friendly nokia

SUPL_HOST=supl.nokia.com

SUPL_PORT=7275

SUPL_NO_SECURE_PORT=3425

SUPL_TLS_HOST=supl.nokia.com

SUPL_SECURE_PORT=7275

SUPL_TLS_CERT=/etc/SuplRootCert

REPORT_POSITION_USE_SUPL_REFLOC=1

# FOR C2K PDE SUPPORT, set the following

# C2K_HOST=c2k.pde.com or IP

# C2K_PORT=1234

# Bitmask of slots that are available

# for write/install to, where 1s indicate writable,

# and the default value is 0 where no slots

# are writable. For example, AGPS_CERT_WRITABLE_MASK

# of b1000001010 makes 3 slots available

# and the remaining 7 slots unwritable.

#AGPS_CERT_WRITABLE_MASK=0

####################################

# LTE Positioning Profile Settings

####################################

# 0: Enable RRLP on LTE(Default)

# 1: Enable LPP_User_Plane on LTE

# 2: Enable LPP_Control_Plane

# 3: Enable both LPP_User_Plane and LPP_Control_Plane

LPP_PROFILE = 0

################################

# EXTRA SETTINGS

################################

# NMEA provider (1=Modem Processor, 0=Application Processor)

NMEA_PROVIDER=1

# Mark if it is a SGLTE target (1=SGLTE, 0=nonSGLTE)

SGLTE_TARGET=0

#indoor

QUIPC_ENABLED=1

##################################################

# Select Positioning Protocol on A-GLONASS system

##################################################

# 0x1: RRC CPlane

# 0x2: RRLP UPlane

# 0x4: LLP Uplane

#A_GLONASS_POS_PROTOCOL_SELECT = 0

#general

PHONE_TYPE=UMTS

CURRENT_CARRIER=common