Ambient pressure and pressure history don't match

Hey all, does anyone know what pressure the pressure history is storing? I have tested with putting both on screen and my ambient pressure is always higher than my max pressure history (over last 30 mins) so what is this doing?

If I look at my watch now it shows PH getMax to be 101833 and my AP now to be 102996. The PH never been above 101... if I put it in water (20cm) the AP goes up to 104888 which shows AP sensor is moving but PH never changes or goes near it.

Any insights would be great as I am trying to see historical pressure history to make a "guess" on no fly time for diving.

Many thanks,

Ben

  • I'm not sure how SH.getPressureHistory deals with being under water.  If I recall it's MSL pressure.  Also, how often it's saved likely varies by device, where you can find the interval by comparing "when" in two adjacent samples.

    And getting Sensor.Info.pressure can vary from what you see in Activity.Info.ambientPressure/Activity.Info.rawAmbientPressure

  • Ahh fiddle sticks... MSL pressure is of no use to me and that explains why it doesn't seem to change in the history even when submerged in water for 10 minutes. Must also be adjusting for depth of water (as this is the MK2 so has a depth sensor but cannot access it through CIQ I don't think?)

    Basically, doesn't look like I can do what I want so will have to use the standard Garmin faces when diving and custom one when not :( 

    Thanks for the info Jim, appreciate it!

  • Actually stupid question, could I not just get raw and store date and time in a variable and do it that way..? The code doesn't reset each refresh does it? That would work I think :) 

  • Actually that won't work as the WF has to be active to measure anything which it won't during a dive. 

    Also, Jim, does the memory/variables reset when you navigate away from the WF and back to it do you know? Thanks again.

  • Yes, you can build your own list of data and time. You might be able to do it in the main app, but you can also use a background service to take a reading every X minutes.  In either case, you'll want to store the data using Application.Storage.  You have to handle missing data.

    I just saw your new post, but with a background process you can probably run the background while doing a dive.

  • Interesting, will look into that. Don't want to lag or run battery down for this so will see what performance is like on it :) 

    Thanks again for the info! :)

  • Here's a widget I did that does a graph of temperature using a background process.  In general, the way it works is I save up to 96 samples with a time stamp.  For a 4hr graph, the background runs every 4 minutes, but for a 48hr graph, every 30 minutes.  Try it on your next dive.  For missing readings, you'll see a pink mark under the graph.

    https://apps.garmin.com/en-US/apps/1af9fb3b-7f21-4f55-b4c3-0b946476a2ad

    The background in this is actually pretty minor, with the heavy lifting done in the widget itself.

  • Great, thanks. Will have a look at running background processes and see if that can work. Out of curiosity, why wouldn't you use temperature history for this or was it more of an experiment to see if it worked? (also this is a default widget isn't it or did you make it before that became standard?)

    Thanks again Jim, you seem to be the fountain of knowledge on these forums because the Garmin library docs are terrible! :) hehe

  • SH.getTemperatureHistory only provides about 4hrs of data, and I wanted to allow for a couple days of data, so I did my own caching.  And this doesn't require the widget itself to be run on a regular basis.

  • Ah of course, mine does say last 4 hours to be fair. Cool, will give this a go :) 

    Found a blog post you referenced 3 years ago but it is broken :( I cannot find any examples but is it a case of using a registerForTemporalEvent and setting it every say 10 minutes and then adding data to the Application.Storage? That how this would work? Sorry for all the Q's but I work better off examples and cannot find any I understand and this monkey C is pretty new to me Slight smile

    Thanks again