How to connect antplus sensor to the simulator?

Subject says it all.

I am working on a Datafield that makes use of Varia radar properties.

However I am struggling because I need to have the Varia connected to the simulator and I just can't find out how to do that. I have found messages on this forum which seem to say you can connect a sensor to the simulator with the use of an ANTplus dongle, but I can't get that to work.

Working on a Mac with macOS Catalina which supports BLE; ECLIPSE IDE 2203; ConnectIQ SDK 4.1.5

I have an ANT+ dongle and it is recognised and activated on the Mac. I also have a Varia. I tried to connect the Varia as well as a HRM strap but no matter what I do the 'Manage ANT+' window in the simulator shows nothing. Obviously I am missing something.

I'd appreciate pointers on:

- How to connect a Varia (or HRM or any) ANT+device to the ConnectIQ simulator.

- How to access the device in a ConnectIQ app (source code snippets are appreciated).

- Documentation on the Simulator. Is there any?

Any help is appreciated.

Thank you very much.

Bram

  • With a tempe on windows, I don't see anything in manage ANT+ sensors, but my app connects to the tempe just fine using Ant calls. How are you expecting to connect to the Varia?  Does your app see it on a real device?

  • Code to connect:

    class RadarPowerView extends WatchUi.SimpleDataField {
    
    	private var _value;
    	private var _myRadar;
    
        function initialize() {
            SimpleDataField.initialize();
    
        	label = "My Label";
            
        	_myRadar = new AntPlus.BikeRadar(null);
        	_value = "X";
        	
        }
    
        function compute(info as Activity.Info) as Numeric or Duration or String or Null {
        
        	var battStatus = _myRadar.getBatteryStatus(null);
        	
        	_value = ( battStatus == null ) ? _value : battStatus.batteryVoltage ;
    
            return _value;
        }
    
    }

    In the simulator it only shows 'X', which implies  getBatteryStatus() returns null values. When an active Varia is connected I would not expect  null values as a result. Code compiles fine and there are no run-time errors.

    On the Edge you connect to the ant+ sensors in the System menu. I expected the simulator to work the same way as the real device, but I can't find the System menu on the simulator. I assumed the 'Manage ant+' menu on the sensor would be the equivalent. But it does nothing. So I have no clue how to proceed.

    I have not tried the app on the Edge.

  • I quickly tried the App on my Edge and it gives a reading! So the code is correct, apparently. However I still would prefer to have it working on the simulator too. The app is supposed to be more complex and I am not looking forward to debugging on the physical device.

  • Have you ever figured out a solution? I'm facing the same problem.

  • No I could not make it work on the simulator but the app works fine.

  • There was a post a few days ago that explained: 

    1. Start simulator

    2. Kill the running app

    3. Wait for 1-2 minutes

    4. Look in the ant manager

    BUT! I didn't know this for 2 years and I regularly work with ant HRM in the simulator. Not as AntPlus, just General channel. I read all the messages, works like on real device.