Author Topic: How can I enable A-GPS on my Peak?  (Read 6834 times)

Offline ruk

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 5
  • Posts: 18
  • Karma: 3
    • View Profile
    • ruk.ca
How can I enable A-GPS on my Peak?
« on: June 18, 2013, 05:52:16 AM »
My Peak takes 5-10 minutes to get a GPS lock.

From the presence of A-GPS settings in the Setting app, I assume there is the potential to cut this dramatically if A-GPS is enabled.

By default under Settings > Cellular & Data > A-GPS settings are set to the same settings as appear under Settings > Cellular & Data > Data settings, which, in my case, is simply the APN.

Do I need to set something else? I know that on other devices there's a need to set a "positioning server" address (something like supl.google.com or sup.nokia.com): is there someplace this needs to be set in Firefox OS?

(Or is it possible that A-GPS simply isn't working yet?)

Offline ruk

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 5
  • Posts: 18
  • Karma: 3
    • View Profile
    • ruk.ca
Re: How can I enable A-GPS on my Peak?
« Reply #1 on: June 18, 2013, 06:08:14 AM »
Okay, further research as revealed, in the b2g source tree, a file device/geeksphone/peak/gps.conf containing, in part:

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

# FOR SUPL SUPPORT, set the following
# SUPL_HOST=supl.host.com or IP
# SUPL_PORT=1234

SUPL_HOST=supl.google.com
SUPL_PORT=7276 


So it looks like the value of the "positioning server" is being hard-coded to Google's (supl.google.com).

The question remains, however, as to whether this is actually being used to assist Firefox OS in obtaining its GPS lock faster. Anyone know the answer to that?

Offline ruk

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 5
  • Posts: 18
  • Karma: 3
    • View Profile
    • ruk.ca
Re: How can I enable A-GPS on my Peak?
« Reply #2 on: June 18, 2013, 06:51:07 AM »
Some more research, after running adb logcat while my Peak is attempting to get a GPS fix, reveals:

E/LocSvc_eng(  118): V/creating msg LOC_ENG_MSG_SET_SERVER_URL
E/LocSvc_eng(  118): V/creating msg ox20b
E/LocSvc_eng(  118): V/url: supl.izatcloud.net:22024


Suggesting that the device is, rather than using the value in gps.conf (see above), is using the positioning server at supl.izatcloud.net.

This setting seems to come from gaia/profile/defaults/pref/user.js:

pref("geo.gps.supl_server", "supl.izatcloud.net");
pref("geo.gps.supl_port", 22024);


But there doesn't appear to be any way of setting this via the UI at present.

Offline luis.cuervo

  • Administrator
  • Top Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 64
  • Posts: 816
  • Karma: 114
    • View Profile
Re: How can I enable A-GPS on my Peak?
« Reply #3 on: June 18, 2013, 07:11:47 AM »
All is correct.
By now there is no way to change this value (there is a way in Android???) by UI.

You can change it by adb to a valid one, of course.

By default and if you have a correct value in a-gps data configuration, a-gps is on.


Offline ruk

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 5
  • Posts: 18
  • Karma: 3
    • View Profile
    • ruk.ca
Re: How can I enable A-GPS on my Peak?
« Reply #4 on: June 18, 2013, 07:23:00 AM »
Following https://bugzilla.mozilla.org/show_bug.cgi?id=871072 I set the A-GPS server to test.supl.svc.ovi.com, via user.js, and pushed this to the Peak via adb:

pref("geo.gps.supl_server", "test.supl.svc.ovi.com");
pref("geo.gps.supl_port", 7276);


When I run adb logcat when the Peak is trying to get a fix, here's what I see, in part:

E/LocSvc_eng(  116): V/creating msg LOC_ENG_MSG_SET_SERVER_URL
E/LocSvc_eng(  116): V/creating msg ox20b
E/LocSvc_eng(  116): V/url: test.supl.svc.ovi.com:7276
E/LocSvc_utils_q(  116): D/msg_q_snd: Sending message with handle = 0x48788800
E/LocSvc_utils_ll(  116): D/linked_list_add: Adding to list data_obj = 0x48788800
E/LocSvc_utils_q(  116): D/msg_q_snd: Finished Sending message with handle = 0x48788800
E/LocSvc_utils_ll(  116): D/linked_list_remove: Removing from list
E/LocSvc_utils_q(  116): D/msg_q_rcv: Received message 0x48788800 rv = 0
E/LocSvc_eng(  116): D/void loc_eng_deferred_action_thread(void*):1314] received msg_id = LOC_ENG_MSG_SET_SERVER_URL context = 0x48103c70
E/LocSvc_adapter(  116): D/loc_eng_set_server, addr = test.supl.svc.ovi.com:7276
E/LocSvc_api_rpc_glue(  116): V/Entering loc_ioctl line 473
E/LocSvc_api_rpc_glue(  116): I/---> loc_ioctl line 557 RPC_LOC_IOCTL_SET_UMTS_SLP_SERVER_ADDR
E/LocSvc_eng(  116): V/Exiting int loc_eng_set_server(loc_eng_data_s_type&, LocServerType, const char*, int) line 1063 0
E/LocSvc_eng(  116): V/Exiting int loc_eng_set_server_proxy(loc_eng_data_s_type&, LocServerType, const char*, int) line 1117 0
E/LocSvc_afw(  116): V/Exiting int loc_agps_set_server(AGpsType, const char*, int) line 789 0
E/LocSvc_afw(  116): V/Entering int loc_set_position_mode(GpsPositionMode, GpsPositionRecurrence, uint32_t, uint32_t, uint32_t) line 460
E/LocSvc_eng(  116): I/===> int loc_eng_set_position_mode(loc_eng_data_s_type&, LocPosMode&) line 621
E/LocSvc_eng(  116): V/creating msg LOC_ENG_MSG_SET_POSITION_MODE
E/LocSvc_eng(  116): V/creating msg ox205
E/LocSvc_eng(  116): V/Position mode: LOC_POSITION_MODE_MS_BASED
E/LocSvc_eng(  116):   Position recurrence: GPS_POSITION_RECURRENCE_PERIODIC
E/LocSvc_eng(  116):   min interval: 1000
E/LocSvc_eng(  116):   preferred accuracy: 0
E/LocSvc_eng(  116):   preferred time: 0
E/LocSvc_eng(  116):   credentials:   provider:


It's not clear to me whether this means that the A-GPS was initiated or not; an amateur reading of the log suggests that perhaps it's not?

Offline ruk

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 5
  • Posts: 18
  • Karma: 3
    • View Profile
    • ruk.ca
Re: How can I enable A-GPS on my Peak?
« Reply #5 on: June 18, 2013, 08:56:02 AM »
Success! By changing the positioning server I was able to get the GPS time-to-first-position down from 10-12 minutes to about 10 seconds.

What I did was:

adb pull /system/b2g/defaults/pref/user.js

then edited user.js with a text editor, replacing:

pref("geo.gps.supl_server", "supl.izatcloud.net");
pref("geo.gps.supl_port", 22024);


with:

pref("geo.gps.supl_server", "test.supl.svc.ovi.com");
pref("geo.gps.supl_port", 7276);


and, finally:

adb remount
adb push user.js /system/b2g/defaults/pref/user.js
adb reboot
« Last Edit: August 18, 2013, 03:24:34 PM by ruk »

Follow members gave a thank to your post:


Offline Rodrigo (gp)

  • Administrator
  • Top Member
  • *****
  • Thank You
  • -Given: 3
  • -Receive: 21
  • Posts: 2050
  • Karma: 20
    • View Profile
Re: How can I enable A-GPS on my Peak?
« Reply #6 on: June 19, 2013, 02:13:56 AM »
Thanks Ruk, it's brillant.... ;)

Offline luis.cuervo

  • Administrator
  • Top Member
  • *****
  • Thank You
  • -Given: 11
  • -Receive: 64
  • Posts: 816
  • Karma: 114
    • View Profile
Re: How can I enable A-GPS on my Peak?
« Reply #7 on: June 19, 2013, 02:57:06 AM »
We share this info with Mozilla, because they are the one that indicates this server.

Thanks

Offline bstecklu

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 39
  • Karma: 1
    • View Profile
Re: How can I enable A-GPS on my Peak?
« Reply #8 on: June 20, 2013, 01:18:56 AM »
Apart from modifying the user preferences this way which is nice, I did not notice any improvement. First of all, the change seems to revert the bugzilla patch which was brought up for good reason, I guess. Moreover, depending on the routing, the access time for both geo.gps.supl servers can vary a lot. So the delay might be a network routing issue rather than one of the OS. However, a better solution would be to specify a few geo.gps.supl servers, and use the one with the smallest ping time.

Offline ndesaulniers

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
  • Karma: 0
    • View Profile
Re: How can I enable A-GPS on my Peak?
« Reply #9 on: July 10, 2013, 01:25:58 PM »
Probably because someone has to pay for running an AGPS server.  It's the same thing as NTP vandalism by using someone else's AGPS server when you're not licensed to do so.  See http://en.wikipedia.org/wiki/NTP_vandalism

my68_

  • Guest
Re: How can I enable A-GPS on my Peak?
« Reply #10 on: July 16, 2013, 10:22:47 AM »
...

SUPL_HOST=supl.google.com
SUPL_PORT=7276  [/tt]

So it looks like the value of the "positioning server" is being hard-coded to Google's (supl.google.com).

...

Wow, I buy a phone with a free OS and it is connected to N S A via gugl? Who had such a !ä*+ idea?

Offline torgo

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
  • Karma: 0
    • View Profile
    • Telefónica Digital Hub
Re: How can I enable A-GPS on my Peak?
« Reply #11 on: July 24, 2013, 06:52:49 AM »
So this is not working for me on the Keon with v1.1 installed. The process described of editing user.js seems to work fine, and the service at test.supl.svc.ovi.com is responding on port 7276 but I see no change in behavour when trying to visit http://html5demos.com/geo - basically it fails to load anything. Can others on the Keon with v1.1 confirm that this works? (BTW as I understand it this can only be a short-term fix as this is making use of an unlicensed -and self-described test- supl server, but it would be good to be able to at least verify that this functionality works - especially for developers who are trying to build their own Geo-enabled applications).  Thanks!  Dan