Features from new SDK are not effective on real hardware

Hi,

I have implemented a datafield which uses two new features from the new SDK. Both features work pretty well in the simulator. Nevertheless, as soon as I release a new version via the Garmin store, the new features are not effective at all on my physical device (Forerunner 235).

The first feature is the new onTimerLap() method. I use it to update my datafield to show the average lap heart rate of the previous lap.

The second feature is the vibration feature. I use it to vibrate once in 20 seconds if the cadence falls below a threshold.

As I said above both features work well in the simulator but not on my watch. The watch itself has installed the newest Garmin firmware (5.40). Any hints why the simulator behaves different to my device?
  • No one? Does the vibration feature works anyway on a forerunner, dass due to this text: All non-Edge devices. Note: Forerunners and EDGE devices do not support vibration patterns.
  • I've used both in data fields on a fr 230 with success (latest FW)... One just makes a sound every minute (proof of concept), and the other is in the app store so you can try it on your watch. It shows a chart of your run/walk/etc, and with onTimerLap() I mark where laps occur (manual or auto-lap) A 230 is very similar to the 235 (the same version of FW comes out for both at the same time)

    https://apps.garmin.com/en-US/apps/d741d7b4-8b26-401c-a5bd-0ac91891575d

    What FW is on your 235?
  • Hi Jim,

    thanks for helping me with that issues. I have to debug one after the other. Let's start with the vibration issue. (BTW: I use FW 5.40 on my watch)

    I used following code:
    in the constructor: vibrateData = [new Attention.VibeProfile( 50, 1000 )];

    and used it in the compute method:
    Att.vibrate(vibrateData);

    where Att links to Attention:
    using Toybox.Attention as Att;


    Nevertheless, I am unsure if this has to work since Garmin only says in the API:
    Use the vibe motor

    Parameters:
    vibe (Array) — Array of VibeProfile objects to play in sequence. Maximum of 8 supported.
    Since:
    1.0.0
    Supported Devices:
    All non-Edge devices. Note: Forerunners and EDGE devices do not support vibration patterns.


    Why do they write: "All non-Edge devices" and not "All non-Edge devices and all non-Forerunners"? And what is a vibration pattern - do they rather mean a VibeProfile?
  • It could be that your vibration is so low you don't notice it. (like I said, I've tested this on a fr230.)

    here's what I have in my test DF, (it also shows how you can use multiple VibeProfiles if you want to get fancy with patterns) (this is three strong with a drop between).
    using Toybox.WatchUi as Ui;
    using Toybox.Graphics as Gfx;
    using Toybox.System as Sys;

    class BeepDFView extends Ui.DataField {
    hidden var width=0;
    hidden var height=0;
    hidden var bgColor,fgColor;
    hidden var lastBeep=0;
    hidden var beeps=0;
    hidden var mseconds=60000;
    hidden var running=false;
    hidden var lastTimerTime=0;


    hidden var vibrateDataShort = [
    new Attention.VibeProfile( 100, 100 ),
    new Attention.VibeProfile( 30, 200 ),
    new Attention.VibeProfile( 100, 100 ),
    new Attention.VibeProfile( 30, 200 ),
    new Attention.VibeProfile( 100, 100 )
    ];

    function initialize() {
    DataField.initialize();
    lastBeep=0;
    }


    // Set your layout here. Anytime the size of obscurity of
    // the draw context is changed this will be called.
    function onLayout(dc) {
    height=dc.getHeight();
    width=dc.getWidth();
    }

    // The given info object contains all the current workout
    // information. Calculate a value and save it locally in this method.
    function compute(info) {
    if(info.timerTime==null || info.timerTime==0) {
    lastBeep=0;
    beeps=0;
    running=false;
    lastTimerTime=0;
    }
    if(info.timerTime!=null && info.timerTime!=0) {
    if(info.timerTime!=lastTimerTime) {
    running=true;
    lastTimerTime=info.timerTime;
    }
    else {running=false;}

    if(info.timerTime-lastBeep>=mseconds && running) {
    beeps++;
    lastBeep=info.timerTime;
    Attention.vibrate(vibrateDataShort);
    }
    }
    }

    // Display the value you computed here. This will be called
    // once a second when the data field is visible.
    function onUpdate(dc) {
    bgColor=getBackgroundColor();
    if(bgColor!=Gfx.COLOR_WHITE) {
    fgColor=Gfx.COLOR_WHITE;
    } else {
    fgColor=Gfx.COLOR_BLACK;
    }
    dc.setColor(bgColor,bgColor);
    dc.clear();
    dc.setColor(fgColor,bgColor);
    dc.drawText(width/2,height/2,Gfx.FONT_SMALL,"Beeps: "+beeps,Gfx.TEXT_JUSTIFY_CENTER+Gfx.TEXT_JUSTIFY_VCENTER);
    dc.drawText(width/2,2,Gfx.FONT_SMALL,"Running="+running,Gfx.TEXT_JUSTIFY_CENTER);
    }

    }

  • Hi Jim,

    thanks for updating this. In the meantime, I got it running. Problem was, that the simulator showed the right behaviour. Nevertheless, as soon as I released a new version of my datafield via Garmin connect store, my datafield also updated on the watch. At least, the mobile interface on my smartphone showed the correct version. Unfortunately the datafield was _not_ updated on the watch and I had to deinstall and reinstall the datafield.

    This is totally fine to me, but my valuable datafield users have to probably do the same and that is not nice :-(