Data simulation from .fit or .gpx file in Garmin Simulator in Watchface

Hi,

I tried to simulate the heart rate data and temperature data from Garmin Simulator but it does work for me. This is what I did:

1. I created an app which use ActivityMonitor to get the heart rate and SensorInfo to get the temperature.

This is my code for heart rate

var hrIterator = ActivityMonitor.getHeartRateHistory(1, true);
var latestHR = hrIterator.next().heartRate;

and this is the code for temperature.

var sensorInfo = Sensor.getInfo();
var temp = sensorInfo.temperature;

In simulator I always get 80 for heart rate and null for temperature.

I tried 3 types of apps (Watchface, Widget and Application) and got the same result for all 3 types.

2. I exported my own activity from connect.garmin.com to .fit and .gpx formats. This activity definitely has heart rate and temperature data.

3. In Garmin Simulator I use the menu Simulation->Activity Data, then Data Source "Workout FIT File" and choose my file as shown in the screenshot below:

4. Press the start button and the timer start going and it looks like the simulator is showing the same duration as my activity.

I expected that heart rate and temperature will be updated from my .fit file.

By actual result is, that heart rate is still always 80 and temperature is null.

So my question is why it does not work and how to fix it.

Or maybe I am doing something wrong and what is the proper way to simulate heart rate changes and temperature changes?

  • I generally use "data simulation" here, but also use FIT/GPX playable file  NOT Workout fit file.

    One thing is you are using getHeartRateHistory().

    Only a real device, that only updates every couple minutes - it's not real time, and in the sim, it's canned data and never changes.

    Why you may want to do is use Activity.getActivityInfo().currentHeartRare. which changes much more often.  Check it for null, as that's what happend if you take off a watch with just OHR.

    When you are using Sensor.getInfo().temperature, with the Tempe that's what you'll see. On some watches you may see the internal temp if the Tempe isn't connected.. This is where getTemperatureHistory() will give you the watch temperature (on devices with a barp altimeter)

    Oh, I forgot:  If you are doing a device-app or widget, make sure you enable the sensors you are using.

  • Thank you for your answer. Where can I get/create this playable FIT/GPX file? I tried to google but could not find much.

  • What I do is just record an activity on the Garmin, stop and save it.  Then hook to a PC and it's in garmin/activities.  Copy that to your hard drive and use that.  If you want tempe data, you need to have one paired/connected when you record the activity.

  • Sorry, I did not fully get that.
    1. "record an activity on the Garmin". Do you mean something like "start running activity on real Garmin watch, records some data like GPS track and heart rate and save it" or not?
    2. "hook to a PC and it's in garmin/activities". Do you mean connect Garmin watch to PC some how? Is not it the same as connecting via bluetooth to Garmin Connect mobile app and transfer activity data there?
    3. "Copy that to your hard drive". Do you mean download FIT or GPX file from my recorded running activity which I recorded in step 1?

    Also, if you have experience with activity data simulation. Does it work in watch face/widget or only in the App (such as running activity)?

  • Yes, on the watch record something like a walk or run.  It doesn't need to be long - 5-10 would be a good test.

    Then save the recording on the watch.

    In the /garmin/activity folder are the fit files you've recorded.  Use the charging cable from the watch to connect to the pc/mac.

    I've used this with widgets, watch faces, data fields, and device apps.

  • Thanks a lot! I finally managed to get it working! So, the problem was in my code, not in simulator.

    If I use this code:

    var hrIterator = ActivityMonitor.getHeartRateHistory(1, true);
    var latestHR = hrIterator.next().heartRate;

    then whatever I do, it always returns 80 and data was not coming from FIT file.

    but if I do it like this

    var currHR2 = Activity.getActivityInfo().currentHeartRate;

    then it works with all FIT files. Saved from connect.garmin.com or copied from the watch folder /GARMIN/Activity

    Also important thing was to use this option "FIT/GPX Playable File" like shown below. Other option allows to select FIT file, but does not work for me.

  • To me this sounds like the problem IS in the simulator. getHeartRateHistory doesn't seem to work.

  • To me this sounds like the problem IS in the simulator. getHeartRateHistory doesn't seem to work.

  • In the sim, all the histories in SensorHistory are canned data.  Think of it this way.. Would you want the sim to run for 4 hours to generate the normal amount of data you see with getHeartRateHistory?

    This is what the graph for getHeartrateHistory actually looks like in the sim