Elevation in watchface

Former Member
Former Member

Hi all,

I developed watch face called Hiker's Watch. The idea is to display recent elevation history in the background:

https://apps.garmin.com/en-US/apps/7f4bdd74-f45a-48ed-9aa1-4b3269534828

However, it turns out for some devices it does not work well. Instead of displaying altitude history, it shows a horizontal line only. It is not an issue of the application, because the same version of the app works on some devices while it doesn't on others. I am using the Toybox.Position.Info.altitude attribute to read current elevation.

The watch face does have all the necessary permissions activated (Positioning and Sensor History for question 3) below).

Questions:

1) Is there a way how to activate the elevation field updates? On my garmin fenix3, it generally works, but there were a few ocassion when it froze and displayed constant altitude (i.e. horizontal line only). To me it happens like once a year, but some users reported this behavior just after installing the watch face.

2) How does the altitude attribute behave for watches without a barometer? I tested it successfully on fenix3 and fenix5, but I am now trying it on vivoactive4 and it displays horizontal line only. It seems that it simply shows altitude from the last GPS location update.

3) Can this be resolved by sensor history (Toybox.SensorHistory)? How often get these values updated? I displayed the recent three values from elevation history, it seems that it adds a record into sensor history every minute, but the altitude is always null. Any hints or documentation on how this works?

I will appreciate your hints. The watch face does work for me, but some of my friends are experiencing the described issues and I would like to make it work them as well.

Adam

  • What watches isn't it working on?  My guess is watches without a baro altimer, like the venu sq, fr245, fr 23x/630/735.  There's no fix.  Without a baro altimeter, the info isn't available.

    The va4 has a baro - are you waiting long enough to see if it changes?  Have you used GPS to calibrate the altimeter?

  • Former Member
    0 Former Member over 4 years ago in reply to jim_m_58

      I have been testing it for several days now. Just now, I came back from a two-hour hike. During the walk, I started an activity several times (a short run) and that is exactly the moments when the altitude changed. Besides these moments, it is flat as you can see in the screenshot.

  • Have you tried using SensorHistory.getElevationHistory? As far as how often, you can tell (on a watch, not the sim) by comparing the "when" of two adjacent samples, but it's probably every 2 minutes or so with a total number of samples of about 4 hours..

    Ok, I just tried one of my widgets on a va4, and the elevation history looks to be flat there too, though the watch has been sitting on my desk today. I'll wear it for a while to see if things change.  

    apps.garmin.com/.../fdecbeaf-7d99-45e4-80e5-b5f9c2e92365

    On other watches with a baro, things look fine.  I'm thinking it's a FW bug.  What other devices have you seen with a flatline?

  • Former Member
    0 Former Member over 4 years ago in reply to jim_m_58

    Yes, I am trying SensorHistory.getElevationHistory as well. It gets updated every two minutes and it also gives flat values on the vivoactive4 watch.

    List of devices:

    • fenix3 - works well
    • fenix5 - tested positively on one device; other device was showing flat line initially, but then started to display current altitude (after a day or so; did not found out what was the trigger)
    • fenix6 - a user recently reported that he gets a flat line after installation
    • vivoactive4 - testing in progress for a few days now. shows flat line

    To me is seems as if the barometric correction of current altitude needed to be somehow activated.

  • for the devices that have a native elevation widget (the f5 and f6 - not sure about the f3) what do they show?

  • Former Member
    0 Former Member over 4 years ago in reply to jim_m_58

    I do not have f5 or f6, so I can't test. But thank you for the hint, next time I get it reported on these devices, I will ask.

    However, I did some progress with testing on the vivoactive4 device.

    The flat line and the current altitude (big number on top) are based on Toybox.Position.Info.altitude. The three lines down below are the three latest records from Toybox.SensorHistory.getElevationHistory. It seems that Toybox.Position.Info.altitude shows the altitude based on the last GPS location update. On the other hand, the elevation history is being updated continuously (every two minutes in my case).

    That might mean that the barometric correction only applies to elevation history. I am going to change the watch face to prefer elevation history over Position.Info.altitude and see if it works.

  • Former Member
    0 Former Member over 4 years ago in reply to Former Member

    Hi,

    for anybody who might be struggling with the same issue. All my tests confirmed the hypothesis from my previous post. I have modified the watch to take current altitude from Toybox.SensorHistory.getElevationHistory instead of Position.Info.altitude and it does work.

    I have tested it on a vivoactive4. If you test it on other decices, please share your conclusions.

    The updated watch face is available in the garmin store: apps.garmin.com/.../7f4bdd74-f45a-48ed-9aa1-4b3269534828