Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Can not connect to second device

Rank

Total Posts: 12

Joined 2017-01-13

PM

I'm trying to get started programming ANT+ and struggling to do what I thought would be a very straightforward first step - using ANT_NetDll_Demo to get my PC talking to a sensor.

I've read the suggested ANT+ documents and compiled the ANT_Libraries. The latest C++ runtime is installed OK. Although far from an expert, I have done lots of programming.

I have a valid Ant+ USB stick (that works with my Elite Smart Turbo Trainer) and a Garmin combined Speed-and-Cadence sensor (that works with my Garmin Edge computer) which I can trigger by swiping the magnet past it (it lights an LED and registers on the Garmin Edge 1000). The sensor has no identification (apart from FCCID:IPH-00447, IC:1792A-00447, CE 1177 inside), but it looks like the GSC 10 Speed/Cadence Bike Sensor listed in the Ant+ Compatible Product Directory (and bought as a pack with a Garmin Edge 510 which is also listed). I also have an Elite Drivo (with ANT+ and FE-C).

I believe I have the Ant+ USB stick drivers installed and working properly because if I run DEMO_NET without the Ant+ USB stick in the PC the programme aborts (unsurprisingly), whereas if I plug in the Ant+ USB stick it runs. Also using Zwift the Elite and USB communicate properly.

If I run ANT_NetDll_Demo and then "start demo" with "Device 0 Only - Master". It seems to work properly.

If I run ANT_NetDll_Demo and then "start demo" with "Device 0 - Master, Device 1- Slave". I get the error "Error: Can not connect to second device, ANTLibrary Exception: Failed to connect to any ANT devices". It will not detect / connect to the Speed-and-Cadence sensor nor the Elite Drivo as I expected.

I suspect I am making a beginner's basic error. Can someone point me in the right direction please.      
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

1) You should take a look at the ANT+ Device Profiles for FE-C and Speed and Cadence to see which channel parameters you need to set.

2) Your application is attempting to connect to a second "ANT USB Stick Device", not another transmitting device. To do that, you need to add another ANT channel to the application.

3) Using the C# Library from SimulANT+ would be easier than writing from scratch in C++ (there's an app note for this), or there is also the old ANT+ Simulator which is written in C++ you could start from as well.      
Rank

Total Posts: 12

Joined 2017-01-13

PM

Thanks for the suggestions which have been a great help. I can now see that the code in ANT_NetDll_Demo is not looking for a transmitting device (and also that the SpeedCadence is a master) and I have had a good look at your suggestions.

I am using C# and trying to programme the PC end of things, and therefore I checked out the SimulANT+ Library HeartRateDisplaySimulator code in "Program.cs". In particular the function/method "private static void ConfigureANT()"

I have this compiled and working with my heart rate monitor. It looks like I can use this code as a basis for my test for the FE-C (which is my ultimate aim) by changing the Heart Rate Display parts to use the appropriate information / class in ANT+ProfileLib.XML.

Regarding the network key - I used the public key, which I found in the "Basics" section. I assume this is the correct thing to do.

Thanks
Steve      
Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

The ANT+ Network Key is the correct one to use.

PS. I had to edit the key out of your last post.