Monitoring multiple sensors in an app

Hi,

I have a watch app that has been recording HRM and Tempe sensor data since February, using SDK 1.2.2 and 1.2.4.
Since the latest versions of SDK and watch ConnectIQ versions, the sensor data was no longer available in the app.

I have checked by compiling with different versions of SDK (1.2.5, 1.2.6 and 1.2.8) but without downgrading the firmware on my watch (VA v3.50, CIQ 1.2.6).
Many users have reported not getting data either.

I used to have this code:
[FONT=Courier New]
function onShow() {
Sensor.setEnabledSensors([Sensor.SENSOR_HEARTRATE]);
Sensor.setEnabledSensors([Sensor.SENSOR_TEMPERATURE]);
Sensor.setEnabledSensors([Sensor.SENSOR_FOOTPOD]);
Sensor.enableSensorEvents(method(:sensorAction));
}
[/FONT]

After testing multiple things, I noticed that if I disable the FOOTPOD sensor, then I get the Tempe data. I was not using the footpod data anyway. But still no HRM data.

If I remove the TEMPERATURE sensor, then I get the HRM data.
My code now looks like:
[FONT=Courier New]
function onShow() {
Sensor.setEnabledSensors([Sensor.SENSOR_HEARTRATE]);
Sensor.enableSensorEvents(method(:sensorAction));
}
[/FONT]
Are there issues in the newest SDKs / ConnectIQ that prevents from reading from multiple sensors?

Thanks for any feedback.
  • Multiple sensors work fine for me on the the SDK's you mention for va (latest FW), the 230 (latest FW) and va-hr (2.20) (except the va-hr has a bug with the oHRM and CIQ watch-apps right now...)

    But, I do things a bit differently....

    For one thing, I call setEnabledSensor() in initialize() (you could be seeing multiple onShow() calls if something like a notification occurs)

    Also, when I call setEnabledSensors() I pass an array of the sensors and not one at a time, and therefore, only one call.

    So instead of:
    Sensor.setEnabledSensors([Sensor.SENSOR_HEARTRATE]);
    Sensor.setEnabledSensors([Sensor.SENSOR_TEMPERATURE]);

    I do:
    Sensor.setEnabledSensors([Sensor.SENSOR_HEARTRATE,Sensor.SENSOR_TEMPERATURE]);

    (and then look at the return value to see what's actually paired - paired, but it may not be connected...)
  • Thanks for the quick answer!

    You are right, my bad!
    This is why there is an array of sensors as input parameter of setEnabledSensors().

    I am just wondering how it could have been working on prior versions... :confused: