Heart intervals broken on Venu firmware update (and now other devices)

Hi,

My app has been working consistently for quite a long period. Venu had a firmware update and I started to get reports of the app displaying zero results. The cause of this is that no interval data is being generated / seen by the app though BPM is being reported. A user has tried many other HRV like apps and they all FAIL as well.

I've tried various changes to the sensor handling to see if this fixes the issue to no avail. I am now in the situation that a) the simulator shows no issues and works perfectly every time (even with original code that stopped working after the firmware update and b) users are now in the situation that if they run the app twice then they will get interval/beat data. This remains the case for a period of time ie subsequent runs work every time and then reverts to having the app run twice.

These on device issues (simulator has no issues and no crashes) are almost impossible to debug now as the ability to read the LOG file has been removed (they no longer exist - someone said because of MTP file system). Either the simulator needs to get up with API and firmware iterations or there needs to be better tools for live debug. ERA doesn't report anything of course.

original code (has worked OK for months):

var _ans;
if (Sensor has :enableSensorType) {
Sys.println(">=CIQ 3.2 detected");
_ans = Sensor.enableSensorType( Sensor.SENSOR_HEARTRATE);
if (_ans) {
Sys.println("Strap enabled");
} else {
Sys.println("no strap");
_ans = Sensor.enableSensorType( Sensor.SENSOR_ONBOARD_HEARTRATE);
if (_ans) { Sys.println("OHR enabled");} else {Sys.println("no OHR either");}
}
} else {
_ans = Sensor.setEnabledSensors( [Sensor.SENSOR_HEARTRATE]);
Sys.println("Enable response ="+_ans);
}
Sensor.registerSensorDataListener(self.method(:onHeartRateData), options);
Note: sensors are disabled on exit of app.
Current code ( various versions of this have been tried with enabling both together and separately as here)
if (Sensor has :enableSensorType) {
Sys.println(">=CIQ 3.2 detected");
//_ans = Toybox.Sensor.setEnabledSensors( [Sensor.SENSOR_HEARTRATE, Sensor.SENSOR_ONBOARD_HEARTRATE]);
// USE enableSensor as it doesn't disable other sensor types
_ans = Toybox.Sensor.enableSensorType( Sensor.SENSOR_HEARTRATE);
Sys.println("Enable3.2a ="+_ans);
_ans = Toybox.Sensor.enableSensorType( Sensor.SENSOR_ONBOARD_HEARTRATE);
Sys.println("Enable3.2b ="+_ans);
// ONBOARD only works on > 3.2.0 devices
} else {
_ans = Toybox.Sensor.setEnabledSensors( [Sensor.SENSOR_HEARTRATE]);
Sys.println("Enable ="+_ans);
}
Any ideas welcome!!! This has broken 3 different apps.
Regards,
David
  • Which device?  I just tried on a device and the logging is working fine for a "hidden" prg

  • Hi Jim,

    Fenix 7X Solar. Are the "hidden" PRG in the media folder? I've improved my sensor handling to give more insight into the enable process. Just need to be back home to get a physical connection to device.

    Regards,

    David

  • Hi,

    So I've updated the code now to add some diagnostics. Sadly the code says neither sensor has returned true on enable yet the simulator works fine ie II data is produced!! NB yesterday before some devices got updated it worked fine. Devices prior to API 3.2.0 work fine on sim.

    I'll see what happens on device as I now have a test data view if I can't get the logs to work.

    Regards,

    David

    		if (Sensor has :enableSensorType) {
    			Sys.println(">=CIQ 3.2 detected");
    			//_ans = Toybox.Sensor.setEnabledSensors( [Sensor.SENSOR_HEARTRATE, Sensor.SENSOR_ONBOARD_HEARTRATE]);
    			// USE enableSensor as it doesn't disable other sensor types
    			if (Toybox.Sensor.enableSensorType( Sensor.SENSOR_HEARTRATE)) {
    				Sys.println("Enable3.2a strap");
    				mStrapOn = true;
    			}
    			if( Toybox.Sensor.enableSensorType( Sensor.SENSOR_ONBOARD_HEARTRATE)) {
    				Sys.println("Enable3.2b OHR");
    				mOHROn = true;
    			}
    		// ONBOARD only works on > 3.2.0 devices
    		} else {
    			var _ans;
    			// setEnabledSensors will disbale other sensor types
    			_ans = Toybox.Sensor.setEnabledSensors( [Sensor.SENSOR_HEARTRATE]);
    			Sys.println("Enable ="+_ans);
    			// actually can't tell as no value for onboard with < 3.2.0
    			if (_ans == [Sensor.SENSOR_HEARTRATE]){
    				mStrapOn = true;
    			} else {
    				mOHROn = true;
    			}
    		}

  • Just back home and managed to connect on a MacBook Air to my Fenix 7x.

    1. There is no media (MTP) directory - where are programmes put on install?

    2. The above code returns false for both mStrapOn and mOHROn on device and now in simulator. However, the app does run and finds II data.

    I'll try with a strap soon.

    Seems to me that enableSensorType returns false IF the sensor is already enabled rather than saying true as it logically should as the action of enablement has been done ie it is already enabled so enabled state should be true.

    Regards,

    David

  • Hi Gavriel,

    I've tried to find the media directory on both windows explorer (view hidden files enabled) and MacBook using Android file txf but can't see any media folder. 

    Is there some magic sauce I am missing. My workaround is to use the folder containing the STR files to work out which PRG are not being shown but tedious.

    Regards,

    David

  • maybe it depends on the watch. Which one do you have? Some people wrote about hidden folders on some devices.

  • Which watch do you have?  You may be able to see "media" on devices that don't have music as the device isn't MTP.

    The hidden folder was first for music apps, but then it expanded to other app types.

  • Fenix 7x solar.

    Having no end of fun with getRegisteredSensors which doesn't seem to return a sensorIterator like it's meant to.

  • So you have a music device.  You won't see the media folder.  I've not looked at getRegisteredSensors at all. so no help there.