This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ANT+ example code bike power from DK version 10 transmits no power, just RPM

Equipment:

  • PCA10028, latest Segger FW flashed.
  • Keil uVision MDK-Lite Version 5.17.
  • Toolchain V5.06 update 1 (build 61), all ARM (Armcc, Armasm..)
  • NRF DK Version 10, Zip file version, no Keil packs used.
  • Demo code from \examples\ant\ant_plus\ant_bpwr\bpwr_tx\wheel_torque\button\pca10028\arm5_no_packs
  • All code compiles, links and uploads fine without any errors or warnings.

Issue:

I can see the RPM, power, torque values in the data pages 16 and 17 on the serial debug console. BUT any connected bike computer shows just RPM, but power is always shown as zero. The example from SDK version 9 did work, but that was so different structured that I was not yet able to oversee the SDK version 10 example code. All configurations are as they are in the example except that I did:

#define SENSOR_TYPE (TORQUE_WHEEL)		// WEB: we build a powermeter hub, thus TORQUE_WHEEL

which seems to be not necessary as it is also defined in the project options.

I used ANTwareII to see what is transmitted and get something like this:

Received BROADCAST_DATA_0x4E
  :: 4e, 00-11-1E-7C-00-06-03-2C-AF
Received BROADCAST_DATA_0x4E
  :: 4e, 00-11-1F-7D-00-06-03-36-AF
Received BROADCAST_DATA_0x4E
  :: 4e, 00-11-20-7E-00-06-03-40-AF
Received BROADCAST_DATA_0x4E
  :: 4e, 00-11-21-7E-00-06-03-4A-AF
Received BROADCAST_DATA_0x4E
  :: 4e, 00-10-E5-00-00-00-00-00-00
Received BROADCAST_DATA_0x4E
  :: 4e, 00-11-22-7F-00-06-03-54-AF
Received BROADCAST_DATA_0x4E
  :: 4e, 00-11-23-80-00-06-03-5E-AF
Received BROADCAST_DATA_0x4E
  :: 4e, 00-11-24-80-00-06-03-68-AF
Received BROADCAST_DATA_0x4E
  :: 4e, 00-11-25-81-00-06-03-72-AF
Received BROADCAST_DATA_0x4E
  :: 4e, 00-10-E6-00-00-00-00-00-00
Received BROADCAST_DATA_0x4E
  :: 4e, 00-11-26-81-00-06-03-7C-AF
Received BROADCAST_DATA_0x4E
  :: 4e, 00-11-27-82-00-06-03-86-AF
Received BROADCAST_DATA_0x4E
  :: 4e, 00-11-28-83-00-06-03-90-AF
Received BROADCAST_DATA_0x4E
  :: 4e, 00-11-29-83-00-06-03-9A-AF
Received BROADCAST_DATA_0x4E
  :: 4e, 00-10-E7-00-00-00-00-00-00
Received BROADCAST_DATA_0x4E
  :: 4e, 00-11-2A-84-00-06-03-A4-AF

Is there any tool to "translate" this into something more readable ?

Any help in getting this resolved is very appreciated..

  • You don't need to add #define SENSOR_TYPE (TORQUE_WHEEL), the sensor type is defined as a preprocessor symbol, see Options for Target->C/C++->Preprocessor Symbols:

    SENSOR_TYPE=1

    1 is TORQUE_WHEEL

    I'm not aware of any tool to decode the data, I think you need to have a look at Section 7 and 8 in the ANT+ Device Profile Bicycle Power specification, available here.

    I tried unmodifed example now, and a simulated power is included:

    Received BROADCAST_DATA_0x4E
      :: 4e, 00-11-15-B7-03-06-03-D2-0A
    Received BROADCAST_DATA_0x4E
      :: 4e, 00-11-16-B7-03-06-03-DC-0A
    Received BROADCAST_DATA_0x4E
      :: 4e, 00-11-17-B8-03-06-03-E6-0A
    Received BROADCAST_DATA_0x4E
      :: 4e, 00-10-46-03-03-9E-07-1E-00
    Received BROADCAST_DATA_0x4E
      :: 4e, 00-11-18-B8-03-06-03-F0-0A
    Received BROADCAST_DATA_0x4E
      :: 4e, 00-11-19-B9-03-06-03-FA-0A
    Received BROADCAST_DATA_0x4E
      :: 4e, 00-11-1A-BA-03-06-03-04-0B
    Received BROADCAST_DATA_0x4E
      :: 4e, 00-11-1B-BA-03-06-03-0E-0B
    Received BROADCAST_DATA_0x4E
      :: 4e, 00-10-47-03-03-BC-07-1E-00
    

    0x10 - standard Power-Only message 0x47 - Power event count 0x03 - Pedal Power

  • Dear Petter,

    thanks for the answer. I did notice the preprocessor option as mentioned:

    "... which seems to be not necessary as it is also defined in the project options."

    I also now found the documentation and am now able to "decode" the data. So, from the raw data there seems to be power values :

     :: 4e, 00-10-72-22-22-9C-7A-54-01
    

    Bytes 4 & 5 are PedalPower and InstantCadence which are 0x22 = 34 which matches the debug output and the display on connected bike computers, as expected. The last two bytes are instant_power and 0154 ( MSB first ? ) is 340 which matches the debug output. Just, still connected bike computers show "0" as wattage.

    There seems to be some other hicckup in the ANT data stream..

    Debug output: <\n>B-PWR tx page: 16<\r> <\n>event count: 45<\n><\r> pedal power: 34 %<\n><\r> accumulated power: 7928 W<\n><\r> instantaneous power: 340 W<\n><\r> instantaneous cadence: 34 rpm<\n><\r> <\r>

    I'll try something else than "wheel torque" tomorrow and see what's happening.

    Update: Done now. With SENSOR_TYPE=0 , in the preprocessor symbols, I get power readings on connected bike computers. As expected I now only get page 16 back.

    Just for the records:

    • The reason connected bike computers do not show power is, that in ant_bpwr_simulator.c the ACCUMULATED power value is kept constant ( instead of incremented) and therefore connected computers rate that as no power. See bike power page 17 description for the "accumulated" idea. IMHO this is a small bug in the nrf example code.
    • If you want to see DECODED ANT+ data on your PC ( to not need the bike computer all the time ) : GoldenCheetah ( [http://www.goldencheetah.org/] ) can do that in conjunction with an ANT+ USB stick. The usability of that software is - well - not optimized but it is for free and it works. There are some other training SW that claim to be able to do that but all of them seem to require that you open a user account at their website which I do not want to do.
Related