currentpower and Datafield test

Former Member
Former Member
Hi there,

i wrote a Datafield. I use info.currentPower to display the power on the datafield. In the simulator it works fine with all watches with SDK 2.1 or 2.2 like Edge 520, but with the SDK 1.3 like Forerunner 920 the field shows always 0. Where is the problem?

And is there a way tho export the app direct to my watch. So that i can check if its works before i upload it to garmin iq?
  • Not sure what watches you've tried, but in the api doc, there are only some supported devices for currentPower:

    #currentPower ⇒ Number

    The current power in watts

    Returns:
    (Number)
    Since:
    1.0.0
    Supported Devices:
    Forerunner 735xt/920XT
    fenix 3/3 HR
    Quatix 3
    D2 Bravo/Titanium
    epix
    All Edges


    As far as testing, yes, you can sideload to do testing. See the Programmer's Guide in the SDK. Just look for the section "Side Loading an App"
  • Hey,

    The second question is the easier. In Eclipse (assuming everything is installed correctly) you should bee able to click Connect IQ> Build For Device Wizard> Select the appropriate parameters> Finish. This will create a .prg file with the name of your project in the output directory. This can be output to your computer or directly into the Device Drive\Garmin\Apps folder on your device. You can then run this on device. I have noticed that at times you may need to power cycle the 920XT for the DF to show up. I'm not sure where the problem is on the 920XT as I'm able to get power data when simulating. I'm assuming you are using the sim and not on the device yet? Could you post a bit of the code where you are trying to use it so we can see what might be going on?

    Thanks,
    Coleman
  • Former Member
    Former Member over 8 years ago
    I try the "Build For Device Wizard" for my 920XT but it was not showing in the iq data fields selection. I build a project from the examples of the sdk and it was the same, not show in the section.

    At example when i use this simple code:

    mPW = info.currentPower;
    dc.drawText(dib/2, dih*0.1, Gfx.FONT_NUMBER_MEDIUM,mPW ,Gfx.TEXT_JUSTIFY_CENTER);


    When i running it in the simulator as Edge 520 and playback a file or simulate data its showing the correct power on the display. When i running it as 920XT it shows only 0. All devices with SDK 2.1. or 2.2 (edge 520, edge 1000, ...) selectable works with this code. The watches which using SDK 1.2 or 1.3 (920 XT, fenix, ...) showing always 0.
  • I try the "Build For Device Wizard" for my 920XT but it was not showing in the iq data fields selection. I build a project from the examples of the sdk and it was the same, not show in the section.

    At example when i use this simple code:

    mPW = info.currentPower;
    dc.drawText(dib/2, dih*0.1, Gfx.FONT_NUMBER_MEDIUM,mPW ,Gfx.TEXT_JUSTIFY_CENTER);


    When i running it in the simulator as Edge 520 and playback a file or simulate data its showing the correct power on the display. When i running it as 920XT it shows only 0. All devices with SDK 2.1. or 2.2 (edge 520, edge 1000, ...) selectable works with this code. The watches which using SDK 1.2 or 1.3 (920 XT, fenix, ...) showing always 0.


    As of right now you will need to physically turn the device off and on. Exiting mass storage mode won't cause your DF to be installed. I have filed a ticket for that bug already. This might be a bug in the sim, but we won't know until we are able to test your DF on a 920 device. If you want, you can send it to us at [email][email protected][/email] along with the working project and we would be happy to dig through it.

    -Coleman
  • Former Member
    Former Member over 8 years ago
    As of right now you will need to physically turn the device off and on. Exiting mass storage mode won't cause your DF to be installed.


    Thanks that works. So i can test the datafield on my 920XT. It works on the device. But not in the simulator. Sometimes i get a Build Error "Could not find symbol currentPower. Symbol Not Found Error". Sometimes not, thats strange! But i get this error only when i try it to run as 920XT or fenix,... watch in the simulator. As Edge 500, 1000 ... i never get this error and it works fine in the simulator. With the 920XT sometimes i get the Build Error and it never works in the simulator but it works fine on the watch itself.
  • Hey thanks for digging a little more. I've checked this out on our side and it looks like it's a sim bug that's happening. I've created a ticket for the team to look at.

    Thanks,
    Coleman