Custom ANT Broadcast using GenericChannel

Hello, 

Could anyone please provide some help on how to set up simple communication with ANT (not ANT+)?
I am very new to MonkeyC and would appreciate some help.

I currently have a simple data field deployed to the IQ store that right now only displays a simple runner ID. Right now, all I need is for the ANT payload to broadcast that 8-character long string over any ANT channel. 

Link to my app (currently does nothing):
https://apps.garmin.com/apps/6329a0c7-937b-490a-a8f7-f0f3ed859ed2

There is some information about the project on the data field description, but right now it doesn't do any communication. I want to just use the GenericChannel feature to broadcast the data.

I have posted a forum question before, but that was regarding BLE, not ANT.

What is the simplest way to send a simple 8-byte string over ANT with the fastest possible frequency? I know ANT+ is 4Hz but ANT is 200Hz, and I ideally would like more than 10Hz.
I have looked at the GenericChannel sample, but it is very long and honestly a little confusing, I feel like it could be simpler.

Any help is greatly appreciated!

  • And seriously, This is phenomenal. Thank you so much

  • Ok, good luck!

    I'm kind of curious how you will test this and use it in practice tho. Is there an existing "ANT broadcast receiver" app that will receive your messages?

    I kinda feel like that's something you'd have to write yourself, as well.

  • You have no idea how much clearer you have made my entire understanding of ANT and ANT+, thank you so much

  • This is for a school engineering project. (I'm in the PLTW EDD senior design project class). I have some documentation for it on the deployed IQ store and on my website (though the website discusses using BLE, it is outdated and I am using ANT):

     https://kthej.com/PTConnect

    Connect IQ Data Field: 


    https://apps.garmin.com/apps/6329a0c7-937b-490a-a8f7-f0f3ed859ed2

    https://github.com/kadenjones1212/PTC

    Tkinter UI:


    https://github.com/kadenjones1212/Tkinter-App-for-System

    Side note: I'm using the openant Python library to communicate to the watch. I have an ANT usb stick.

    In a nutshell of what I'm doing:

    Essentially my project is a workout assisting timing system for coaches to be able to
    have their athletes enter their names on their watch and connect to the system so that the runners can run on a track
    but never have to manually lap or stop their watch. (This will come later).

    What the watches are doing is exactly the same function as a race bib in a 5K or marathon event, but it elmininates the waste of using bibs in those races, instead making the watch act as the mechanism to both identify and act as a signal for the system to read and mark lap times and finish times.

    So I'm using the Garmin watches as transponders for the system to record times. 

    Another feature to come soon is the Pi will broadcast the recorded times back to the watches, so you can guarantee that 
    the time recorded on the system is the same as the time on your watch. 
    The idea is it will allow workout coaching to be much smoother and faster, just set up your data field (only once, can be used always after), then the predefined ANT signals will match with the Pi system, and you just start your watch, do the workout and the Pi system will track all 8 athletes lap and finish times (8 because those are my general constraints.)

    Right now I have an entire Raspberry Pi Tkinter project built already, which has a timer and all the built stuff on it. The whole project is on my GitHub, mostly in python, if you're curious to check it out.

    Again, thank you so much for helping! I've been struggling to get the ANT to work.



  • Such a helpful response deserves a detailed explanation of what i'm doing :)

  • No worries! Thanks for the detailed overview - that's a really interesting project.

    Tbh I'm not sure if my sample code does exactly what you want yet, but hopefully it's a start.

  • One thing that maybe should be changed in the example is the default radio frequency of 2 (2402 MHz).

    I see that CIQ uses a default of 10 (2410 MHz). I have no idea if this corresponds to any kind of "default ANT frequency" or if it's arbitrary. but I guess it wouldn't hurt to use the default. Obviously whatever you choose has to match whatever you're using on the receiver side in any case.

    See the DEFAULT_* constants here:

    https://developer.garmin.com/connect-iq/api-docs/Toybox/Ant/DeviceConfig.html

  • I did change it. Right now I've programmed my Pi to listen for signals at channel 66, and I changed the RF in the data field to as well. Still didn't work, however. Something I should probably find out, however (I just realized this and I may be screwed), is whether or not the Dynastream ANT+ adapter also supports ANT... Do you know if they do?

  • You mean this? https://www.dynastream.com/components/antusb-m

    Yeah it's funny that the technical name for this product is "ANTUSB-m" yet Garmin's own doc also refers to this as an "ANT+ adapter", and the stick itself has a big ANT+ logo. Goes back to how "ANT" is a super ambiguous term.

    I don't have any direct experience with this but I would guess that the ANT stick would also support ANT+ (or should that be "the ANT+ stick would also support ANT"), same as the Ant module supports ANT and ANT+.

    I mean the fact that you can set the channel to anything other than 57 (2457 MHz - reserved for ANT+) kinda suggests to me that ANT should be supported.

    Afaict the only real differences between ANT and ANT+ are:

    - ANT+ uses a reserved radio frequency (2457 MHz) that ANT can't use

    - ANT+ uses a different network than ANT (ANT+ has its own network key)

    - ANT+ devices are supposed to use standardized device profiles (this is required for ANT+ certification)

    So it seems to me that someone would have to go out of their way to make general purpose dev hardware that works with ANT+ and not ANT. Nothing's impossible but it seems unlikely to me.

    On your pi I think you would have to set the device type either to 123 (to match what's in the CIQ app) or 0 (which means that the channel will receive data from any device).

    Another thing you could try is changing the messagePeriod in the CIQ app to the default of 32768 (4 Hz).

    And not to state the obvious, but in your CIQ app, you would probably want to call sendRunnerID() in compute(), so it's sent once per second.

    Speaking of the message period, since you are sending broadcasts from a CIQ data field which cannot "do stuff" faster than once per second, idk if it really helps to configure a super high message frequency. Note that sendBurst() cannot be used in a CIQ data field either. 

    This also points to a possible issue for your use case - a "timer resolution" of 1 second may not be what you're looking for if you need to record split times on a track for example.