john-38787364 / antifier

Convert the output from USB Tacx turbo trainers into ANT+ signals
MIT License
52 stars 20 forks source link

First results on Ubuntu with an ANT USB-m Stick #3

Closed paha77 closed 7 years ago

paha77 commented 7 years ago

I have made my first tests with my only one ANT+ stick.

The stick is successfully detected in Ubuntu:

[  474.139779] usb 2-2: new full-speed USB device number 3 using ohci-pci
[  474.436881] usb 2-2: New USB device found, idVendor=0fcf, idProduct=1009
[  474.436885] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  474.436887] usb 2-2: Product: ANT USB-m Stick
[  474.436888] usb 2-2: Manufacturer: Dynastream Innovations
[  474.436889] usb 2-2: SerialNumber: 106
[  474.518952] usbcore: registered new interface driver usbserial
[  474.519156] usbcore: registered new interface driver usbserial_generic
[  474.519349] usbserial: USB Serial support registered for generic
[  474.526000] usbcore: registered new interface driver usb_serial_simple
[  474.526056] usbserial: USB Serial support registered for carelink
[  474.526105] usbserial: USB Serial support registered for zio
[  474.526153] usbserial: USB Serial support registered for funsoft
[  474.526412] usbserial: USB Serial support registered for flashloader
[  474.526611] usbserial: USB Serial support registered for google
[  474.526880] usbserial: USB Serial support registered for vivopay
[  474.527093] usbserial: USB Serial support registered for moto_modem
[  474.527289] usbserial: USB Serial support registered for novatel_gps
[  474.527297] usbserial: USB Serial support registered for hp4x
[  474.527305] usbserial: USB Serial support registered for suunto
[  474.527312] usbserial: USB Serial support registered for siemens_mpi
[  474.527329] usb_serial_simple 2-2:1.0: suunto converter detected
[  474.528370] usb 2-2: suunto converter now attached to ttyUSB0

As I don't have a 2nd ANT+ receiver yet, I've tested the script with my Oneplus 3 Android phone which has a built in ANT+ device and the app "ANT+ Plugin Sampler" (https://play.google.com/store/apps/details?id=com.dsi.ant.antplus.pluginsampler)

Test 1 1st I've downloaded and started the fec-test.py and the output was

Calibrating...
FEC channel config...

The app on the phone has detected it as a "controllable fitness equipment" and started receiving the following data:

image

image

Test 2 I've executed install.sh and started tacx-interface.py with the following option

python ./tacx-interface.py --simulate-trainer

The app detects it again as a "controllable fitness equipment" but no data is coming from it:

image

I will order a 2nd ANT+ dongle to be able to test it with Zwift and until it arrives I'll test the tacx-interface.py script with my Fortius trainer plugged in.

Thank you for this project, it seems to be very promising.

john-38787364 commented 7 years ago

It doesn't seem to work with my Android ANT+ receiver either despite the transmission being within the ANT spec. I wonder whether the Android ANT stack needs something else. The only difference between fec-test.py and tacx-interface.py is that tacx-interface.py opens a second channel to broadcast heart rate.

Could you run tacx-interface.py again with --debug and --simulate-trainer enabled and post the console output?

paha77 commented 7 years ago

Output with --debug:

30 90 283 72
2017-10-13 19:27:37.383 GRADE 0 %
2017-10-13 19:27:37.383 RESISTANCE LEVEL 2030
2017-10-13 19:27:37.508 HEART RATE a4 09 4e 01 82 0f 01 00 00 00 01 48 27 00 00
>> a4094e01820f010000000148270000
<< a40340000103e5a40340010103e4a40340000103e5a40340010109eea40340010103e4a40340000109efa40340010103e4a40340000109efa40340000103e5a40340010109ee
30 90 283 72
2017-10-13 19:27:37.633 GRADE 0 %
2017-10-13 19:27:37.633 RESISTANCE LEVEL 2030
2017-10-13 19:27:37.633 TRAINER DATA a4 09 4e 00 19 01 5a 1b 01 1b 01 30 91 00 00
>> a4094e0019015a1b011b0130910000
<< a40340010103e4
2017-10-13 19:27:37.859 HEART RATE a4 09 4e 01 80 ff ff ff 67 01 02 48 b1 00 00
>> a4094e0180ffffff67010248b10000
<< a40340000103e5
30 90 283 72
2017-10-13 19:27:37.960 GRADE 0 %
2017-10-13 19:27:37.960 RESISTANCE LEVEL 2030
2017-10-13 19:27:37.961 TRAINER DATA a4 09 4e 00 19 02 5a 36 02 1b 01 30 bc 00 00
>> a4094e0019025a36021b0130bc0000
<< a40340010103e4a40340000103e5
2017-10-13 19:27:38.187 HEART RATE a4 09 4e 01 80 ff ff ff b7 02 03 48 63 00 00
>> a4094e0180ffffffb7020348630000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:38.288 GRADE 0 %
2017-10-13 19:27:38.288 RESISTANCE LEVEL 2030
2017-10-13 19:27:38.288 FE DATA a4 09 4e 00 10 19 03 1b 30 75 00 30 87 00 00
2017-10-13 19:27:38.413 HEART RATE a4 09 4e 01 80 ff ff ff 9f 03 04 48 4d 00 00
>> a4094e0180ffffff9f0304484d0000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:38.539 GRADE 0 %
2017-10-13 19:27:38.539 RESISTANCE LEVEL 2030
2017-10-13 19:27:38.539 TRAINER DATA a4 09 4e 00 19 04 5a 51 03 1b 01 30 dc 00 00
>> a4094e0019045a51031b0130dc0000
<< 
2017-10-13 19:27:38.765 HEART RATE a4 09 4e 01 00 ff ff ff 07 05 05 48 52 00 00
>> a4094e0100ffffff07050548520000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:38.867 GRADE 0 %
2017-10-13 19:27:38.867 RESISTANCE LEVEL 2030
2017-10-13 19:27:38.867 TRAINER DATA a4 09 4e 00 19 05 5a 6c 04 1b 01 30 e7 00 00
>> a4094e0019055a6c041b0130e70000
<< a40340010103e4
2017-10-13 19:27:39.093 HEART RATE a4 09 4e 01 00 ff ff ff 56 06 06 48 03 00 00
>> a4094e0100ffffff56060648030000
<< a40340000103e5
30 90 283 72
2017-10-13 19:27:39.194 GRADE 0 %
2017-10-13 19:27:39.194 RESISTANCE LEVEL 2030
2017-10-13 19:27:39.194 FE DATA a4 09 4e 00 10 19 07 36 30 75 00 30 ae 00 00
2017-10-13 19:27:39.319 HEART RATE a4 09 4e 01 00 ff ff ff 3e 07 07 48 6b 00 00
>> a4094e0100ffffff3e0707486b0000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:39.444 GRADE 0 %
2017-10-13 19:27:39.444 RESISTANCE LEVEL 2030
2017-10-13 19:27:39.444 TRAINER DATA a4 09 4e 00 19 07 5a 87 05 1b 01 30 0f 00 00
>> a4094e0019075a87051b01300f0000
<< a40340010103e4a40340000103e5
2017-10-13 19:27:39.671 HEART RATE a4 09 4e 01 00 ff ff ff a6 08 08 48 f3 00 00
>> a4094e0100ffffffa6080848f30000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:39.772 GRADE 0 %
2017-10-13 19:27:39.772 RESISTANCE LEVEL 2030
2017-10-13 19:27:39.772 TRAINER DATA a4 09 4e 00 19 08 5a a2 06 1b 01 30 26 00 00
>> a4094e0019085aa2061b0130260000
<< 
2017-10-13 19:27:39.998 HEART RATE a4 09 4e 01 80 ff ff ff f5 09 09 48 20 00 00
>> a4094e0180fffffff5090948200000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:40.100 GRADE 0 %
2017-10-13 19:27:40.100 RESISTANCE LEVEL 2030
2017-10-13 19:27:40.100 FE DATA a4 09 4e 00 10 19 0a 51 30 75 00 30 c4 00 00
2017-10-13 19:27:40.226 HEART RATE a4 09 4e 01 80 ff ff ff de 0a 0a 48 0b 00 00
>> a4094e0180ffffffde0a0a480b0000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:40.350 GRADE 0 %
2017-10-13 19:27:40.351 RESISTANCE LEVEL 2030
2017-10-13 19:27:40.351 TRAINER DATA a4 09 4e 00 19 0a 5a bd 07 1b 01 30 3a 00 00
>> a4094e00190a5abd071b01303a0000
<< a40340010103e4
2017-10-13 19:27:40.577 HEART RATE a4 09 4e 01 80 ff ff ff 46 0c 0b 48 94 00 00
>> a4094e0180ffffff460c0b48940000
<< a40340000103e5
30 90 283 72
2017-10-13 19:27:40.677 GRADE 0 %
2017-10-13 19:27:40.677 RESISTANCE LEVEL 2030
2017-10-13 19:27:40.678 TRAINER DATA a4 09 4e 00 19 0b 5a d8 08 1b 01 30 51 00 00
>> a4094e00190b5ad8081b0130510000
<< a40340010103e4a40340000103e5
2017-10-13 19:27:40.904 HEART RATE a4 09 4e 01 80 ff ff ff 95 0d 0c 48 41 00 00
>> a4094e0180ffffff950d0c48410000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:41.005 GRADE 0 %
2017-10-13 19:27:41.005 RESISTANCE LEVEL 2030
2017-10-13 19:27:41.005 FE DATA a4 09 4e 00 10 19 0e 6c 30 75 00 30 fd 00 00
2017-10-13 19:27:41.131 HEART RATE a4 09 4e 01 00 ff ff ff 7e 0e 0d 48 28 00 00
>> a4094e0100ffffff7e0e0d48280000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:41.256 GRADE 0 %
2017-10-13 19:27:41.256 RESISTANCE LEVEL 2030
2017-10-13 19:27:41.256 TRAINER DATA a4 09 4e 00 19 0d 5a f3 09 1b 01 30 7d 00 00
>> a4094e00190d5af3091b01307d0000
<< 
2017-10-13 19:27:41.483 HEART RATE a4 09 4e 01 00 ff ff ff e6 0f 0e 48 b2 00 00
>> a4094e0100ffffffe60f0e48b20000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:41.584 GRADE 0 %
2017-10-13 19:27:41.584 RESISTANCE LEVEL 2030
2017-10-13 19:27:41.584 TRAINER DATA a4 09 4e 00 19 0e 5a 0e 0b 1b 01 30 81 00 00
>> a4094e00190e5a0e0b1b0130810000
<< a40340010103e4
2017-10-13 19:27:41.811 HEART RATE a4 09 4e 01 00 ff ff ff 35 11 0f 48 7e 00 00
>> a4094e0100ffffff35110f487e0000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:41.912 GRADE 0 %
2017-10-13 19:27:41.912 RESISTANCE LEVEL 2030
2017-10-13 19:27:41.912 FE DATA a4 09 4e 00 10 19 12 87 30 75 00 30 0a 00 00
2017-10-13 19:27:42.038 HEART RATE a4 09 4e 01 00 ff ff ff 1e 12 10 48 49 00 00
>> a4094e0100ffffff1e121048490000
<< a40340000103e5
30 90 283 72
2017-10-13 19:27:42.162 GRADE 0 %
2017-10-13 19:27:42.162 RESISTANCE LEVEL 2030
2017-10-13 19:27:42.163 TRAINER DATA a4 09 4e 00 19 10 5a 29 0c 1b 01 30 bf 00 00
>> a4094e0019105a290c1b0130bf0000
<< a40340010103e4a40340000103e5
2017-10-13 19:27:42.390 HEART RATE a4 09 4e 01 80 ff ff ff 86 13 11 48 51 00 00
>> a4094e0180ffffff86131148510000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:42.490 GRADE 0 %
2017-10-13 19:27:42.491 RESISTANCE LEVEL 2030
2017-10-13 19:27:42.491 TRAINER DATA a4 09 4e 00 19 11 5a 44 0d 1b 01 30 d2 00 00
>> a4094e0019115a440d1b0130d20000
<< 
2017-10-13 19:27:42.718 HEART RATE a4 09 4e 01 80 ff ff ff d6 14 12 48 05 00 00
>> a4094e0180ffffffd6141248050000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:42.819 GRADE 0 %
2017-10-13 19:27:42.819 RESISTANCE LEVEL 2030
2017-10-13 19:27:42.819 FE DATA a4 09 4e 00 10 19 15 a3 30 75 00 30 29 00 00
2017-10-13 19:27:42.945 HEART RATE a4 09 4e 01 80 ff ff ff bf 15 13 48 6c 00 00
>> a4094e0180ffffffbf1513486c0000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:43.070 GRADE 0 %
2017-10-13 19:27:43.070 RESISTANCE LEVEL 2030
2017-10-13 19:27:43.070 TRAINER DATA a4 09 4e 00 19 13 5a 5f 0e 1b 01 30 c8 00 00
>> a4094e0019135a5f0e1b0130c80000
<< a40340010103e4
2017-10-13 19:27:43.297 HEART RATE a4 09 4e 01 80 ff ff ff 27 17 14 48 f1 00 00
>> a4094e0180ffffff27171448f10000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:43.398 GRADE 0 %
2017-10-13 19:27:43.398 RESISTANCE LEVEL 2030
2017-10-13 19:27:43.398 TRAINER DATA a4 09 4e 00 19 14 5a 7a 0f 1b 01 30 eb 00 00
>> a4094e0019145a7a0f1b0130eb0000
<< a40340000103e5
2017-10-13 19:27:43.625 HEART RATE a4 09 4e 01 00 ff ff ff 77 18 15 48 2f 00 00
>> a4094e0100ffffff771815482f0000
<< a40340010103e4
30 90 283 72
2017-10-13 19:27:43.726 GRADE 0 %
2017-10-13 19:27:43.726 RESISTANCE LEVEL 2030
2017-10-13 19:27:43.726 FE DATA a4 09 4e 00 10 19 19 be 30 75 00 30 38 00 00
2017-10-13 19:27:43.852 HEART RATE a4 09 4e 01 00 ff ff ff 5f 19 16 48 05 00 00
>> a4094e0100ffffff5f191648050000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:43.976 GRADE 0 %
2017-10-13 19:27:43.976 RESISTANCE LEVEL 2030
2017-10-13 19:27:43.977 TRAINER DATA a4 09 4e 00 19 16 5a 95 10 1b 01 30 19 00 00
>> a4094e0019165a95101b0130190000
<< a40340000103e5
2017-10-13 19:27:44.204 HEART RATE a4 09 4e 01 00 ff ff ff c8 1a 17 48 90 00 00
>> a4094e0100ffffffc81a1748900000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:44.305 GRADE 0 %
2017-10-13 19:27:44.305 RESISTANCE LEVEL 2030
2017-10-13 19:27:44.305 TRAINER DATA a4 09 4e 00 19 17 5a b0 11 1b 01 30 3c 00 00
>> a4094e0019175ab0111b01303c0000
<< a40340010103e4
2017-10-13 19:27:44.532 HEART RATE a4 09 4e 01 00 ff ff ff 18 1c 18 48 49 00 00
>> a4094e0100ffffff181c1848490000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:44.633 GRADE 0 %
2017-10-13 19:27:44.633 RESISTANCE LEVEL 2030
2017-10-13 19:27:44.633 FE DATA a4 09 4e 00 10 19 1d d9 30 75 00 30 5b 00 00
2017-10-13 19:27:44.758 HEART RATE a4 09 4e 01 80 ff ff ff 00 1d 19 48 d1 00 00
>> a4094e0180ffffff001d1948d10000
<< a40340000103e5
30 90 283 72
2017-10-13 19:27:44.883 GRADE 0 %
2017-10-13 19:27:44.883 RESISTANCE LEVEL 2030
2017-10-13 19:27:44.884 TRAINER DATA a4 09 4e 00 19 19 5a cb 12 1b 01 30 4a 00 00
>> a4094e0019195acb121b01304a0000
<< a40340010103e4a40340000103e5
2017-10-13 19:27:45.110 HEART RATE a4 09 4e 01 80 ff ff ff 68 1e 1a 48 b9 00 00
>> a4094e0180ffffff681e1a48b90000
<< a40340010103e4
30 90 283 72
2017-10-13 19:27:45.211 GRADE 0 %
2017-10-13 19:27:45.211 RESISTANCE LEVEL 2030
2017-10-13 19:27:45.211 TRAINER DATA a4 09 4e 00 19 1a 5a e6 13 1b 01 30 65 00 00
>> a4094e00191a5ae6131b0130650000
<< a40340000103e5
2017-10-13 19:27:45.437 HEART RATE a4 09 4e 01 80 ff ff ff b7 1f 1b 48 66 00 00
>> a4094e0180ffffffb71f1b48660000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:45.538 GRADE 0 %
2017-10-13 19:27:45.538 RESISTANCE LEVEL 2030
2017-10-13 19:27:45.538 FE DATA a4 09 4e 00 10 19 20 f4 30 75 00 30 4b 00 00
2017-10-13 19:27:45.664 HEART RATE a4 09 4e 01 80 ff ff ff 9f 20 1c 48 76 00 00
>> a4094e0180ffffff9f201c48760000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:45.789 GRADE 0 %
2017-10-13 19:27:45.789 RESISTANCE LEVEL 2030
2017-10-13 19:27:45.789 TRAINER DATA a4 09 4e 00 19 1c 5a 01 15 1b 01 30 82 00 00
>> a4094e00191c5a01151b0130820000
<< a40340010103e4
2017-10-13 19:27:46.016 HEART RATE a4 09 4e 01 00 ff ff ff 08 22 1d 48 62 00 00
>> a4094e0100ffffff08221d48620000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:46.117 GRADE 0 %
2017-10-13 19:27:46.118 RESISTANCE LEVEL 2030
2017-10-13 19:27:46.118 TRAINER DATA a4 09 4e 00 19 1d 5a 1c 16 1b 01 30 9d 00 00
>> a4094e00191d5a1c161b01309d0000
<< 
2017-10-13 19:27:46.345 HEART RATE a4 09 4e 01 00 ff ff ff 57 23 1e 48 3f 00 00
>> a4094e0100ffffff57231e483f0000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:46.446 GRADE 0 %
2017-10-13 19:27:46.446 RESISTANCE LEVEL 2030
2017-10-13 19:27:46.446 FE DATA a4 09 4e 00 10 19 24 00 30 75 00 30 bb 00 00
2017-10-13 19:27:46.572 HEART RATE a4 09 4e 01 00 ff ff ff 40 24 1f 48 2e 00 00
>> a4094e0100ffffff40241f482e0000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:46.696 GRADE 0 %
2017-10-13 19:27:46.696 RESISTANCE LEVEL 2030
2017-10-13 19:27:46.697 TRAINER DATA a4 09 4e 00 19 1f 5a 37 17 1b 01 30 b5 00 00
>> a4094e00191f5a37171b0130b50000
<< a40340000103e5
2017-10-13 19:27:46.923 HEART RATE a4 09 4e 01 00 ff ff ff a8 25 20 48 f8 00 00
>> a4094e0100ffffffa8252048f80000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:47.024 GRADE 0 %
2017-10-13 19:27:47.024 RESISTANCE LEVEL 2030
2017-10-13 19:27:47.024 TRAINER DATA a4 09 4e 00 19 20 5a 52 18 1b 01 30 e0 00 00
>> a4094e0019205a52181b0130e00000
<< a40340010103e4
2017-10-13 19:27:47.251 HEART RATE a4 09 4e 01 80 ff ff ff f8 26 21 48 2a 00 00
>> a4094e0180fffffff82621482a0000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:47.352 GRADE 0 %
2017-10-13 19:27:47.352 RESISTANCE LEVEL 2030
2017-10-13 19:27:47.478 HEART RATE a4 09 4e 01 83 01 01 33 e0 27 22 48 ff 00 00
>> a4094e0183010133e0272248ff0000
<< a40340000103e5
30 90 283 72
2017-10-13 19:27:47.603 GRADE 0 %
2017-10-13 19:27:47.603 RESISTANCE LEVEL 2030
2017-10-13 19:27:47.728 HEART RATE a4 09 4e 01 83 01 01 33 e1 28 23 48 f0 00 00
>> a4094e0183010133e1282348f00000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:47.853 GRADE 0 %
2017-10-13 19:27:47.853 RESISTANCE LEVEL 2030
2017-10-13 19:27:47.853 TRAINER DATA a4 09 4e 00 19 23 5a 6d 19 1b 01 30 dd 00 00
>> a4094e0019235a6d191b0130dd0000
<< a40340010103e4
2017-10-13 19:27:48.080 HEART RATE a4 09 4e 01 80 ff ff ff 49 2a 24 48 92 00 00
>> a4094e0180ffffff492a2448920000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:48.181 GRADE 0 %
2017-10-13 19:27:48.181 RESISTANCE LEVEL 2030
2017-10-13 19:27:48.181 FE DATA a4 09 4e 00 10 19 2b 34 30 75 00 30 80 00 00
2017-10-13 19:27:48.306 HEART RATE a4 09 4e 01 00 ff ff ff 31 2b 25 48 6a 00 00
>> a4094e0100ffffff312b25486a0000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:48.432 GRADE 0 %
2017-10-13 19:27:48.432 RESISTANCE LEVEL 2030
2017-10-13 19:27:48.432 TRAINER DATA a4 09 4e 00 19 25 5a 88 1a 1b 01 30 3d 00 00
>> a4094e0019255a881a1b01303d0000
<< a40340000103e5
2017-10-13 19:27:48.659 HEART RATE a4 09 4e 01 00 ff ff ff 9a 2c 26 48 c5 00 00
>> a4094e0100ffffff9a2c2648c50000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:48.760 GRADE 0 %
2017-10-13 19:27:48.760 RESISTANCE LEVEL 2030
2017-10-13 19:27:48.760 TRAINER DATA a4 09 4e 00 19 26 5a a3 1b 1b 01 30 14 00 00
>> a4094e0019265aa31b1b0130140000
<< a40340010103e4
2017-10-13 19:27:48.986 HEART RATE a4 09 4e 01 00 ff ff ff e9 2d 27 48 b6 00 00
>> a4094e0100ffffffe92d2748b60000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:49.087 GRADE 0 %
2017-10-13 19:27:49.087 RESISTANCE LEVEL 2030
2017-10-13 19:27:49.087 FE DATA a4 09 4e 00 10 19 2e 4f 30 75 00 30 fe 00 00
2017-10-13 19:27:49.213 HEART RATE a4 09 4e 01 00 ff ff ff d1 2e 28 48 82 00 00
>> a4094e0100ffffffd12e2848820000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:49.338 GRADE 0 %
2017-10-13 19:27:49.338 RESISTANCE LEVEL 2030
2017-10-13 19:27:49.338 TRAINER DATA a4 09 4e 00 19 28 5a be 1c 1b 01 30 00 00 00
>> a4094e0019285abe1c1b0130000000
<< 
2017-10-13 19:27:49.564 HEART RATE a4 09 4e 01 80 ff ff ff 39 30 29 48 f5 00 00
>> a4094e0180ffffff39302948f50000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:49.665 GRADE 0 %
2017-10-13 19:27:49.665 RESISTANCE LEVEL 2030
2017-10-13 19:27:49.666 TRAINER DATA a4 09 4e 00 19 29 5a d9 1d 1b 01 30 67 00 00
>> a4094e0019295ad91d1b0130670000
<< a40340000103e5
2017-10-13 19:27:49.892 HEART RATE a4 09 4e 01 80 ff ff ff 89 31 2a 48 47 00 00
>> a4094e0180ffffff89312a48470000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:49.993 GRADE 0 %
2017-10-13 19:27:49.994 RESISTANCE LEVEL 2030
2017-10-13 19:27:49.994 FE DATA a4 09 4e 00 10 19 32 6a 30 75 00 30 c7 00 00
2017-10-13 19:27:50.119 HEART RATE a4 09 4e 01 80 ff ff ff 71 32 2b 48 bd 00 00
>> a4094e0180ffffff71322b48bd0000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:50.244 GRADE 0 %
2017-10-13 19:27:50.244 RESISTANCE LEVEL 2030
2017-10-13 19:27:50.244 TRAINER DATA a4 09 4e 00 19 2b 5a f4 1e 1b 01 30 4b 00 00
>> a4094e00192b5af41e1b01304b0000
<< a40340010103e4
2017-10-13 19:27:50.471 HEART RATE a4 09 4e 01 80 ff ff ff d9 33 2c 48 13 00 00
>> a4094e0180ffffffd9332c48130000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:50.571 GRADE 0 %
2017-10-13 19:27:50.571 RESISTANCE LEVEL 2030
2017-10-13 19:27:50.572 TRAINER DATA a4 09 4e 00 19 2c 5a 0f 20 1b 01 30 89 00 00
>> a4094e00192c5a0f201b0130890000
<< 
2017-10-13 19:27:50.798 HEART RATE a4 09 4e 01 00 ff ff ff 29 35 2d 48 64 00 00
>> a4094e0100ffffff29352d48640000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:50.899 GRADE 0 %
2017-10-13 19:27:50.899 RESISTANCE LEVEL 2030
2017-10-13 19:27:50.899 FE DATA a4 09 4e 00 10 19 36 85 30 75 00 30 2c 00 00
2017-10-13 19:27:51.025 HEART RATE a4 09 4e 01 00 ff ff ff 11 36 2e 48 5c 00 00
>> a4094e0100ffffff11362e485c0000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:51.150 GRADE 0 %
2017-10-13 19:27:51.150 RESISTANCE LEVEL 2030
2017-10-13 19:27:51.150 TRAINER DATA a4 09 4e 00 19 2e 5a 2a 21 1b 01 30 af 00 00
>> a4094e00192e5a2a211b0130af0000
<< a40340000103e5
2017-10-13 19:27:51.377 HEART RATE a4 09 4e 01 00 ff ff ff 79 37 2f 48 34 00 00
>> a4094e0100ffffff79372f48340000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:51.478 GRADE 0 %
2017-10-13 19:27:51.478 RESISTANCE LEVEL 2030
2017-10-13 19:27:51.478 TRAINER DATA a4 09 4e 00 19 2f 5a 45 22 1b 01 30 c2 00 00
>> a4094e00192f5a45221b0130c20000
<< a40340010103e4
2017-10-13 19:27:51.704 HEART RATE a4 09 4e 01 00 ff ff ff c8 38 30 48 95 00 00
>> a4094e0100ffffffc8383048950000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:51.805 GRADE 0 %
2017-10-13 19:27:51.805 RESISTANCE LEVEL 2030
2017-10-13 19:27:51.805 FE DATA a4 09 4e 00 10 19 39 a0 30 75 00 30 06 00 00
2017-10-13 19:27:51.931 HEART RATE a4 09 4e 01 80 ff ff ff b0 39 31 48 6d 00 00
>> a4094e0180ffffffb03931486d0000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:52.055 GRADE 0 %
2017-10-13 19:27:52.056 RESISTANCE LEVEL 2030
2017-10-13 19:27:52.056 TRAINER DATA a4 09 4e 00 19 31 5a 60 23 1b 01 30 f8 00 00
>> a4094e0019315a60231b0130f80000
<< 
2017-10-13 19:27:52.283 HEART RATE a4 09 4e 01 80 ff ff ff 19 3b 32 48 c5 00 00
>> a4094e0180ffffff193b3248c50000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:52.384 GRADE 0 %
2017-10-13 19:27:52.384 RESISTANCE LEVEL 2030
2017-10-13 19:27:52.384 TRAINER DATA a4 09 4e 00 19 32 5a 7b 24 1b 01 30 e7 00 00
>> a4094e0019325a7b241b0130e70000
<< a40340000103e5
2017-10-13 19:27:52.611 HEART RATE a4 09 4e 01 80 ff ff ff 69 3c 33 48 b3 00 00
>> a4094e0180ffffff693c3348b30000
<< a40340010103e4
30 90 283 72
2017-10-13 19:27:52.712 GRADE 0 %
2017-10-13 19:27:52.712 RESISTANCE LEVEL 2030
2017-10-13 19:27:52.712 FE DATA a4 09 4e 00 10 19 3d bb 30 75 00 30 19 00 00
2017-10-13 19:27:52.838 HEART RATE a4 09 4e 01 80 ff ff ff 51 3d 34 48 8d 00 00
>> a4094e0180ffffff513d34488d0000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:52.963 GRADE 0 %
2017-10-13 19:27:52.963 RESISTANCE LEVEL 2030
2017-10-13 19:27:52.963 TRAINER DATA a4 09 4e 00 19 34 5a 96 25 1b 01 30 0d 00 00
>> a4094e0019345a96251b01300d0000
<< a40340000103e5a40340010103e4
2017-10-13 19:27:53.190 HEART RATE a4 09 4e 01 00 ff ff ff ba 3e 35 48 e4 00 00
>> a4094e0100ffffffba3e3548e40000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:53.292 GRADE 0 %
2017-10-13 19:27:53.292 RESISTANCE LEVEL 2030
2017-10-13 19:27:53.292 TRAINER DATA a4 09 4e 00 19 35 5a b1 26 1b 01 30 28 00 00
>> a4094e0019355ab1261b0130280000
<< 
2017-10-13 19:27:53.519 HEART RATE a4 09 4e 01 00 ff ff ff 0a 40 36 48 29 00 00
>> a4094e0100ffffff0a403648290000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:53.620 GRADE 0 %
2017-10-13 19:27:53.620 RESISTANCE LEVEL 2030
2017-10-13 19:27:53.620 FE DATA a4 09 4e 00 10 19 40 d7 30 75 00 30 08 00 00
2017-10-13 19:27:53.745 HEART RATE a4 09 4e 01 00 ff ff ff f3 40 37 48 d1 00 00
>> a4094e0100fffffff3403748d10000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:53.870 GRADE 0 %
2017-10-13 19:27:53.870 RESISTANCE LEVEL 2030
2017-10-13 19:27:53.870 TRAINER DATA a4 09 4e 00 19 37 5a cc 27 1b 01 30 56 00 00
>> a4094e0019375acc271b0130560000
<< a40340000103e5
2017-10-13 19:27:54.096 HEART RATE a4 09 4e 01 00 ff ff ff 5a 42 38 48 75 00 00
>> a4094e0100ffffff5a423848750000
<< a40340010103e4
30 90 283 72
2017-10-13 19:27:54.198 GRADE 0 %
2017-10-13 19:27:54.198 RESISTANCE LEVEL 2030
2017-10-13 19:27:54.198 TRAINER DATA a4 09 4e 00 19 38 5a e7 28 1b 01 30 7d 00 00
>> a4094e0019385ae7281b01307d0000
<< a40340000103e5a40340010103e4
2017-10-13 19:27:54.424 HEART RATE a4 09 4e 01 80 ff ff ff aa 43 39 48 05 00 00
>> a4094e0180ffffffaa433948050000
<< a40340000103e5a40340010103e4
30 90 283 72
2017-10-13 19:27:54.526 GRADE 0 %
2017-10-13 19:27:54.526 RESISTANCE LEVEL 2030
2017-10-13 19:27:54.526 FE DATA a4 09 4e 00 10 19 44 f2 30 75 00 30 29 00 00
2017-10-13 19:27:54.651 HEART RATE a4 09 4e 01 80 ff ff ff 92 44 3a 48 39 00 00
>> a4094e0180ffffff92443a48390000
<< a40340000103e5a40340010109ee
30 90 283 72
2017-10-13 19:27:54.776 GRADE 0 %
2017-10-13 19:27:54.776 RESISTANCE LEVEL 2030
2017-10-13 19:27:54.776 TRAINER DATA a4 09 4e 00 19 3a 5a 02 2a 1b 01 30 98 00 00
>> a4094e00193a5a022a1b0130980000
<< 
2017-10-13 19:27:55.003 HEART RATE a4 09 4e 01 80 ff ff ff fb 45 3b 48 50 00 00
>> a4094e0180fffffffb453b48500000
<< a40340010103e4a40340000109ef
30 90 283 72
2017-10-13 19:27:55.104 GRADE 0 %
2017-10-13 19:27:55.104 RESISTANCE LEVEL 2030
2017-10-13 19:27:55.105 TRAINER DATA a4 09 4e 00 19 3b 5a 1d 2b 1b 01 30 87 00 00
>> a4094e00193b5a1d2b1b0130870000
<< 
2017-10-13 19:27:55.332 HEART RATE a4 09 4e 01 80 ff ff ff 4a 47 3c 48 e4 00 00
>> a4094e0180ffffff4a473c48e40000
<< a40340010103e4a40340000109ef
30 90 283 72
2017-10-13 19:27:55.432 GRADE 0 %
2017-10-13 19:27:55.433 RESISTANCE LEVEL 2030
2017-10-13 19:27:55.433 FE DATA a4 09 4e 00 10 19 48 00 30 75 00 30 d7 00 00
2017-10-13 19:27:55.558 HEART RATE a4 09 4e 01 00 ff ff ff 33 48 3d 48 13 00 00
>> a4094e0100ffffff33483d48130000
<< a40340000103e5a40340010109ee
30 90 283 72
2017-10-13 19:27:55.683 GRADE 0 %
2017-10-13 19:27:55.683 RESISTANCE LEVEL 2030
2017-10-13 19:27:55.683 TRAINER DATA a4 09 4e 00 19 3d 5a 38 2c 1b 01 30 a3 00 00
>> a4094e00193d5a382c1b0130a30000
<< a40340010103e4a40340000103e5
2017-10-13 19:27:55.910 HEART RATE a4 09 4e 01 00 ff ff ff 9b 49 3e 48 b9 00 00
>> a4094e0100ffffff9b493e48b90000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:56.011 GRADE 0 %
2017-10-13 19:27:56.011 RESISTANCE LEVEL 2030
2017-10-13 19:27:56.011 TRAINER DATA a4 09 4e 00 19 3e 5a 53 2d 1b 01 30 ca 00 00
>> a4094e00193e5a532d1b0130ca0000
<< 
2017-10-13 19:27:56.237 HEART RATE a4 09 4e 01 00 ff ff ff ea 4a 3f 48 ca 00 00
>> a4094e0100ffffffea4a3f48ca0000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:56.339 GRADE 0 %
2017-10-13 19:27:56.339 RESISTANCE LEVEL 2030
2017-10-13 19:27:56.339 FE DATA a4 09 4e 00 10 19 4b 1b 30 75 00 30 cf 00 00
2017-10-13 19:27:56.465 HEART RATE a4 09 4e 01 00 ff ff ff d3 4b 40 48 8d 00 00
>> a4094e0100ffffffd34b40488d0000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:56.589 GRADE 0 %
2017-10-13 19:27:56.589 RESISTANCE LEVEL 2030
2017-10-13 19:27:56.590 TRAINER DATA a4 09 4e 00 19 40 5a 6e 2e 1b 01 30 8a 00 00
>> a4094e0019405a6e2e1b01308a0000
<< a40340010103e4
2017-10-13 19:27:56.816 HEART RATE a4 09 4e 01 80 ff ff ff 3b 4d 41 48 e2 00 00
>> a4094e0180ffffff3b4d4148e20000
<< a40340000103e5
30 90 283 72
2017-10-13 19:27:56.917 GRADE 0 %
2017-10-13 19:27:56.917 RESISTANCE LEVEL 2030
2017-10-13 19:27:57.043 HEART RATE a4 09 4e 01 82 0f 01 00 23 4e 42 48 09 00 00
>> a4094e01820f0100234e4248090000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:57.168 GRADE 0 %
2017-10-13 19:27:57.168 RESISTANCE LEVEL 2030
2017-10-13 19:27:57.294 HEART RATE a4 09 4e 01 82 0f 01 00 24 4f 43 48 0e 00 00
>> a4094e01820f0100244f43480e0000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:57.418 GRADE 0 %
2017-10-13 19:27:57.418 RESISTANCE LEVEL 2030
2017-10-13 19:27:57.418 TRAINER DATA a4 09 4e 00 19 43 5a 89 2f 1b 01 30 6f 00 00
>> a4094e0019435a892f1b01306f0000
<< a40340010103e4a40340000103e5
2017-10-13 19:27:57.645 HEART RATE a4 09 4e 01 80 ff ff ff 8c 50 44 48 4d 00 00
>> a4094e0180ffffff8c5044484d0000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:57.746 GRADE 0 %
2017-10-13 19:27:57.746 RESISTANCE LEVEL 2030
2017-10-13 19:27:57.746 TRAINER DATA a4 09 4e 00 19 44 5a a4 30 1b 01 30 5a 00 00
>> a4094e0019445aa4301b01305a0000
<< 
2017-10-13 19:27:57.973 HEART RATE a4 09 4e 01 00 ff ff ff db 51 45 48 9a 00 00
>> a4094e0100ffffffdb5145489a0000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:58.074 GRADE 0 %
2017-10-13 19:27:58.074 RESISTANCE LEVEL 2030
2017-10-13 19:27:58.074 FE DATA a4 09 4e 00 10 19 52 4f 30 75 00 30 82 00 00
2017-10-13 19:27:58.200 HEART RATE a4 09 4e 01 00 ff ff ff c4 52 46 48 85 00 00
>> a4094e0100ffffffc4524648850000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:58.325 GRADE 0 %
2017-10-13 19:27:58.325 RESISTANCE LEVEL 2030
2017-10-13 19:27:58.325 TRAINER DATA a4 09 4e 00 19 46 5a bf 31 1b 01 30 42 00 00
>> a4094e0019465abf311b0130420000
<< a40340010103e4
2017-10-13 19:27:58.551 HEART RATE a4 09 4e 01 00 ff ff ff 2c 54 47 48 6a 00 00
>> a4094e0100ffffff2c5447486a0000
<< a40340000103e5
30 90 283 72
2017-10-13 19:27:58.653 GRADE 0 %
2017-10-13 19:27:58.653 RESISTANCE LEVEL 2030
2017-10-13 19:27:58.653 TRAINER DATA a4 09 4e 00 19 47 5a da 32 1b 01 30 25 00 00
>> a4094e0019475ada321b0130250000
<< a40340010103e4a40340000103e5
2017-10-13 19:27:58.880 HEART RATE a4 09 4e 01 00 ff ff ff 7c 55 48 48 34 00 00
>> a4094e0100ffffff7c554848340000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:58.981 GRADE 0 %
2017-10-13 19:27:58.981 RESISTANCE LEVEL 2030
2017-10-13 19:27:58.981 FE DATA a4 09 4e 00 10 19 56 6a 30 75 00 30 a3 00 00
2017-10-13 19:27:59.106 HEART RATE a4 09 4e 01 80 ff ff ff 64 56 49 48 ae 00 00
>> a4094e0180ffffff64564948ae0000
<< a40340010103e4
30 90 283 72
2017-10-13 19:27:59.232 GRADE 0 %
2017-10-13 19:27:59.232 RESISTANCE LEVEL 2030
2017-10-13 19:27:59.232 TRAINER DATA a4 09 4e 00 19 49 5a f5 33 1b 01 30 05 00 00
>> a4094e0019495af5331b0130050000
<< a40340000103e5
2017-10-13 19:27:59.458 HEART RATE a4 09 4e 01 80 ff ff ff cd 57 4a 48 05 00 00
>> a4094e0180ffffffcd574a48050000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:27:59.559 GRADE 0 %
2017-10-13 19:27:59.559 RESISTANCE LEVEL 2030
2017-10-13 19:27:59.560 TRAINER DATA a4 09 4e 00 19 4a 5a 10 35 1b 01 30 e5 00 00
>> a4094e00194a5a10351b0130e50000
<< a40340010103e4
2017-10-13 19:27:59.786 HEART RATE a4 09 4e 01 80 ff ff ff 1d 59 4b 48 da 00 00
>> a4094e0180ffffff1d594b48da0000
<< a40340000103e5
30 90 283 72
2017-10-13 19:27:59.887 GRADE 0 %
2017-10-13 19:27:59.887 RESISTANCE LEVEL 2030
2017-10-13 19:27:59.887 FE DATA a4 09 4e 00 10 19 5a 85 30 75 00 30 40 00 00
2017-10-13 19:28:00.013 HEART RATE a4 09 4e 01 80 ff ff ff 05 5a 4c 48 c6 00 00
>> a4094e0180ffffff055a4c48c60000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:28:00.138 GRADE 0 %
2017-10-13 19:28:00.138 RESISTANCE LEVEL 2030
2017-10-13 19:28:00.138 TRAINER DATA a4 09 4e 00 19 4c 5a 2b 36 1b 01 30 db 00 00
>> a4094e00194c5a2b361b0130db0000
<< a40340010103e4a40340000103e5
2017-10-13 19:28:00.364 HEART RATE a4 09 4e 01 00 ff ff ff 6c 5b 4d 48 2f 00 00
>> a4094e0100ffffff6c5b4d482f0000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:28:00.466 GRADE 0 %
2017-10-13 19:28:00.466 RESISTANCE LEVEL 2030
2017-10-13 19:28:00.466 TRAINER DATA a4 09 4e 00 19 4d 5a 46 37 1b 01 30 b6 00 00
>> a4094e00194d5a46371b0130b60000
<< 
2017-10-13 19:28:00.692 HEART RATE a4 09 4e 01 00 ff ff ff bc 5c 4e 48 fb 00 00
>> a4094e0100ffffffbc5c4e48fb0000
<< a40340010103e4a40340000103e5
30 90 283 72
2017-10-13 19:28:00.793 GRADE 0 %
2017-10-13 19:28:00.793 RESISTANCE LEVEL 2030
2017-10-13 19:28:00.793 FE DATA a4 09 4e 00 10 19 5d a0 30 75 00 30 62 00 00
paha77 commented 7 years ago

But no worries it seems like that the app I was testing on was buggy. I've downloaded the app TrainerRoad (https://play.google.com/store/apps/details?id=com.trainerroad.android.production) and subscribed for a month ($12, full refund in the 1st 30 days) because I simply can't wait until my 2nd ANT dongle arrives. :)

The app has recognized the "trainer" and the "hr sensor":

2017-10-13 22 10 20

The only question is why does the power sometimes decrease to 141 W?

2017-10-13 22 10 24

I think I have to mount the trainer on the weekend to see if the "other half" of this great script is also working. :)

paha77 commented 7 years ago

And do you have any idea why is the speed in simulated mode not transmitted?

john-38787364 commented 7 years ago

141 is a half of 283 so I suspect it's something to do with the accumulated power calculation. If accumulatedpower >= 65536 (it's reported as two bytes so max is 0xffff = 65535), it resets back to zero ANT+ doc D000001231-_ANT+_DeviceProfile-_FitnessEquipment-_Rev_4.2.pdf page 61 refers "Under normal conditions with complete RF reception, average power equals instantaneous power. In conditions where packets are lost, average power accurately calculates power over the interval between the received messages."

The equation the display uses Ave power = (accumulated power this packet - accumulated power last packet) / (event count this packet - event count last packet)

At 283W 4 times a second after 283 packets (70.75 seconds) the accumulated power is 65373W. On the next packet the accumulated power is set to 0

However I notice in my script this accumulated power increase only happens on the trainer specific data transmission, which is only 2/3 data transmissions (or less when data page 50 and 51 are sent!)

I've now moved accumulated power to increment every 250ms and this means Trainerroad reads a steady 283 watts in simulation mode

Can you confirm by redownloading the script/.exe and I'll close the issue if all OK your end?

I have not implemented virtual speed as it's pretty useless in my opinion. Zwift calculates speed from indicated power and grade, and Trainerroad doesn't use it all. Speed is set in the power broadcast but it doesn't seem to affect anything!

paha77 commented 7 years ago

Yes I can confirm it. I've updated the script and now it's 283 and does not fluctuate.

paha77 commented 7 years ago

About heart beat: how does the Tacx trainer know anything about heart beat? I see in the code that there's data coming from the trainer about heart beat, I'm just wondering how Tacx detects it.

john-38787364 commented 7 years ago

The 1932 will detect analogue heart rate belts (I think the LED might blink with heart rate). It transmits this to the app which then rebroadcast as ANT+ heart rate