1. Toybox.Sensor.Info
   URL: https://developer.garmin.com/connect-iq/api-docs/Toybox/Sensor/Info.html
   Toybox.Sensor.Info

# Class: Toybox.Sensor.Info

Inherits: Toybox.Lang.Object

Toybox.Lang.Object

Toybox.Sensor.Info

show all

## Overview

The Sensor.Info class contains all of the information provided by enabled sensors.

Sensor.Info can be retrieved on every call of onUpdate() or it can be obtained on demand. Fields in this class may return`null` so should be checked for`null` values prior to use.

## Instance Member Summary collapse

accel as Lang.Array< Lang.Number> or Null

The accelerometer reading of the x, y, and z axes as an Array of Number values in millig-units.

altitude as Lang.Float or Null

The altitude above mean sea level in meters (m).

cadence as Lang.Number or Null

The cadence in revolutions per minute (rpm).

heading as Lang.Float or Null

The true north referenced heading in radians.

heartRate as Lang.Number or Null

The heart rate in beats per minute (bpm).

mag as Lang.Array< Lang.Number> or Null

The magnetometer reading of the x, y, and z axes as an Array of Number values in milliGauss (mG).

oxygenSaturation as Lang.Number or Null

The current oxygen saturation in percent (%).

power as Lang.Number or Null

The power in Watts (W).

pressure as Lang.Float or Null

The barometric pressure in Pascals (Pa).

speed as Lang.Float or Null

The speed in meters per second (m/s).

temperature as Lang.Float or Null

The temperature in degrees Celsius (C).

## Instance Attribute Details

### var accel as Lang.Array<Lang.Number> or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Array.html https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The accelerometer reading of the x, y, and z axes as an Array of Number values in millig-units.

### var altitude as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The altitude above mean sea level in meters (m).

Elevation is derived from the most accurate source: Barometer or GPS in order of descending accuracy. If no GPS is present, then barometer readings will be used.

### var cadence as Lang.Number or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The cadence in revolutions per minute (rpm).

Cadence is derived from (in order of priority):

Bike sensors (cadence or speed must be enabled)

Advanced running dynamics sensors (e.g. heart strap with running dynamics enabled)

Foot pod

Watch-based cadence calculations

### var heading as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The true north referenced heading in radians.

This provides compass orientation if it is supported by the device.

### var heartRate as Lang.Number or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The heart rate in beats per minute (bpm).

### var mag as Lang.Array<Lang.Number> or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Array.html https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The magnetometer reading of the x, y, and z axes as an Array of Number values in milliGauss (mG).

### var oxygenSaturation as Lang.Number or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The current oxygen saturation in percent (%)

### var power as Lang.Number or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The power in Watts (W).

### var pressure as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The barometric pressure in Pascals (Pa).

This returns barometric pressure calibrated to sea level. Since pressure varies dues to several factors, a GPS-based altitude must first be obtained, then the ambient (local) pressure is measured by the pressure sensor before conversion to a calibrated barometric pressure value.

### var speed as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The speed in meters per second (m/s).

### var temperature as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The temperature in degrees Celsius (C).

---

Generated Jun 8, 2026, 3:42:17 PM

2. Watch face pressure data - any way at all? CIQ v1.x (in this case Fenix 3 HR) - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/6690/watch-face-pressure-data---any-way-at-all-ciq-v1-x-in-this-case-fenix-3-hr/44764
   Watch face pressure data - any way at all? CIQ v1.x (in this case Fenix 3 HR) - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 3 replies
- Subscribers 16 subscribers
- Views 338 views
- Users 0 members are here

Options

Related

# Watch face pressure data - any way at all? CIQ v1.x (in this case Fenix 3 HR)

I’m writing a watch face for v1.x watches (I own a F3HR) and I would really like to have pressure data usable on the face. Has anyone found any way at all of implementing this? I’m open to hacks, workarounds, low quality options, ambient or sea level pressure (I can convert from one to the other using altitude as a variable). I’ve attempted to scour this forum for ideas. Sensor and SensorHistory both come back with a no permission type warning In the simulator, and Activity.Info doesn’t seem to contain pressure values in v1.x? I was even thinking of having a widget populate the value into the object store and then the face could go get it? Is that even feasible?Thanks in advance - any help would be greatly appreciated!

- Sign in to reply
- Cancel

> I’ve attempted to scour this forum for ideas. Sensor and SensorHistory both come back with a no permission type warning In the simulator, and Activity.Info doesn’t seem to contain pressure values in v1.x? I was even thinking of having a widget populate the value into the object store and then the face could go get it? Is that even feasible?

Actually, Sensor can't be used in watch faces, and SensorHistory can, but only on watches that support it (and they are all CIQ 2.x or greater). There's no way for a widget and WF to share an object store. Activity.Info has ambient,rawAmbient, and meanSeaLevel pressure, but only on devices with a baro altimeter and have CIQ 2.4.x or greater.So, in other words, you can't show pressure in a WF on a f3hr.

Ok thanks Jim. I’ve been reading a ton of your posts - I was secretly hoping to get a reply from you as you seem to know this stuff inside out :)i guess I’ll code this as an optional parameter if the device has 2.x

For things that may not be available on all devices (like this), and if that value is selected, I'll either ignore that field, or display something like N.A. (not available). SensorHistory or the new things in Activity.Info for pressure would be the way to go, and you can either do that check at compile time based on the target, or runtime using "has".

3. fēnix 3/HR - Calibrating the Barometric Altimeter
   URL: https://www8.garmin.com/manuals/webhelp/fenix3/EN-US/GUID-BC734846-01A7-4F33-86D4-DFBDBC06CDB4.html
   fēnix 3/HR - Calibrating the Barometric Altimeter

Calibrating the Barometric Altimeter

# Calibrating the Barometric Altimeter

Your device was already calibrated at the factory, and the device uses automatic calibration at your GPS starting point by default. You can manually calibrate the barometric altimeter if you know the correct elevation.

Select an option:

To calibrate automatically from your GPS starting point, select Auto Cal. > On.

To enter the current elevation, select Calibrate.

GUID-4FFB52AE-9CA9-47F5-B9E6-45D823872585 v7

4. Barometric pressure data useless - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/5343/barometric-pressure-data-useless
   Barometric pressure data useless - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 20 replies
- Subscribers 15 subscribers
- Views 7836 views
- Users 0 members are here

Options

Related

# Barometric pressure data useless

Hi all, I'm playing around a bit with some sensor data on my Fenix 5. However, it seems to me that the sensor data the pressure sensor is returning is just not really helpful. According to the API it "returns barometric pressure calibrated to sea level" but as a user I'm way more interested in the absolute barometric pressure the sensor is currently facing. This is also the quantity the sensor is actually able to measure but somehow I don't know (yet!?) how to access the pure measurement data. Why would Garmin measure something just to scramble it and then provide only the 'scrambled' numbers to the developers instead of the real measurement values. Can anyone tell me how I can access the absolute barometric pressure? That would be really helpful! Thanks!

- Sign in to reply
- Cancel

## Top Replies

- Wrong data Calibrating the altimeter does not help me since I'm not interested in the pressure calibrated to sea level. This number is absolute useless for me. I need the absolute barometric pressure…

## All Replies

Measurements are way off... Unfortunatelly what I observed is that barometric preassure presented on the watch is way off from measurement of my weather station (which is correct I'm sure). Station says 1021hPa, while watch: 1065hPa. Hard to say how can you relay on that measurement...

Make sure you calibrate the altimeter. That's used to convert the ambient reading to sea level, and what you see is the sea level pressure. I see reading on the watch that are very close to what my weather station says if it's calibrated.

Wrong data Calibrating the altimeter does not help me since I'm not interested in the pressure calibrated to sea level. This number is absolute useless for me. I need the absolute barometric pressure which is the actual atmospheric pressure present at a certain altitude. If the fenix 5 has a pressure sensor that is also what it will be measuring but I don't know how to get this data. Is there a way to access the "real" absolute pressure data?

Sorry, but I do not think that is exposed to the CIQ interface. Therefore I do not believe there is a way to obtain the true pressure from a CIQ app. This is only available internally and not to CIQ.

https://apps.garmin.com/en-GB/apps/1e896cb8-87ac-4b7a-869f-b1c053fd917d It is possible, but currently only available for Fenix 3 and derivates.

When the f5/5x/fs started shipping, and up until the 3.90 FW on the va-hr, SensorHistory.getPressureHistory() returned the raw pressure, and what I had to do what use that with elevation to convert to MSL pressure, as MSL is what people wanted to see. It's how you can watch for weather changes, etc. If you have the MSL pressure, you could do the inverse with elevation, and come close to getting the "raw" data back.

In Russia you can hear on radio and see in internet only Ambient pressure value. I found almost useless Barometric pressure native widget, only to estimate trend and get alert on fast pressure changes. If we take Barometric pressure, then convert it to Ambient (raw) pressure, we can get error because of temperature and height (P = Po*exp(- μgh/RT) ), unit just estimates height MSL using internal algorithms. Double conversion looks not good. Ambient pressure can be visible only when you start activity. I vote for availability Ambient pressure in CIQ.

> If we take Barometric pressure, then convert it to Ambient (raw) pressure, we can get error because of temperature and height (P = Po*exp(- μgh/RT) ), unit just estimates height MSL using internal algorithms. Double conversion looks not good. Ambient pressure can be visible only when you start activity. I vote for availability Ambient pressure in CIQ.

I agree that converting it forth and back is not what you want to do. But what do you mean with "can be visible only when you start activity". I don't think that makes a difference.

There is a built in data field which can be configured, but is only available during an activity. It is not accessible any other way.

Bad thing that even pressure reported by CIQ does not match the value in the data fields. Data field values match the internal service test menu however. In this menu I can see pressure in mb.

5. Widget: AirPressure - Connect IQ App Showcase - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/showcase/811/widget-airpressure
   Widget: AirPressure - Connect IQ App Showcase - Connect IQ - Garmin Forums

- Replies 17 replies
- Subscribers 4 subscribers
- Views 3746 views
- Users 0 members are here

Options

Related

# Widget: AirPressure

AirPressure WidgetSimple widget displaying the current atmospheric pressure as well as the barometric pressure (air pressure at sea level) and altitude. The Garmin barometer widget only displays the barometric pressure and there is currently no way to display the "raw" (unadjusted) atmospheric pressure on the Fenix 3 except by adding it as a datafield in an activity. This widget corrects this and displays the atmospheric pressure without having to start an activity.The widget is optimized for the Fenix 3. For a similar widget optimized for square watches (e.g. Epix, VivoFit etc.) please check out my AtmosphericPressure widget (https://apps.garmin.com/en-GB/apps/1183288c-4156-4dc2-83e4-dd555b9a22b1).**NOTE** I would have prefered to add a chart of pressure changes over the past 48 hours to the widget (useful for weather predictions) but for the time being Connect IQ API limitations prevent me from doing this (in order to update the chart at a fixed interval - say every 15 mins - I would need to be able to poll the current air pressure even when the widget is not active, something not currently possible with Connect IQ widgets).***CHANGE HISTORY***Changes made from version 1.0 to version 1.1:- added ability to display atmospheric pressure in either mmHg, inHg, milibars or hectopascals (press MENU while inside the widget to change measurement unit)- altitude is now displayed in either meters or feet depending on user settings

- Sign in to reply
- Cancel

Hi, you can add chart to your widget like this - https://apps.garmin.com/en-US/apps/4370b941-4874-41f4-82d1-d10924eb4bfa I mean create and update chart when user open widget. It's no need update him every 15 min in day. I use this widget on 920xt, thanks.

Great !Thanks thebigbadwolf_1 !

Hi, I do not understand this:Baro preassure (in Fenix) showed me 1000 hPa, Alt=340m (after GPS calibration) and this app showed me: Air 744 hPa, Baro 1015,2 alt 340m. How is it going together? Thanx a lot.

Please make it work with ForeAthlete 920XTJ because i using 920xt taiwan and not be able to use it. Thanks

I don't think the Vivoactive has a baro altimeter. How does this work on that device?

great widget, thanks very much.If it is possible, please consider adding a shortcut to altimeter calibration: as it is, the widget uses whatever the current altimeter setting is, which is likely to be wrong (thanks to weather change), rather than the currently calibrated elevation - which may not be available to the widget?

storm alert Hey, i think the great addition to your widget would be the storm alert as you are alraedy normalising for the altitude that would give better alert than garmin default one that you can only use if not moving up and down. Peter

Bug Hi, Experiencing some bug where the barometer pressure on the widget Garmin provided and yours does not tally. Altimeter settings are to auto cal set to continuous Thanks

barometer graph please I would really like a widget showing barometer trends over time in the form of a graph, to assess weather changes. Thanks for your current app, and look forward to further enhancements, Ted

Forerunner XT920 and trend chart for air pressure Is it possible to get this widget als for the forerunner xt920 with a small trend chart (24h) with air pressure values each 1 hour?

6. Altitude GPS  vs. Barometric: How obtain GPS-Altitude (if possible at all) on Fenix 3 - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/617/altitude-gps-vs-barometric-how-obtain-gps-altitude-if-possible-at-all-on-fenix-3
   Altitude GPS vs. Barometric: How obtain GPS-Altitude (if possible at all) on Fenix 3 - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 4 replies
- Subscribers 16 subscribers
- Views 816 views
- Users 0 members are here

Options

- Share
- More
- Cancel

Related

# Altitude GPS vs. Barometric: How obtain GPS-Altitude (if possible at all) on Fenix 3

"Class: Toybox::Position::Info" altitude seems to report on the barometric altitude. Explicit information on that could not be found, but looking at the reported values suggests that strongly.Is there, and if yes, how, a way to obtain the "hard" GPS Altitude? Intention is to implement something like an InFlight-App.Beyond that: The overall impression is, that the F3 UI-wise and SDK-wise hides (or does not expose) all the technical "atrocities" from(to) the user. Another evidence: Satellite View gone from UI, SDK abstracts any technical information down to (just) five "Position.QUALITY_*" values. Coming from a Fenix 1 and a Tactix (98% a Fenix 2), the ability to program the F3 is a outstanding and fantastic asset - but hopes to compensate the differences between those watches by adding own technical functionallity (data fields, apps) are slowly fainting away. The very nature of this watch series has not been upgraded, but rather changed radically. No complaints, just finding out the hard way that non-triathletic-tekkies, car drivers, flight monitoring junkies and the like don't seem to be anymore the target audience of neither this (wonderful) watch nor, for worse, the (cute) SDK. Until being teached otherwise :-) ...

- Sign in to reply
- Cancel

The position module aggregates all available sources behind the scenes, so there isn't a way to isolate the GPS altitude in a Connect IQ app right now. This may be available in the future, but I don't know for certain. I will file a request to have this considered for future connect IQ releases.I can understand why you might feel like the fenix 3 is a step back from the fenix and fenix 2, but I don't see it that way. There has been a definite shift in the product toward refinement and an easier-to-use UI, but the intent isn't to narrow the target audience. In fact, I think we'll end up widening the audience to include people that wouldn't necessarily be interested in the fenix or fenix 2.I think a good parallel might be Apple's MacBook Air. When the first Air came out, it felt a little underwhelming compared to the MacBook Pro--a less powerful processor, fewer ports, no optical drive, much less storage, etc. But now I'd argue that the MacBook Air is the primary MacBook line: it's fast, very capable, and refined, and affordable. Apple appears to be using the same strategy with the newly announced MacBook. It's seems to have a less capable processor, has no traditional ports, and has this new-fangled touch pad. It's more expensive, too. But I think it's a hint at what Apple has in mind for future products, just like the first MacBook Air was.At first glance, the fenix 3 may seem like it's less capable than the previous fenix models. For example, like you mentioned, some items like the satellite view aren't available in the UI now. But you have this beautiful color screen, a better industrial design, and growing possibilities to expand the capabilities of the device with Connect IQ. Developers are already coming up with novel ways to leverage the capabilities we've made available so far to do things like open their garage door with their watch. The potential will keep growing as we expand the features of Connect IQ.I wish I could share more more--Garmin has some exciting things on the horizon, and it's all starting with the Forerunner 920XT, vivoactive, and the fenix 3.

Thank you for this open answer and deep insight. I'm on the Garmin train since Garmin GPS+/II/II+/... and always have been impressed by the passion, perfectionism and technology each the device showed as well as the evolution stream across devices. I've no doubt this will continue, one feels that people at garmin love what they do and use what they sell. The F3 is a masterpice. Encouraged by your words, I'm looking curiously forward to the future of the F3 (and a F3 TEC Edition with "GPS Altitude" and "Array[] getSatelliteData()" and a speed alarm with a value bigger than 160kmH :-) or a F4 then).

Beyond that: Provisioning of more technical data/data field(s) would not taint a potential strategic repositioning. It went, right now, from a sports oriented multi-purpuose-device to a 100% sports enthusiast device in business-look-disguise, from my limited point of view. But yes, I'm now quite OT.

And, with respect to the metaphoric reference to Apple products: Evolved, simplified, ease-of-use, but: They do still Feature a terminal shell/command prompt, a powerful scripting language, all the ls /dev info, full access to all operating system data and functionallity. Mentioned just for reasons of completeness :-)

7. Could an app allow to calibrate Altimeter using Sea Level Pressure? - Third-Party App Ideas - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/app-ideas/4899/could-an-app-allow-to-calibrate-altimeter-using-sea-level-pressure
   Could an app allow to calibrate Altimeter using Sea Level Pressure? - Third-Party App Ideas - Connect IQ - Garmin Forums

- Cancel
- More
- German Forum
- Beta Program
- Developer
- Pilots
- Sports & Fitness
- Outdoor Recreation
- Apps & Software

- Users 0 members are here
- Views 675 views
- Subscribers 12 subscribers
- Replies 2 replies

- pressure
- calibration
- sea
- altimeter

Options

- Cancel
- More
- Share

Related

# Could an app allow to calibrate Altimeter using Sea Level Pressure?

Hi there, Maybe an app could do that? (start the app, enter sea level pressure, that's it: the altimeter is calibrated!!!) Would an app be able to set the current elevation in a Fenix 3 watch? (Equivalent to manual altimeter calibration) This is about a new feature lacking in your Fenix 3 watches and +. IT SHOULD be implemented in Fenix 3 watches and + because: -super useful! -super easy to develop for Garmin! -will work on all Altimeter-Baro watches! To me it is the single most annoying detail missing. I currently use the AirPressure widget (by thebigbadwolf_1)(along with excel) to estimate my altitude from the "sea pressure I get from the Weather station". What I do is 1-Get the SeaP from Weather Info; 2-Get the CurrentAtmP from the AirPressure widget; 3-Calculate the Elevation in Excel; 4-Calibrate Altimeter on the watch. I would love to be able to calibrate my altimeter directly using the "sea pressure I get from the Weather station" (no Excel!!!). The formula is: Elevation = =(288.15/(CurrentAtmP/SeaP)^-0.190266-288.15)/-0.0065 (P in Pascals and Elevation in meters) Thanks! I use to do that all the time on the Core by Suunto... I can send you my excel file, it has the formulas and explanations. The formula is good up to about 10,000m (more than Everest...)

- Cancel
- Sign in to reply

> Would an app be able to set the current elevation in a Fenix 3 watch? (Equivalent to manual altimeter calibration)

No, ConnectIQ doesn't have access to the data needed to do this (no write access to the calibration information).

Thanks Travis Too bad... Thanks Travis for the clear answer !!

8. {Activity,Position,Sensor}.Info :altitude change ? - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/7224/activity-position-sensor-info-altitude-change
   {Activity,Position,Sensor}.Info :altitude change ? - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 3 replies
- Subscribers 15 subscribers
- Views 1345 views
- Users 0 members are here

Options

Related

# {Activity,Position,Sensor}.Info :altitude change ?

Hello,I just updated my D2 Charlie to firmware 5.00 (CIQ 3.0.1).Has anything changed in regards with the :altitude field when accessed through Activity, Position or Sensor.Info ?PS: Maybe the issue at hand was already present in firmware 4.20 (given the known elevation issues raised in the forums), although I pinpoint it only nowWhen I use the Garmin Altimeter Widget, I read a (Calibrated) altitude of, say, 400m.When I use the Garmin FLY App, configured for Pressure Altimeter, I read an altitude identical to the Garmin Altimeter WidgetWhen I use the ConnectIQ GPS Metrics Widget, I read an altitude matching the two former (I don't know what Toyboy source it's using though)When I use my GliderSK App, I read an altitude of 445m, taken from Position.Info :altitude.No going back-and-forth from the aforementioned widgets/apps changes anything.Has anyone experienced the same discrepancy ?Are all three Activity, Position or Sensor.Info :altitude source still supposed to give the same reading, namely "Elevation is derived from the most accurate source: Barometer or GPS in order of descending accuracy. If no GPS is present, then barometer readings will be used" ?Also, when reading about Activity.Info :ambientPressure, I see a mention of "The data is smoothed by a two-stage filter to reduce noise and instantaneous variation".This sounds strangely close to the numerous reports, in the Wrist-Worn section, about Altitude readings being delayed and smoothed.This is obvious in one of my activity: https://connect.garmin.com/modern/activity/2900207608; enlarging the elevation graph and looking closely at time 1:35:30, one can see the altitude reading obviously switched from one "mode" to another.Do you ConnectIQ guys would see some explanation to that change ?Regards

- Sign in to reply
- Cancel

Took the time to add some debug statements (in Sensor.enableSensorEvents and Position.enableLocationEvents callbacks); app compiled with SDK 2.4.9:

> [app start; waiting for GPS]DEBUG: (Sensor.Info) altitude = 417.529785DEBUG: (Sensor.Info) altitude = 417.529785DEBUG: (Sensor.Info) altitude = 417.567108DEBUG: (Sensor.Info) altitude = 417.679077DEBUG: (Sensor.Info) altitude = 417.800385DEBUG: (Sensor.Info) altitude = 417.856384DEBUG: (Sensor.Info) altitude = 417.921692DEBUG: (Sensor.Info) altitude = 417.949677DEBUG: (Sensor.Info) altitude = 417.996338DEBUG: (Sensor.Info) altitude = 418.108307DEBUG: (Sensor.Info) altitude = 418.238922DEBUG: (Sensor.Info) altitude = 418.192261DEBUG: (Sensor.Info) altitude = 418.126953[GPS signal acquired]DEBUG: (Position.Info) altitude = 491.736786DEBUG: (Sensor.Info) altitude = 417.931030DEBUG: (Position.Info) altitude = 477.134277DEBUG: (Sensor.Info) altitude = 417.940338DEBUG: (Position.Info) altitude = 471.339905DEBUG: (Sensor.Info) altitude = 417.959015[about 1 min. later]DEBUG: (Sensor.Info) altitude = 419.004059DEBUG: (Position.Info) altitude = 479.737518DEBUG: (Position.Info) altitude = 479.933472DEBUG: (Sensor.Info) altitude = 419.022705DEBUG: (Sensor.Info) altitude = 419.125336DEBUG: (Position.Info) altitude = 479.933472

The results speak for themselves.PS: Sensor.Info returns the Altimeter Widget altitude (Calibrated, based on known correct altitude). I don't know what Position.Info returns, but it's way off. Even weirder, when one "Use GPS" to Calibrate the Altimeter Widget, altitude is not that of Position.Info (which one could expect to be the GPS altitude, given it's clearly not the barometric elevation)Having this cleared out and the documentation updated would help.

For those interested, attached the plotted data resulting from Position, Sensor and Activity altitude and pressure data, captured using my RawLogger application (https://github.com/cedric-dufour/connectiq-app-rawlogger; hopefully soon to be published in the Garmin Store) and extracted from the FIT file using the FIT SDK. The "EnhancedAltitude" field is the altitude as recorded by default by Garmin into any FIT file (independently for any additional "FitContributed" fields).Again, this is taken from my D2 Charlie running FW 5.0.0, CIQ 3.0.1. There was no difference between Position and Sensor/Activity data when running FW 4.2.0 / CIQ 2.4.x.This can also witnessed in the simulator, using SDK 3.0.1 or SDK 2.4.9. community.garmin.com/.../1396982.png

Hypothesis 1: Position.Info.altitude now is GPS height (WGS84 ellipsoid model), *non* corrected for the actual geoid undulation (which is about ~50m at my location, according to EGM96).

Toybox.Sensor.Info


I now have enough evidence to answer the user's question properly. The key findings:

1. **fēnix 3 has a barometer and exposes pressure**, but the pressure exposed via `Sensor.Info.pressure` is **sea-level calibrated** (barometric pressure), not raw ambient pressure.
2. The fēnix 3 stock data fields include **"Ambient Press." (uncalibrated ambient pressure)** and **"Baro. Pressure" (calibrated pressure)** per the Garmin manual.
3. However, **Connect IQ API 1.4 on fēnix 3 does NOT expose raw ambient pressure** to third-party apps. The only pressure value available in CIQ API 1.4 is `Sensor.Info.pressure`, which is sea-level calibrated.
4. The `rawAmbientPressure` and `ambientPressure` fields in `Activity.Info` were introduced in **API Level 2.4.0**, which fēnix 3 does not support (max API 1.4.0).
5. The "Ambient Press." data field that exists on fēnix 3 is a Garmin native data field, not available through Connect IQ API.

So the correct nuanced answer is:
- The fēnix 3 **does measure ambient pressure** at the hardware/sensor level.
- The fēnix 3 **does display ambient pressure** in its native "Ambient Press." data field.
- However, a **Connect IQ app on fēnix 3 cannot access raw ambient pressure** because the CIQ API only exposes sea-level-calibrated pressure.

I need to produce a structured implementation plan following the requested format:
1. Goal
2. Constraints
3. Approach
4. Steps
5. Verification
6. Risks & Rollbacks
7. Open Questions

The plan should address: how to verify whether fēnix 3 can measure ambient pressure and what it means for the app.

I should not write implementation code yet, only the plan.</think>## Research Summary Before the Plan

Yes, the **fēnix 3 does measure ambient pressure at the hardware level**, and the stock watch even has a native data field called **“Ambient Press.”** (uncalibrated ambient pressure) plus “Baro. Pressure” (calibrated to sea level).

However, the critical point for our app is: **a third-party Connect IQ app on the fēnix 3 cannot access raw ambient pressure.** The fēnix 3 runs Connect IQ API Level 1.4.0, and that API only exposes:

- `Sensor.Info.pressure` — **sea-level-calibrated barometric pressure**
- `Sensor.Info.altitude` — altitude derived from barometer/GPS

The raw ambient pressure fields (`Activity.Info.ambientPressure` and `Activity.Info.rawAmbientPressure`) were introduced in **API Level 2.4.0**, which the fēnix 3 does **not** support.

So the answer is nuanced: the sensor measures ambient pressure, but the **Connect IQ API we must use hides the raw value**, making reliable depth computation impossible in a CIQ app.

---

## Structured Implementation Plan: Verify fēnix 3 Ambient-Pressure Accessibility for a CIQ App

### 1. Goal

Determine, with evidence, whether a personal Connect IQ app running on the **Garmin fēnix 3 / fēnix 3 HR** can read **raw ambient barometric pressure** accurately enough to compute depth for freediving/snorkeling, and decide whether the existing breath-hold app should be extended with a depth mode or remain depthless.

### 2. Constraints

- Target hardware: **fēnix 3** and **fēnix 3 HR** only.
- Connect IQ version cap: **API Level 1.4.0** on these devices.
- Existing codebase: `~/code/garmin-freedive-app/` — a Watch App with `Sensor`, `ActivityRecording`, and `FitContributor` permissions; currently breath-hold only.
- No store submission; sideloaded personal app.
- Must not break the existing breath-hold functionality during investigation.
- Must respect that “ambient pressure measured by the sensor” ≠ “ambient pressure exposed to CIQ apps.”

### 3. Approach

Use a **two-layer verification**:

1. **API/documentation layer** — confirm which pressure fields are available at API 1.4.0 vs. 2.4.0+ and which devices support them.
2. **Empirical layer** — build a small diagnostic CIQ app for the fēnix 3 that logs `Sensor.Info.pressure`, `Sensor.Info.altitude`, and any other pressure-related values, then test it in air and in shallow water to see what actually changes and how.

Compare the logged values against:
- The watch’s own **“Ambient Press.”** native data field.
- A known reference (pool depth, measuring tape, or another dive computer).
- Expected physics: ~100 kPa increase per 10 m of water ≈ 10 kPa/m.

If the CIQ-exposed pressure is sea-level calibrated and/or auto-corrects back to surface pressure, depth derivation is unreliable and the app stays breath-hold only. If the CIQ value tracks hydrostatic pressure linearly and immediately, a shallow-depth mode may be feasible.

### 4. Steps

#### Step 1 — Audit API availability on fēnix 3

1.1 Open the project’s `manifest.xml` and note `minApiLevel="1.4.0"` and product IDs `fenix3` / `fenix3_hr`.
1.2 Check the Connect IQ API docs for `Toybox.Sensor.Info.pressure` and `Toybox.Activity.Info.*` at API 1.4.0.
1.3 Confirm that `rawAmbientPressure`, `ambientPressure`, and `meanSeaLevelPressure` are **since API 2.4.0**.
1.4 Confirm that `Sensor.Info.pressure` at API 1.0.0 is documented as “barometric pressure calibrated to sea level.”

**Verification:** Screenshot or quote the relevant API doc sections and the fēnix 3 device compatibility matrix (API Level 1.4).

---

#### Step 2 — Create a pressure-probe branch

2.1 Create a new Git branch (or copy) of the existing app named `pressure-probe`.
2.2 Replace the breath-hold UI with a simple diagnostic view that shows:
- `Sensor.Info.pressure`
- `Sensor.Info.altitude`
- `Sensor.Info.temperature`
- Computed `deltaP` since a “calibrate” button press
- Computed depth using fresh/salt water density
2.3 Add buttons:
- **START** = capture current pressure as surface reference
- **UP/DOWN** = cycle display pages
- **BACK** = exit

**Verification:** Build succeeds for `fenix3` / `fenix3_hr` without using any API 2.4+ symbols.

---

#### Step 3 — Calibrate and log in air

3.1 Install the probe app on the fēnix 3 via USB sideload.
3.2 At a known elevation, press **START** to set the surface reference.
3.3 Record `Sensor.Info.pressure` and `Sensor.Info.altitude` values for 2 minutes.
3.4 Optionally move up/down stairs (~3–5 m elevation change) and observe whether `pressure` changes inversely with altitude as expected for sea-level-calibrated pressure.

**Verification:** Compare logged values with the watch’s native **Baro. Pressure** and **Ambient Press.** data fields. If `Sensor.Info.pressure` matches **Baro. Pressure**, it is calibrated, not raw ambient.

---

#### Step 4 — Water-submersion test

4.1 Submerge the watch to 0.5 m, 1 m, and 2 m in a pool or bucket.
4.2 At each depth, record:
- `Sensor.Info.pressure`
- `Sensor.Info.altitude`
- Probe-computed depth from `deltaP / (ρ·g)`
- Watch’s native **Ambient Press.** data field (if accessible during an activity)
- Actual depth from a ruler/tape measure

4.3 Return to the surface and continue logging for 2 minutes to check for drift/reset.

**Verification:** Produce a table comparing actual depth vs. probe depth vs. altitude-derived depth. A usable raw sensor would show ~10 kPa/m increase in `pressure` and no rapid drift back to the pre-dive value.

---

#### Step 5 — Analyze time-domain behavior

5.1 Repeat the 1 m submersion but move quickly up and down several times.
5.2 Log at 1 Hz.
5.3 Check whether the pressure/altitude values:
- Follow the movement immediately,
- Lag by seconds,
- Snap back to a weather-corrected value after submersion.

**Verification:** Plot or tabulate the 1 Hz log. Smooth/weather-corrected behavior confirms CIQ cannot see true hydrostatic pressure changes.

---

#### Step 6 — Decide on depth feature

6.1 Review Step 4–5 data.
6.2 If the CIQ pressure value tracks water depth linearly and with minimal lag:
- Add an experimental depth mode behind a “Use at own risk” warning.
- Limit depth reporting to shallow water (e.g., 0–5 m) and include heavy caveats.

6.3 If the CIQ pressure value is calibrated, drifts, or lags:
- Keep the app breath-hold only.
- Document that fēnix 3 hardware measures ambient pressure but Connect IQ API 1.4 hides the raw value.

**Verification:** A one-page decision record with data tables and the final feature scope.

---

#### Step 7 — Update documentation

7.1 Update `IMPLEMENTATION_PLAN.md` and `README.md` with the findings.
7.2 Explain the distinction between native “Ambient Press.” data field and CIQ-exposed `Sensor.Info.pressure`.
7.3 Remove or retain the `pressure-probe` branch as a debugging artifact.

**Verification:** README clearly states whether depth is supported and why.

### 5. Verification Summary

| Step | Verification Method | Success Criteria |
|------|----------------------|------------------|
| 1 | API doc screenshots/quotes | Confirmed API 1.4 vs. 2.4.0 pressure field availability |
| 2 | Clean build for fēnix 3 | No compiler errors; no 2.4+ API symbols used |
| 3 | Air calibration log | Baseline pressure/altitude values captured |
| 4 | Pool/bucket test table | Actual depth vs. probe depth compared |
| 5 | 1 Hz movement log | Lag/drift/weather-correction behavior identified |
| 6 | Decision record | Clear “add depth” or “stay breath-hold” verdict |
| 7 | README update | Users understand fēnix 3 depth limitation |

### 6. Risks & Rollbacks

| Risk | Likelihood | Impact | Rollback |
|------|------------|--------|----------|
| Water damage during bucket/pool test | Low | High (watch destroyed) | Use a shallow bucket first; do not press buttons underwater; stop test at first sign of moisture ingress |
| Probe app crashes due to API 1.4 differences | Medium | Low | Revert to `main` branch; use simulator first |
| Pressure value is confirmed unusable, disappointing expectation | High | Low | Document findings; keep existing breath-hold app unchanged |
| Probe app overwrites existing app on watch | Medium | Medium | Keep `.PRG` backups; name probe app distinctly |
| Invalid depth readings lead to safety false confidence | N/A | High | Only enable depth if empirical data is good; always show disclaimer |

### 7. Open Questions

1. **Does your fēnix 3 have a working barometer right now?** Some fēnix 3/3 HR units developed barometer sensor failures (common hardware issue). If the native “Ambient Press.” data field shows `---`, the probe test is moot.
2. **What firmware version is installed?** The exact CIQ 1.4.x sub-version may affect `Sensor.Info.pressure` behavior.
3. **Are you willing to do a controlled water test?** We can learn most of what we need from a bucket, but confirmation in a pool is better.
4. **Is the goal depth for freediving truly 30 m, or would a 0–5 m proof-of-concept on fēnix 3 be useful?** This changes whether any depth feature is worth adding even if the sensor works.
5. **Do you want me to create the `pressure-probe` diagnostic app now, or do you prefer to verify the API docs conclusion first?**


according to the specs the fenix 3 has this
 barometric altimeter,


The user is confirming that the fēnix 3 has a barometric altimeter according to the specs. They want me to investigate/confirm the conclusion about whether it can measure ambient pressure. The context-mode system is active, so I should use context-mode tools where appropriate for research.

I need to:
1. Acknowledge that yes, fēnix 3 has a barometric altimeter (sensor)
2. Reiterate the distinction: sensor exists, but Connect IQ API 1.4 exposes only sea-level calibrated pressure
3. Verify this distinction rigorously using context-mode tools
4. Possibly look at the fēnix 3 manual/specs to confirm
5. Then maybe proceed to create the pressure-probe diagnostic app if they want, OR just confirm the conclusion

Since the user said "according to the specs the fenix 3 has this barometric altimeter" - they seem to be challenging or questioning my previous statement that fēnix 3 can't measure ambient pressure. I need to clarify that:
- Hardware: yes, barometric altimeter exists
- Native watch UI/data fields: yes, "Ambient Press." and "Baro. Pressure" exist
- Connect IQ API 1.4: NO raw ambient pressure; only calibrated

I should use context-mode tools to verify this. Let me use ctx_fetch_and_index to fetch the fēnix 3 manual page, and maybe use web_explore or ollama_web_search. Actually web_explore uses web search internally. Since context-mode is active, I should use ctx_fetch_and_index for web pages and ctx_search for querying.

But also I should check the existing code/docs I've already created. Maybe use ctx_execute_file or read to look at the implementation plan.

Let me do a thorough verification:
1. Fetch fēnix 3 manual page about barometric altimeter
2. Fetch the CIQ Sensor.Info page again to confirm pressure description
3. Search for evidence that fēnix 3 CIQ only has calibrated pressure
4. Look at the current implementation plan

Then write a clear response.


fetched 2 c=1. ok=2 cache=0 err=0. 9 sections 15.6KB.

- [new]   Fenix 3 manual barometric altimeter::https://www8.garmin.com/manuals/webhelp/fenix3/EN-US/GUID-BC734846-01A7-4F33-86D4-DFBDBC06CDB4.html — 3 sections (1.1KB)
- [new]   Fenix 3 data fields manual::https://www8.garmin.com/manuals/webhelp/fenix3/EN-GB/GUID-02713A0A-48C2-4EA1-BCD0-D5FC7D1EB68A.html — 6 sections (14.5KB)

ctx_search(queries: [...], source: "<label>") for full content.

---

### Fenix 3 manual barometric altimeter::https://www8.garmin.com/manuals/webhelp/fenix3/EN-US/GUID-BC734846-01A7-4F33-86D4-DFBDBC06CDB4.html

fēnix 3/HR - Calibrating the Barometric Altimeter

[

# fēnix® 3/HR

](index.html "Home")

[Calibrating the Barometric Altimeter](#)

# Calibrating the Barometric Altimeter

Your device was already calibrated at the factory, and the device uses automatic calibration at your GPS starting point by default. You can manually calibrate the barometric altimeter if you know the correct el…
### Fenix 3 data fields manual::https://www8.garmin.com/manuals/webhelp/fenix3/EN-GB/GUID-02713A0A-48C2-4EA1-BCD0-D5FC7D1EB68A.html

fēnix 3/HR - Data Fields

[

# fēnix® 3/HR

](index.html "Home")

[Data Fields](#)

# Data Fields

%FTP

The current power output as a percentage of functional threshold power.

%HRR

The percentage of heart rate reserve (maximum heart rate minus resting heart rate).

10s Avg. Power

The 10-second moving average of power output.

10s Avg Balance

The 10-second moving average of the…


Ambient Press uncalibrated ambient pressure data field

Baro. Pressure calibrated current pressure

calibrating barometric altimeter GPS starting point auto calibrate


## Ambient Press uncalibrated ambient pressure data field

--- [current-session | 2026-07-26 21:17 | Fenix 3 data fields manual::https://www8.garmin.com/manuals/webhelp/fenix3/EN-GB/GUID-02713A0A-48C2-4EA1-BCD0-D5FC7D1EB68A.html] ---
### Data Fields (1)

# Data Fields

%FTP

The current power output as a percentage of functional threshold power.

%HRR

The percentage of heart rate reserve (maximum heart rate minus resting heart rate).

10s Avg. Power

The 10-second moving average of power output.

10s Avg Balance

The 10-second moving average of the left/r…

…age of power output.

30s Avg Balance

The 30-second moving average of the left/right power balance.

3s Avg. Balance

The three-second moving average of the left/right power balance.

3s Avg. Power

The 3-second moving average of power output.

500m Pace

The current swimming pace per 500 meters.

Ambient Press.

The uncalibrated ambient pressure.

Average HR

The average heart rate for the current activity.

Average Pace

The average pace for the current activity.

Average Power

The average power output for the current activity.

Average SWOLF

The average swolf score for the current activity. Your swolf score is the sum of the ti…

…t Per Stk

The average distance traveled per stroke during the current activity.

Avg GCT

The average amount of ground contact time for the current activity.

Avg HR %Max.

The average percentage of maximum heart rate for the current activity.

Balance

The current left/right power balance.

Baro. Pressure

The calibrated current pressure.

Bearing

The direction from your current location to a destination. You must be navigating for this data to appear.

Cadence

Cycling. The number of revolutions of the crank arm. Your device must be connected

--- [current-session | 2026-07-26 21:17 | Fenix 3 data fields manual::https://www8.garmin.com/manuals/webhelp/fenix3/EN-GB/GUID-02713A0A-48C2-4EA1-BCD0-D5FC7D1EB68A.html] ---
### Data Fields (4)

…ne.

Time of Day

The time of day based on your current location and time settings (format, time zone, daylight saving time).

Timer

The current time of the countdown timer.

Time to Next

The estimated time remaining before you reach the next waypoint in the route. You must be navigating for this data to appear.

Torque Eff.

The measurement of how efficiently a rider is pedaling.

Total Ascent

The total elevation distance ascended since the last reset.

Total Descent

The total elevation distance descended since the last reset.

Training Effect

The current impact (1.0 to 5.0) on your aerobic fitness.

TSS

The Training Stress Score™ for the current activity.

V Dist to Dest

The elevation distance between your current position and the final destination. You must be navigating for this data to appear.

Vertical Osc.

The amount of bounce while you are running. The vertical motion of your torso, measured in centimeters for each step.

Vertical Ratio

The ratio of vertical oscillation to stride length.

Vertical Speed

The rate of ascent or descent over time.

Vert Spd to Tgt

The rate of ascent or descent to a predetermined altitude. You must be navigating for this data to appear.

VMG

The speed at which you are closing on a destination along a route. You must be navigating for this data to appear.

Work

The accumulated work performed (power output) in kilojoules.

[

Home

](index.html "Home")[

Appendix

](GUID-E1A8D420-7F46-470B-B85D-0429910CA109.html "Appendix")[

Da

---

## Baro. Pressure calibrated current pressure

--- [current-session | 2026-07-26 21:17 | Fenix 3 data fields manual::https://www8.garmin.com/manuals/webhelp/fenix3/EN-GB/GUID-02713A0A-48C2-4EA1-BCD0-D5FC7D1EB68A.html] ---
### Data Fields (1)

# Data Fields

%FTP

The current power output as a percentage of functional threshold power.

%HRR

The percentage of heart rate reserve (maximum heart rate minus resting heart rate).

10s Avg. Power

The 10-second moving average of power output.

10s Avg Balance

The 10-second moving average of the left/right power balance…

…s Avg. Power

The 30-second moving average of power output.

30s Avg Balance

The 30-second moving average of the left/right power balance.

3s Avg. Balance

The three-second moving average of the left/right power balance.

3s Avg. Power

The 3-second moving average of power output.

500m Pace

The current swimming pace per 500 meters.

Ambient Press.

The uncalibrated ambient pressure.

Average HR

The average heart rate for the current activity.

Average Pace

The average pace for the current activity.

Average Power

The average power output for the current activity.

Average SWOLF

The average swolf score for the current activity. Your swolf score is the sum of the time for one length plus the number of strokes for that length ([Swim Terminology](GUID-9481691E-B9E0-4793-BDF7-4F78D8703E2B.html)). In open water swimming, 25 meters is used to calculate your swolf score.

Avg. %HRR

The average percentage of heart rate reserve (maximum heart rate minus resting heart rate) for the current activity.

Avg. 500m Pace

The average swimming pace per 500 meters for the current activity.

Avg. Ascent

The average vertical distance of ascent since the last reset.

A…

--- [current-session | 2026-07-26 21:17 | Fenix 3 data fields manual::https://www8.garmin.com/manuals/webhelp/fenix3/EN-GB/GUID-02713A0A-48C2-4EA1-BCD0-D5FC7D1EB68A.html] ---
### Data Fields (3)

The vertical distance of ascent for the current lap.

Lap Balance

The average left/right power balance for the current lap.

Lap Cadence

Cycling. The average cadence for the current lap.

Lap Cadence

Running. The average cadence for the current lap.

Lap Descent

The vertical distance of descent for the current lap.

Lap Distance

The distance traveled for the current lap.

Lap GCT

The average amount of ground contact time for the current lap.

Lap GCT Bal.

The average ground contact time balance for the current lap.

Lap HR

The average heart rate for the current lap.

Lap HR %Max.

The average percentage of maximum heart rate for the current lap.

Lap NP

The average Normalized Power for the current lap.

Lap Pace

The average pace for the current lap.

Lap Power

The average power output for the current lap.

Laps

The number of laps completed for the current activity.

Lap Speed

The average speed for the current lap.

Lap Stride Len.

The average stride length for the current lap.

Lap Time

The stopwatch time for the current lap.

Lap Vert. Osc.

The average amount of vertical oscillation for the current lap.

Lap Vert. Ratio

The average ratio of vertical oscillation to stride length for the current lap.

Last Int. Dist.

The distance traveled for the last completed interval.

Last Int. Pace

The average pace for the last completed interval.

Last Int. Time

The stopwatch time for the last completed interval.

Last Lap Ascent

The vertical distance of ascent for t…

---

## barometric altimeter data fields

--- [current-session | 2026-07-26 21:17 | Fenix 3 data fields manual::https://www8.garmin.com/manuals/webhelp/fenix3/EN-GB/GUID-02713A0A-48C2-4EA1-BCD0-D5FC7D1EB68A.html] ---
### Data Fields (4)

…ne.

Time of Day

The time of day based on your current location and time settings (format, time zone, daylight saving time).

Timer

The current time of the countdown timer.

Time to Next

The estimated time remaining before you reach the next waypoint in the route. You must be navigating for this data to appear.

Torque Eff.

The measurement of how efficiently a rider is pedaling.

Total Ascent

The total elevation distance ascended since the last reset.

Total Descent

The total elevation distance descended since the last reset.

Training Effect

The current impact (1.0 to 5.0) on your aerobic fitness.

TSS

The Training Stress Score™ for the current activity.

V Dist to Dest

The elevation distance between your current position and the final destination. You must be navigating for this data to appear.

Vertical Osc.

The amount of bounce while you are running. The vertical motion of your torso, measured in centimeters for each step.

Vertical Ratio

The ratio of vertical oscillation to stride length.

Vertical Speed

The rate of ascent or descent over time.

Vert Spd to Tgt

The rate of ascent or descent to a predetermined altitude. You must be navigating for this data to appear.

VMG

The speed at which you are closing on a destination along a route. You must be navigating for this data to appear.

Work

The accumulated work performed (power output) in kilojoules.

[

Home

](index.html "Home")[

Appendix

](GUID-E1A8D420-7F46-470B-B85D-0429910CA109.html "Appendix")[

Da

--- [current-session | 2026-07-26 21:17 | Fenix 3 data fields manual::https://www8.garmin.com/manuals/webhelp/fenix3/EN-GB/GUID-02713A0A-48C2-4EA1-BCD0-D5FC7D1EB68A.html] ---
### Untitled

fēnix 3/HR - Data Fields

[

> Throttle: call #1/8 in this window. 2 call(s) before soft cap. Prefer ctx_search(queries: [...]) array form for multi-query workloads — it counts as a single call.


## calibrating barometric altimeter GPS starting point auto calibrate

--- [current-session | 2026-07-26 21:17 | Fenix 3 manual barometric altimeter::https://www8.garmin.com/manuals/webhelp/fenix3/EN-US/GUID-BC734846-01A7-4F33-86D4-DFBDBC06CDB4.html] ---
### Calibrating the Barometric Altimeter

# Calibrating the Barometric Altimeter

Your device was already calibrated at the factory, and the device uses automatic calibration at your GPS starting point by default. You can manually calibrate the barometric altimeter if you know the correct elevation.

1.  Hold UP.
2.  Select Settings > Sensors > Altimeter.
3.  Select an option:
    *   To calibrate automatically from your GPS starting point, select Auto Cal. > On.

    *   To enter the current elevation, select Calibrate.

[

Home

](index.html "Home")[

Customizing Your Device

](GUID-CA397BE7-7C7F-4A1A-A8C0-2DDAA7ACFEA7.html "Customizing Your Device")[

Sensors Settings

](GUID-2454281D-24EA-4854-9BCA-AE6A39F56CC9.html "Sensors Settings")[

Altimeter Settings

](GUID-2DF9C415-2A35-48CE-B20B-013DAA3358A5.html "Altimeter Settings")[

Calibrating the Barometric Altimeter

](GUID-BC734846-01A7-4F33-86D4-DFBDBC06CDB4.html "Calibrating the Barometric Altimeter")

Copyright © Garmin. All rights reserved.GUID-4FFB52AE-9CA9-47F5-B9E6-45D823872585 v7

--- [current-session | 2026-07-26 21:17 | Fenix 3 manual barometric altimeter::https://www8.garmin.com/manuals/webhelp/fenix3/EN-US/GUID-BC734846-01A7-4F33-86D4-DFBDBC06CDB4.html] ---
### Untitled

fēnix 3/HR - Calibrating the Barometric Altimeter

[

---

## manual calibrate elevation

--- [current-session | 2026-07-26 21:17 | Fenix 3 manual barometric altimeter::https://www8.garmin.com/manuals/webhelp/fenix3/EN-US/GUID-BC734846-01A7-4F33-86D4-DFBDBC06CDB4.html] ---
### Calibrating the Barometric Altimeter

# Calibrating the Barometric Altimeter

Your device was already calibrated at the factory, and the device uses automatic calibration at your GPS starting point by default. You can manually calibrate the barometric altimeter if you know the correct elevation.

1.  Hold UP.
2.  Select Settings > Sensors > Altimeter.
3.  Select an option:
    *   To calibrate automatically from your GPS starting point, select Auto Cal. > On.

    *   To enter the current elevation, select Calibrate.

[

Home

](index.html "Home")[

Customizing Your Device

](GUID-CA397BE7-7C7F-4A1A-A8C0-2DDAA7ACFEA7.html "Customizing Your Device")[

Sensors Settings

](GUID-2454281D-24EA-4854-9BCA-AE6A39F56CC9.html "Sensors Settings")[

Altimeter Settings

](GUID-2DF9C415-2A35-48CE-B20B-013DAA3358A5.html "Altimeter Settings")[

Calibrating the Barometric Altimeter

](GUID-BC734846-01A7-4F33-86D4-DFBDBC06CDB4.html "Calibrating the Barometric Altimeter")

Copyright © Garmin. All rights reserved.GUID-4FFB52AE-9CA9-47F5-B9E6-45D823872585 v7

--- [current-session | 2026-07-26 21:17 | Fenix 3 manual barometric altimeter::https://www8.garmin.com/manuals/webhelp/fenix3/EN-US/GUID-BC734846-01A7-4F33-86D4-DFBDBC06CDB4.html] ---
### Untitled

fēnix 3/HR - Calibrating the Barometric Altimeter

[

> Throttle: call #2/8 in this window. 1 call(s) before soft cap. Prefer ctx_search(queries: [...]) array form for multi-query workloads — it counts as a single call.


Question: Connect IQ API 1.4 fēnix 3 Sensor.Info.pressure raw ambient pressure vs native Ambient Press data field

Question: Garmin fēnix 3 "Ambient Press" native data field Connect IQ app access raw pressure


1. Raw pressure data - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/1217/raw-pressure-data
   Raw pressure data - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 12 replies
- Subscribers 16 subscribers
- Views 4083 views
- Users 0 members are here

Options

Related

# Raw pressure data

I am trying to develop an app that uses the pressure information from Sensor.Info.pressure. When i test my app on the Fenix 3 i do not get the result i want. When i apply a sudden pressure change the readings do change but after a few seconds the value moves back the the value before i increased the pressure. It looks to me that this is not a raw sensor value but some auto calibrated one. Is there a way to use the raw sensor data?

- Sign in to reply
- Cancel

Is Garmin watching their forum? Anybody?

I would also like access to the raw pressure data as well. I suspect for the same reason - a depth gauge. At the very least a complete and accurate description of what the data we are getting out of GetSensorInfo is so we can manually deconstruct it back into what is needed. The raw info is available as a datafield, so why can we not access it in the API? (The same goes with GPS altitude) Right now the only workaround is to use altitude (from either SensorInfo or ActivityInfo), but since we don't know how exactly how that is derived, any depth calculations base off altitude can not be considered reliable. Thanks

I have plans to look into this further, but it'll have to go into my queue. I'll see what I can find out and try to get an answer by later this week or early next week.

This hasn't been forgotten! I'm talking to the device teams to get an answer on this. Connect IQ doesn't do anything to the data--we're basically just making a request to the OS for sensor data and piping through whatever it returns. If there is any auto-calibration or massaging of the data, it's happening at a lower level. Once I have an answer, I'll post it here. Thanks for your patience!

Thanks Brandon! I will wait patiently. I hope you will come back with good news ;)

> This hasn't been forgotten!

I think it now is forgotten?

Hey guys,This is how I do it in my app.Data available: sensor.altitude (from pressure using baro setting) and sensor.pressure (that really gives the barometer setting adjusted with changes in pressure since that setting was made by user - as far as I understand)Assumption: even a 100mb change in pressure (which is huge) will only impact the result by only 10cm under water, so it's quite negligible.1/ Take current pressure altitude2/ Convert it to ambient pressure (below, replacing p0 with baro setting would return the correct ambient pressure, but again sensor.pressure doesn't give exactly baro setting).3/ Convert that to depth`// Physics for ambient pressure calculation var p0 = 101325;// sea level standard atmospheric pressure Pa var L = 0.0065;// temperature lapse rate, = g/cp*for dry air K/m var T0 = 288.15;// sea level standard temperature 288,15 K var g = 9.80665;// Earth-surface gravitational acceleration 9,80665 m/s² var M = 0.0289644;// molar mass of dry air 0,0289644 kg/mol var R = 8.31447;// universal gas constant 8,31447 J/(mol*K) var exp = g*M/R/L; var fact = L/T0; var press = p0 * Math.pow((1-altitude*fact),exp)/100; var depth = 0.0; depth = (press/1000.0 - 1); if (unitElevMeters){ altStr = "-" + depth.format("%.2f") + "m"; } else {//feet altStr = "-" + (depth*3.28084).format("%1f") + "ft"; } ` Don't know if it helps but I hope so.

No not forgotten. :) Work is still ongoing, but it's going to take some time. I apologize that it's not being completed more quickly. It's not a simple matter of flipping a switch to make the data available--we're coordinating with a couple of other technology teams to come up with the best solution, and that will likely require us to also coordinate with device teams to integrate any necessary changes.

@julienvn: thanks for the formula this may be very helpful. But to be honest i have some troubles to use it. Technical it is not an issue but why should i make all strange calculation to recalculate the original data? I am an engineer that has the motivation to make an app for garmin to make their prduct better for free. It take a lot of my time to do this but how is the support to me in this case? I don't understand it is now 2 months later and still no response again. @brandon: please correct me if i see things the wrong way ��. I would be happy to admit that i am wrong in this case.

Hi there,I had the same issue as Fruitmans and posted the same question on another thread (https://forums.garmin.com/forum/developers/connect-iq/159801-) However, as it seems there is still no solution to that. Is there any chance that the ambient pressure sensor reading is going to be directly available? It seems kind of odd that only processed pressure data is available through the API even though there exists a datafield for this data.Maybe Brandon can give us an update on that after two years? Are there any plans to make this available through CIQ?Thanks for an update

2. Toybox.Sensor.Info
   URL: https://developer.garmin.com/connect-iq/api-docs/Toybox/Sensor/Info.html
   Toybox.Sensor.Info

# Class: Toybox.Sensor.Info

Inherits: Toybox.Lang.Object

Toybox.Lang.Object

Toybox.Sensor.Info

show all

## Overview

The Sensor.Info class contains all of the information provided by enabled sensors.

Sensor.Info can be retrieved on every call of onUpdate() or it can be obtained on demand. Fields in this class may return`null` so should be checked for`null` values prior to use.

## Instance Member Summary collapse

accel as Lang.Array< Lang.Number> or Null

The accelerometer reading of the x, y, and z axes as an Array of Number values in millig-units.

altitude as Lang.Float or Null

The altitude above mean sea level in meters (m).

cadence as Lang.Number or Null

The cadence in revolutions per minute (rpm).

heading as Lang.Float or Null

The true north referenced heading in radians.

heartRate as Lang.Number or Null

The heart rate in beats per minute (bpm).

mag as Lang.Array< Lang.Number> or Null

The magnetometer reading of the x, y, and z axes as an Array of Number values in milliGauss (mG).

oxygenSaturation as Lang.Number or Null

The current oxygen saturation in percent (%).

power as Lang.Number or Null

The power in Watts (W).

pressure as Lang.Float or Null

The barometric pressure in Pascals (Pa).

speed as Lang.Float or Null

The speed in meters per second (m/s).

temperature as Lang.Float or Null

The temperature in degrees Celsius (C).

## Instance Attribute Details

### var accel as Lang.Array<Lang.Number> or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Array.html https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The accelerometer reading of the x, y, and z axes as an Array of Number values in millig-units.

### var altitude as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The altitude above mean sea level in meters (m).

Elevation is derived from the most accurate source: Barometer or GPS in order of descending accuracy. If no GPS is present, then barometer readings will be used.

### var cadence as Lang.Number or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The cadence in revolutions per minute (rpm).

Cadence is derived from (in order of priority):

Bike sensors (cadence or speed must be enabled)

Advanced running dynamics sensors (e.g. heart strap with running dynamics enabled)

Foot pod

Watch-based cadence calculations

### var heading as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The true north referenced heading in radians.

This provides compass orientation if it is supported by the device.

### var heartRate as Lang.Number or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The heart rate in beats per minute (bpm).

### var mag as Lang.Array<Lang.Number> or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Array.html https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The magnetometer reading of the x, y, and z axes as an Array of Number values in milliGauss (mG).

### var oxygenSaturation as Lang.Number or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The current oxygen saturation in percent (%)

### var power as Lang.Number or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Number.html

The power in Watts (W).

### var pressure as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The barometric pressure in Pascals (Pa).

This returns barometric pressure calibrated to sea level. Since pressure varies dues to several factors, a GPS-based altitude must first be obtained, then the ambient (local) pressure is measured by the pressure sensor before conversion to a calibrated barometric pressure value.

### var speed as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The speed in meters per second (m/s).

### var temperature as Lang.Float or Null

https://developer.garmin.com/connect-iq/api-docs/Toybox/Lang/Float.html

The temperature in degrees Celsius (C).

---

Generated Jun 8, 2026, 3:42:17 PM

3. Ambient pressure and pressure history don't match - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/244746/ambient-pressure-and-pressure-history-don-t-match
   Ambient pressure and pressure history don't match - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 24 replies
- Subscribers 18 subscribers
- Views 5648 views
- Users 0 members are here

Options

Related

# 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

- Sign in to reply
- Cancel

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.

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

Thanks again

4. Barometric pressure data useless - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/5343/barometric-pressure-data-useless
   Barometric pressure data useless - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 20 replies
- Subscribers 15 subscribers
- Views 7836 views
- Users 0 members are here

Options

Related

# Barometric pressure data useless

Hi all, I'm playing around a bit with some sensor data on my Fenix 5. However, it seems to me that the sensor data the pressure sensor is returning is just not really helpful. According to the API it "returns barometric pressure calibrated to sea level" but as a user I'm way more interested in the absolute barometric pressure the sensor is currently facing. This is also the quantity the sensor is actually able to measure but somehow I don't know (yet!?) how to access the pure measurement data. Why would Garmin measure something just to scramble it and then provide only the 'scrambled' numbers to the developers instead of the real measurement values. Can anyone tell me how I can access the absolute barometric pressure? That would be really helpful! Thanks!

- Sign in to reply
- Cancel

## Top Replies

- Wrong data Calibrating the altimeter does not help me since I'm not interested in the pressure calibrated to sea level. This number is absolute useless for me. I need the absolute barometric pressure…

## All Replies

Measurements are way off... Unfortunatelly what I observed is that barometric preassure presented on the watch is way off from measurement of my weather station (which is correct I'm sure). Station says 1021hPa, while watch: 1065hPa. Hard to say how can you relay on that measurement...

Make sure you calibrate the altimeter. That's used to convert the ambient reading to sea level, and what you see is the sea level pressure. I see reading on the watch that are very close to what my weather station says if it's calibrated.

Wrong data Calibrating the altimeter does not help me since I'm not interested in the pressure calibrated to sea level. This number is absolute useless for me. I need the absolute barometric pressure which is the actual atmospheric pressure present at a certain altitude. If the fenix 5 has a pressure sensor that is also what it will be measuring but I don't know how to get this data. Is there a way to access the "real" absolute pressure data?

Sorry, but I do not think that is exposed to the CIQ interface. Therefore I do not believe there is a way to obtain the true pressure from a CIQ app. This is only available internally and not to CIQ.

https://apps.garmin.com/en-GB/apps/1e896cb8-87ac-4b7a-869f-b1c053fd917d It is possible, but currently only available for Fenix 3 and derivates.

When the f5/5x/fs started shipping, and up until the 3.90 FW on the va-hr, SensorHistory.getPressureHistory() returned the raw pressure, and what I had to do what use that with elevation to convert to MSL pressure, as MSL is what people wanted to see. It's how you can watch for weather changes, etc. If you have the MSL pressure, you could do the inverse with elevation, and come close to getting the "raw" data back.

In Russia you can hear on radio and see in internet only Ambient pressure value. I found almost useless Barometric pressure native widget, only to estimate trend and get alert on fast pressure changes. If we take Barometric pressure, then convert it to Ambient (raw) pressure, we can get error because of temperature and height (P = Po*exp(- μgh/RT) ), unit just estimates height MSL using internal algorithms. Double conversion looks not good. Ambient pressure can be visible only when you start activity. I vote for availability Ambient pressure in CIQ.

> If we take Barometric pressure, then convert it to Ambient (raw) pressure, we can get error because of temperature and height (P = Po*exp(- μgh/RT) ), unit just estimates height MSL using internal algorithms. Double conversion looks not good. Ambient pressure can be visible only when you start activity. I vote for availability Ambient pressure in CIQ.

I agree that converting it forth and back is not what you want to do. But what do you mean with "can be visible only when you start activity". I don't think that makes a difference.

There is a built in data field which can be configured, but is only available during an activity. It is not accessible any other way.

Bad thing that even pressure reported by CIQ does not match the value in the data fields. Data field values match the internal service test menu however. In this menu I can see pressure in mb.

5. Toybox.Activity.Info vs. on Device Pressure - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/262285/toybox-activity-info-vs-on-device-pressure
   Toybox.Activity.Info vs. on Device Pressure - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- State Verified Answer
- Replies 3 replies
- Subscribers 17 subscribers
- Views 999 views
- Users 0 members are here

Options

Related

# Toybox.Activity.Info vs. on Device Pressure

Apologies if this is a common topic - couldn't find anything recent.

I've implemented pressure readings on my watch faces, but I am running into something I can't quite figure out. None of the available pressures in CIQ (ambientPressure, rawAmbientPressure, nor meanSeaLevelPressure) from Toybox.Activity.Info match the on-device pressure widget.

Does anyone know why this may be the case, and if so, how I can match the pressure readings up? Am I using the wrong variable, or is there some other issue? Some users are confused, and I am as well!

- Sign in to reply
- Cancel

## Top Replies

- Have you looked at SensorHistory.getPressureHistory(). The newest sample? You can also look in Sensor.Info, but with a watch face you can only do that in a background service.

## All Replies

Have you looked at SensorHistory.getPressureHistory(). The newest sample? You can also look in Sensor.Info, but with a watch face you can only do that in a background service.

Good idea - I have not. I'll give that a try tonight and see if it gives results more in line with the widget!

Yep, looks like that pulls the expected data. Thanks!

6. Watch face pressure data - any way at all? CIQ v1.x (in this case Fenix 3 HR) - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/6690/watch-face-pressure-data---any-way-at-all-ciq-v1-x-in-this-case-fenix-3-hr/44767
   Watch face pressure data - any way at all? CIQ v1.x (in this case Fenix 3 HR) - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 3 replies
- Subscribers 16 subscribers
- Views 338 views
- Users 0 members are here

Options

Related

# Watch face pressure data - any way at all? CIQ v1.x (in this case Fenix 3 HR)

I’m writing a watch face for v1.x watches (I own a F3HR) and I would really like to have pressure data usable on the face. Has anyone found any way at all of implementing this? I’m open to hacks, workarounds, low quality options, ambient or sea level pressure (I can convert from one to the other using altitude as a variable). I’ve attempted to scour this forum for ideas. Sensor and SensorHistory both come back with a no permission type warning In the simulator, and Activity.Info doesn’t seem to contain pressure values in v1.x? I was even thinking of having a widget populate the value into the object store and then the face could go get it? Is that even feasible?Thanks in advance - any help would be greatly appreciated!

- Sign in to reply
- Cancel

> I’ve attempted to scour this forum for ideas. Sensor and SensorHistory both come back with a no permission type warning In the simulator, and Activity.Info doesn’t seem to contain pressure values in v1.x? I was even thinking of having a widget populate the value into the object store and then the face could go get it? Is that even feasible?

Actually, Sensor can't be used in watch faces, and SensorHistory can, but only on watches that support it (and they are all CIQ 2.x or greater). There's no way for a widget and WF to share an object store. Activity.Info has ambient,rawAmbient, and meanSeaLevel pressure, but only on devices with a baro altimeter and have CIQ 2.4.x or greater.So, in other words, you can't show pressure in a WF on a f3hr.

Ok thanks Jim. I’ve been reading a ton of your posts - I was secretly hoping to get a reply from you as you seem to know this stuff inside out :)i guess I’ll code this as an optional parameter if the device has 2.x

For things that may not be available on all devices (like this), and if that value is selected, I'll either ignore that field, or display something like N.A. (not available). SensorHistory or the new things in Activity.Info for pressure would be the way to go, and you can either do that check at compile time based on the target, or runtime using "has".

7. Retrieve ambient pressure in foreground - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/288741/retrieve-ambient-pressure-in-foreground
   Retrieve ambient pressure in foreground - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 11 replies
- Subscribers 18 subscribers
- Views 1953 views
- Users 0 members are here

Options

Related

# Retrieve ambient pressure in foreground

Toybox.Sensor.getInfo().ambientPressure needs the permission Toybox.Sensor - I don't have added this permission yet because until now I used the pressure history.

I realised that ambientPressure is the value I want to display and not the one from the history and want to change this now.

1) it seems like ambientPressure value can't be retrieved from history, correct?

2) I realised that Toybox.Sensor also needs the background permission, does this mean I can only read the ambientPressure in the background?

Actually I don't want to add 2 permissions for this single data value to my watchface, is there no alternative way to get the current pressure (or last in one from history)?

- Sign in to reply
- Cancel

With a watch face, you can only access Sensor data in a background service.

Try Activity.getActivityInfo().ambientPressure in the foreground

Be sure to handle devices without a baro altimeter

In the sim I can access ambientPressure without an exception but it returns null (without adding the necessary permissions though)... But you say, the foreground access won't work on a real device anyway, that's the important information for me. Btw, adding background + sensor permission approx. halves the available memory for a watchface (ERROR: PRG generated exceeds the memory limit of 'background' applications for device id 'fenix6xpro': 63883 bytes) - is this something I have to accept or can I circumvent this side effect?

Can't I alternatively convert pressure to ambientPressure with the history data?

In the sim, are you simulating data? Try Activity.Info on a real device with a baro if you have doubts.

Once you add background permission, you want to make sure you use the (:background) annotation where needed, otherwise it will try to load the entire WF when the background runs, inclusing when onAppInstall() or onAppUpdate() are called.

Now that I simulate data it shows a value - thanks. Even without adding additional permissions.

Oh, now I remember that in need to add :background annotations where needed to avoid my whole WF is running in the background - thanks.

So actually you say something different than I though - that real devices with baro allow to access Activity.getActivityInfo().ambientPressure in the foreground? So I just have to add the permissions, make sure my WF is running in foreground and it will work on a real device? Or will it work without the additional permissions in the foreground on a real device (as this is what I see in the sim)?

hi, no permission is need for Activity.getActivityInfo().ambientPressure

when Jim said "Be sure to handle devices without a baro altimeter" I think he means to check if the device has a Baro with

if(Activity.getActivityInfo() has :ambientPressure){...}

if you use this method, you don't need :Background annotation or permission.

Thanks, that answers all open questions. The unsure phrase for me was "you can only access Sensor data in a background service"

yes the module Sensor. but Activity is available from foreground.

Don't forget to check null statment

thanks for clarifying that. Btw, isn't the null check enough for class variables? I actually though the :has must only be used for functions...

hi, no it is not enough, if you try for exemple Activity.getActivityInfo().ambientPressure on a F45, it will crash since FR45 does not have ABC sensor.

see the API doc, you have lots of exemple of :has

You want to do the has check too. Devices like the fr45, fr55, fr245 and venu sq don't have a baro altimeter.

8. Widget - Access to sensor - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/167673/widget---access-to-sensor
   Widget - Access to sensor - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Cancel
- More
- German Forum
- Beta Program
- Developer
- Pilots
- Sports & Fitness
- Outdoor Recreation
- Apps & Software

- Users 0 members are here
- Views 1152 views
- Subscribers 17 subscribers
- Replies 4 replies

Options

- Cancel
- More
- Share

Related

# Widget - Access to sensor

Hye everyone,

I would like to have access to sensor in a widget,

So far I've get the Heading and the Elevation easily (from internal one)

but I cannot get pressure and temperature (like other widgets do).

here is my code:

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

function timerCallback() { Ui.requestUpdate(); }

function onUpdate(dc) {

var SensInfo = Sensor.getInfo(); heading = SensInfo.heading; speed = SensInfo.speed; alt = SensInfo.altitude; press = SensInfo.pressure; temp = SensInfo.temperature;

}

Do I need to use SensorHistory?

I can't use direct Sensor Data on Widget?

Many thanks.

Ps I either tried:

Sensor.setEnabledSensors([Sensor.SENSOR_TEMPERATURE]); Sensor.enableSensorEvents( method(:onSnsr) );

- Cancel
- Sign in to reply

Sensor is generally used to connect to an external sensor, so for non-Edge devices, SENSOR_TEMPERATURE is used if you want to connect to a Tempe. You probably are looking for the internal temperature sensor, and in that case you use SensorHistory.getTemperatureHistory() and use the newest sample.

For pressure, you can use SensorHistory.getPressureHistory(), but you can also see pressure (in different forms) from Acityity.getActivityInfo()

Note for both of these, the data is only available if the device has a baro altimeter

BTW, what you can do is use

Sensor.enableSensorEvents( method(:onSnsr) );

And probably skip the timer, as it will be called regularly.

Many thanks.

It work well now,

I. Have a small ttouble with speed which I get from gps, it is always changing,

Starts At good speed and increase again and again about 3 ot 4 times ans go back to good one.

For exemple (in kmh)

135 to 477 to 1217 to 6336 to ans go bac to 135.

You're starting GPS in the widget? Are you checking the accuracy?

You may want to ignore things that don't indicate a good fix.

Also, when you are standing still, there is some fluctuation in GPS, which will indicate a non-zero speed.

Are your numbers really kmh or meters/hour?

hye Jim, yes I start it on continous mode, No I don't check the accuracy, I'm gonna do that,

there is a kind of loop in sim and real watch, but only for the speed, for altitude, loop on sim but stable on watch.

yes my number is km/h, when I send it I twas testing my widget on car.(don't worry I'm not the driver ;) )

Toybox.Sensor.Info