SENSOR_TEMPERATURE on epix

I'm trying to get the current temperature from the internal temperature sensor on my epix. I'm calling setEnabledSesnors( [ System.SENSOR_TEMPERATURE ] ) and enableSensorEvents().
In my sensor update callback, the temperature member of the sensor_info parameter is always null. I'm getting correct values for altitude and pressure.

What am I doing wrong?
  • The epix doesn't have an internal temperature sensor. I had to do some poking around to confirm this, because my initial thought was that it certainly has one. :) To get the temperature on an epix, you'll need a Tempe.


    Brandon, can you please double check this? As I and others have pointed out, we're fairly certain the epix does have an internal temperature sensor. Yet it appears to be unavailable through Connect IQ.
  • You're correct! The epix does in fact have an internal sensor.

    I've amended my previous post, but I want to make sure everyone sees my response. Again, my fault for providing the incorrect information. :o The fenix 3 variants also include an internal temperature sensor. All devices with internal temperature sensors may potentially read incorrectly because of the proximity to the body, which is one reason we make the Tempe available.

    I did some additional looking and found that we have a report already open about this particular issue due to a similar question about the fenix 3 on [URL="http://Brandon, do you happen to know if the new f3 variants have an internal temp sensor? IIRC, the f3 did (or maybe it was the f2), and it's readings were known to be "a bit off", as it's data was impacted a fair amount by both direct skin temperature and things like long selves or a jacket."]Stackoverflow[/URL] (which was already answered--hat tip to Travis), so we should have this fixed at some point in the future.
  • Former Member
    Former Member over 8 years ago
    Great! Thank you.

    Did you solve the problem?
    I have also an Epix and am trying to get the Temperature values.
    This code:
    using Toybox.SensorHistory as SensH;
    using Toybox.Sensor as Sensor;
    using Toybox.Graphics as Gfx;

    function onUpdate(dc) {
    var HTrash;
    var x = dc.getWidth() / 2;
    var y = dc.getHeight() / 2;

    Sensor.setEnabledSensors ([Sensor.SENSOR_TEMPERATURE]);
    Sensor.enableSensorEvents();
    var HT=SensH.getTemperatureHistory();

    if( HT.getMax() == null)
    { HTrash="X";}
    else {
    HTrash=HT.getMax();
    }
    dc.drawText(x,10,Gfx.FONT_MEDIUM,"TMax="+ HTrash ,Gfx.TEXT_JUSTIFY_CENTER);
    }


    works OK in the Simulator, but not in Epix (appears a 'IQ !' symbol).
    In the manifest.xml file I have also:
    <iq: permissions>
    <iq:uses-permission id="SensorHistory"/>
    <iq:uses-permission id="Sensor"/>
    </iq: permissions>
  • When you get a "IQ!", you can look in \garmin\apps\logs\ciq_log.txt on the watch as that might tell you right off what happened (if not, try with a debug build.)

    You're mixing a couple things here. When you setEnabledSensors() in your example, you're looking for a Tempe in most cases, and you don't get the internal temp reading. (with a tempe, the data would be in Sensor.info)

    SensorHistory is the history of the internal sensors (you don't need setEnabledSensors() for that.). And SensorHistory is not available on a device with a 1.2.x VM, which is the case of the Epix. That likely is why you got the IQ!, as the Sensor History module doesn't even exist there. And even if the Epix gets an updated VM, it might not be available there, as it's not available on some devices with the new 1.3.1 or 2.1.x VMs
  • Former Member
    Former Member over 8 years ago
    When you get a "IQ!", you can look in \garmin\apps\logs\ciq_log.txt on the watch as that might tell you right off what happened (if not, try with a debug build.)

    You're mixing a couple things here. When you setEnabledSensors() in your example, you're looking for a Tempe in most cases, and you don't get the internal temp reading. (with a tempe, the data would be in Sensor.info)

    SensorHistory is the history of the internal sensors (you don't need setEnabledSensors() for that.). And SensorHistory is not available on a device with a 1.2.x VM, which is the case of the Epix. That likely is why you got the IQ!, as the Sensor History module doesn't even exist there. And even if the Epix gets an updated VM, it might not be available there, as it's not available on some devices with the new 1.3.1 or 2.1.x VMs

    Ok, thanks for the information about log.txt and 'setEnabledSensors'.
    I supposed SensorHistory was not supported by Epix, because in the API information says:
    Supported Devices:
    Forerunner 235/735xt/920xt
    fenix 3/HR
    D2 Bravo/Titanium
    Vivoactive HR

    But, then, how are collected Pressure and Temperature data in the 2 widgets included in Epix (as well as Temperature data in Fit file)?