Loghorn / ant-plus

A node module for ANT+
MIT License
138 stars 67 forks source link

SpeedSensor should attach at 8118 instead of 8086 #31

Open capitaineflam25 opened 4 years ago

capitaineflam25 commented 4 years ago

Hi,

(Thanks for this project, it is so great ! It's working perfectly with my Favero Assioma power pedals)

i wasn't able to received any data with my Garmin Speed sensor. image

Then i read the documentation (D00001163_-_ANT+_DeviceProfile-_Bicycle_Speed_and_Cadence_2.1.pdf) and realised that the period of the speedSensor is different that the one for Speed+Cadence.

By changing the period to 8188 i'm getting the datas. (maybe your speed-sensors.js was created after copying speed-cadence-sensors.js

Regards

capitaineflam25 commented 4 years ago

And it may be 8102 instead of 8086 for a"Cadence only" sensor (not tested, i don't have one)

Alabate commented 4 years ago

I had the same problem with the same speed sensor, but it's 8118 for speed sensor according to the doc that you mention (same version as you). Using 8118 fixed the problem for me, but not 8188. Can you confirm that it's a typo in your message?

I just did a bit more debug to know what was happening:

And after a few seconds I receive a detach event and some variables are reset silently and it will never try to recover anymore after that.