Position Accuracy is always Position.QUALITY_LAST_KNOWN

Former Member
Former Member
Hi!
In my code:

var gpsinfo = Position.getInfo();
Sys.println("GPS Acc: " + gpsinfo.accuracy);


I'm always getting: "GPS Acc: 1"
I call this code each second.
Testing with Fenix 5 and Forerunner 235 in the street.
It's a bug? thanks
  • Former Member
    Former Member
    Have you enabled location events in your app with continuous tracking, as opposed to one-shot?
  • Have you called enableLocationEvents() to start up GPS? On Some watches, if you do a LOCATION_ONE_SHOT, you'll get LAST_KNOW if it has a location that hasn't gone stale (a few hours), so the Trick there is to have it set to LOCATION_CONTINUOUS, and in the call back, when you get poor, good, etc, call enableLocationEvents() with LOCATION_DISABLE to turn off GPS.
  • Former Member
    Former Member
    Thanks,
    I want the location continuously, whith and withouth enableLocationEvents I have the same result:
    Test 1:

    function onShow() {
    Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(:onPosition));
    ...
    }

    function onPosition(info) {
    Sys.println("GPS Acc: " + info.accuracy);
    ...
    }


    Result: "GPS Acc: 1"

    Test 2: Like in the documentation https://developer.garmin.com/downloa...nstance_method
    I'm retrieving the current position info periodically withouth enableLocationEvents.

    function onShow() {
    myTimer = new Timer.Timer();
    myTimer.start(method(:timerCallback), 1000, true);
    }

    function timerCallback() {
    if(Toybox has :Position)
    {
    var gpsinfo = Position.getInfo();

    Sys.println("GPS Acc: " + gpsinfo.accuracy);
    ...

    }


    The result is the same
  • What type of app? I wouldn't do this in onShow() as that can be called multiple times. I normally do it in initialize(0 for the view.

    Unless you call enableLocationEvents(), GPS won't be turned on, and all you will see is last.

    With test1, onPostion will be called every second.

    update:

    Oh, wait. Is this in a the sim? Are you using Simulation with a .fit or Simulated Data?
  • have you tried the Position Sample in the SDK?
  • Former Member
    Former Member
    Thank you Jim,

    using:
    Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(onPosition) on the init()

    The app working in Forerunner 235 but not in Fenix 5. I will continue investigating to see what happens.

    App type="watch-app".

    I don't understand the last question: "have you tried the Position Sample in the SDK?"

  • There a sample in the SDK samples directory that fires up GPS - the Position Sample.

    How long are you waiting on the f5? Needless to say you have to be in a place where you can get GPS, but even then it can take a while at times. Start something like the native Run, wait for a GPS fix (the green circle), exit run, and try your app. It's likely something like this, as I have a few watch-apps that use GPS and have supported the f5 since it came out.. In fact, if you want to try one Hike2 displays the state as it's waiting to get GPS, and can move from none, to last, to poor, to "Press Start!" (when the gps is good.)
  • Former Member
    Former Member
    I have seen the sample and my app is ok, thanks.

    I'm waiting for minutes, and I have tested to start native run and then start my app and always get GPS accuracy = 1. But only in Fenix 5. To get accuracy QUALITY_USABLE or QUALITY_GOOD I have to wait 10 minutes or more with my app or with Hike2 (good app). With forerunner 235, I get QUALITY_GOOD in seconds with my app and your app.
    I think the problem is with the Fenix5, like in this post: https://forums.garmin.com/forum/on-the-trail/wrist-worn/fenix-5-5s/1240496-why-is-garmin-ignoring-the-gps-issue
    I leave the topic closed, I think the problem is from Fenix 5, I'll wait for firmware updates to see if they improve this.
    Thank you so much for your help!!
  • The thread seems to be more that users are seeing a track that's off, vs having trouble getting a green GPS (in the native apps).

    On the f5, if you go to settings>about and hit down, on the last screen, what does it say for EPO? (it should be "current"). If not, sync your watch. With my f5 and Hike2, sitting inside, I get a good GPS in maybe 15 seconds. (I'm on the 8.00 FW).

    Have you tried booting the watch? You can first try a simple off/on, but you may want to try a reboot - hold the light button for 15-20 seconds - until the watch turns itself off. And then turn it back on (this is NOT a reset, so you shouldn't lose anything)