Tigge / openant

ANT and ANT-FS Python Library
MIT License
174 stars 80 forks source link

Speed Cadence Sensor Troubles #84

Open ARufenach opened 1 year ago

ARufenach commented 1 year ago

I'm attempting to read data from heartrate, powermeter, and speed/cadence sensor but to no avail. I've adapted the code in multi_dev_fe_power_meter.py to accept these 3 sensor types but I keep getting a 21: CHANNEL_IN_WRONG_STATE error. I've gotten the heartrate and powermeter to function separately and sometimes together but the speed/cadence sensor doesn't work even on its own (I've tried the bike_speed_cadence.py example code for testing and I get the same error as above). Any ideas? Not sure where to start. All Garmin sensors used and developing on an Raspberry Pi 3B with a Cospoo ANT+ USB stick.

tuna-f1sh commented 1 year ago

The issue sounds similar to https://github.com/Tigge/openant/issues/81 - I've not used a Cospoo stick but it seems the same that a small section of the protocol (and perhaps not used by other tools) is not adhered to, since it works with Dynastream in his case.

As I replied in that ticket, you could find out what the stick supports with node.advanced_options_two after init. You can also try changing the open_channel call with extended=False

da4089 commented 2 months ago

(I came here via #81)

Using the Cycplus USB dongle, some possibly relevant debug logs:

INFO:openant.easy.node:capabilities max_channels: 8, max_networks 3, standard_options: set(), advanced_options: {<AdvancedOptions.PerChannelTxPowerEnabled: 4>, <AdvancedOptions.Reserved: 8>, <AdvancedOptions.LowPrioritySearchNEnabled: 5>, <AdvancedOptions.SerialNumberEnabled: 3>, <AdvancedOptions.SearchListEnabled: 7>}; {<AdvancedOptionsTwo.ExtMessageEnabled: 1>, <AdvancedOptionsTwo.ProximitySearchEnabled: 4>, <AdvancedOptionsTwo.ExtAssignEnabled: 5>, <AdvancedOptionsTwo.ScanModeEnabled: 2>}

I added a dump of that, after setting the network key, which matches the above:

INFO:root:#### advanced_options_two: {<AdvancedOptionsTwo.ExtMessageEnabled: 1>, <AdvancedOptionsTwo.ProximitySearchEnabled: 4>, <AdvancedOptionsTwo.ExtAssignEnabled: 5>, <AdvancedOptionsTwo.ScanModeEnabled: 2>}

Maybe also of relevance:

INFO:openant.easy.node:serial 308214613
INFO:openant.easy.node:ant_version AP2USB1.05