Send Data to an ANT+ Device

Former Member
Former Member
Hi

I have managed to cobble enough code together to talk to an ANT+ device not supported by the current SDK. I want to now be able to send data to this device.

I assume I need to use the GenericChannel.sendBroadcast(data) function ? If so, does anyone have an example of how to send 8 bytes using this function ? This is more a MonkeyC question I suppose.

Thanks!

J
  • I doubt if this is the problem, but your Byte 1 of the acknowledge message is FD.  According the the profile, bits 2-7 of byte 1 should be set to 1F.  If you are sending a shutdown command (01), then bits 0-1 should be 1,  This would make the Byte 1 to be 0111 1101 which is 7D in hex.

    You could set up simulant to be a bike radar sensor, pair it to the watch, use the watch to shut it down, and then see the message that works to shut down your real bike radar sensor.

  • ok, so I tried your suggestion.

    setup up stimulant to be bike radar sensor and use watch to shut it down. 

    End result - simulant shows its' not getting shutdown (shutdown abortted)

    in any case, I tried sending FD and FC to the sensor from eclipse and neither of it works. 

    [2,253,255,255,255,255,255]

    TOD:8:13 :[1, 2, 255, 255, 255, 255, 255, 255] msg:78
    TOD:8:13 :[48, 0, 0, 0, 0, 0, 0, 0] msg:78
    RadarPL:[48, 0, 0, 0, 0, 0, 0, 0]
    send POP
    TOD:8:13 :[1, 2, 255, 255, 255, 255, 255, 255] msg:78
    TOD:8:13 :[1, 5, 0, 0, 0, 0, 0, 0] msg:64
    TOD:8:13 :[48, 0, 0, 0, 0, 0, 0, 0] msg:78

    Send Pop is the println just before sending the payload.

    This payload [2,125,255,255,255,255,255]

    RadarPL:[48, 0, 0, 0, 0, 0, 0, 0]
    send POP
    TOD:8:20 :[1, 2, 255, 255, 255, 255, 255, 255] msg:78
    TOD:8:20 :[48, 0, 0, 0, 0, 0, 0, 0] msg:78
    TOD:8:20 :[1, 5, 0, 0, 0, 0, 0, 0] msg:64
    TOD:8:20 :[1, 2, 255, 255, 255, 255, 255, 255] msg:78
    TOD:8:20 :[1, 2, 255, 255, 255, 255, 255, 255] msg:78
    TOD:8:20 :[48, 0, 0, 0, 0, 0, 0, 0] msg:78

    something is not right. Also - ISn't SimulANT supposed to be correctly mimic-ing the radar display or the radar sensor and thus in theory should work?

    funny thing is it works on a physical device (watch and sensor)

  • In this case, does Simulant (as a bike radar sensor) get an acknowledge message (or series of messages??) from the watch when the watch sends the shutdown command?  Once you figure out what the watch is actually sending to the sensor, you should be able to duplicate that in your app code even if it doesn't match the profile.

  • Did more digging and i think after all this - I believe that it's not because the radar is faulty or X. It's just I have no idea how the Bike Lights Profile is working in conjunction w/ the Radar. The Garmin Radar is a combo device w/ TailLight + Radar and based on another thread the process flow for it is

    Light = Device Type 35

    Radar = Device Type 40

    When starting up, the Light (35) would be dominant and would broadcast first (i believe) and then the radar would turn on (presumably) after network forming has happened. Then the controls to the Radar is somehow thru the Light network.

    Here is the outputs and the connection states from watch to Simulant and to physical radar.

    SimulANT - Radar
    Watch - Display
    
    Stop Activity:
    1385975 : Tx: [30][01][00][01][00][00][00][00]
    1386100 : Tx: [30][01][00][01][00][00][00][00]
    1386100 : Rx (Ack): [02][FD][FF][FF][FF][FF][FF][FF]
    1386224 : Tx: [30][01][00][01][00][00][00][00]
    1386349 : Tx: [30][01][00][01][00][00][00][00]
    
    1309472 : Requested Page: 80 (Manufacturer's Information)
    1309472 : ... sent page 80
    1386100 : Received Command Page:
    1386100 :    Command turn off: Ignoring request since Radar is part of a Network.
    
    
    Stop Activity (uncheck "Part of Light Network")
    1561819 : Received Command Page:
    1561819 :    Command turn off: Starting Timeout Timer.
    1567888 : Turn Off Timeout Complete: Turning off Radar Device...
    1567919 : Radar Channel (0) Channel closed
    
    1561694 : Tx: [30][01][00][0A][00][00][00][00]
    1561819 : Tx: [30][01][00][0A][00][00][00][00]
    1561819 : Rx (Ack): [02][FD][FF][FF][FF][FF][FF][FF]
    1561944 : Tx: [30][01][00][0A][00][00][00][00]
    1562069 : Tx: [30][01][00][0A][00][00][00][00]
    
    On The Watch, Sensors & Accessories - 
    Watch is connected to Simulant (Radar) but Lights (is marked as Searching)
    Watch is connected to Physical Radar, I see "Network Forming" and "taillight connected" Messages on the watch 
    (These 2 messages does not come up when connected to SimulANT Radar)
    
    
    SimulANT - Radar Display
    Watch - Radar Display
    Radar - As Radar
    
    on Watch, connected to physical radar. I see "Network Forming" and "taillight connected" Messages on the watch.
    On SimulANT - Connected to physical Radar. 
    
    ON Watch, I turn off activity (this will cause the radar/light to shutdown). These messages is on SimulAnt (connected to physical Radar)
    2212140 : Rx: [01][02][FF][FF][FF][FF][FF][FF]
    2212265 : Rx: [30][00][00][00][00][00][00][00]
    2212374 : Rx: [01][02][FF][FF][FF][FF][FF][FF]
    2212515 : Rx: [30][00][00][00][00][00][00][00]
    2212640 : Rx: [01][02][FF][FF][FF][FF][FF][FF]
    2212764 : Rx: [30][00][00][00][00][00][00][00]
    2212889 : Rx: [01][02][FF][FF][FF][FF][FF][FF] <-- Shutdown Command (Bit 1 = 02)
    2212998 : Tx (Ack): [02][FD][FF][FF][FF][FF][FF][FF] <--- Ack Command (Bit 1 = FD)
    2213014 : Rx: [30][00][00][00][00][00][00][00]
    2213139 : Transfer Tx completed