ANT Battery Level for LIGHTS

I don't expect anyone will know this. Kind of a corner case. But frustrating that there doesn't seem to be a solution.

I can get the battery levels for my ANT Shifters, Radar, Power Meters, Speed sensors, etc. Unfortunately, HEART RATE is still not supported by CIQ.

I can even get it for my Headlight and Taillight.

For a 24 hr ride I have coming up, I'll have two ANT headlights I can swap out. The issue is, I can't see distinctions between the two headlights to report on their individual battery levels.

I can POLL the Light Network and see I have two devices. But in the Page 0x01 onMessage(msg) where the battery status is reported, there is no device ID. And "msg.deviceNumber" is not populated.

So both headlights will send a Page 0x01. With their battery status (eg: GOOD, OK, CRITICAL, etc). But there is no way to know which headlight is reporting. Not a big deal. But if anyone has played with ANT LIGHTS and knows how to grab the device ID from the responding lights and can tie that ID to the Page 0x01 onMessage... let me know. Thanks!!

  • I only used HR sensor in CIQ and only one at the moment, but can't you send some message to each device one-by-one that will cause them to send a response that includes the battery info?

    The other thing is that it probably depends on your code. Again, I never tried my code with more than one HR sensors, but my class extends Ant.GenericChannel, and thus one such object represents 1 ant device, so in theory if I would have more than one connectios I would hold more than one instance of this object, and thus each object would know about itself the ANT ID form deviceConfig.deviceNumber.

  • BTW: regarding HR sensors battery: I didn't get to this stage yet (well I have not much memory left in the DF to do so) but doesn't data page 7 include the battery status? Isn't that sent by some HR sensors? I guess it does send the data somewhere because I do see my H10 under the Sensors with battery: OK.

  • Hi. Yes the HR Strap sends messages/pages. The issue is that CIQ has not implemented a HR Listener. So, as far as I know, there is no way in CIQ to receive that page 7 from the HR ANT device. Got any ideas? 

  • Oh interesting! So even though there isn't an ANTPLUS listener implemented in CIQ, you can interact with a HR ANT device? If so, I'd love to know how you did that. There might be a chance to get the battery info if that is the case.

    For the other suggest. Yes there is a way to send a command to an ANT device. But I need to know the ID to send the command to a particular headlight. If I knew the ID and did that, the onMessage() replies are problematic... I'm getting onMessage() pages back all the time from a variety of devices. Page 0x52 has battery info but no ID. So I won't know which device sent that Page 0x52. Was it the device responding to my command? Or just an async Page sent from a different ANT device? I'm sure there must be a way to tell.

  • When I started my datafield I logged all ANT messages for debugging (or rather understanding how it works) and there are the 4 * page 0 messages every second, and I don't remember, but once in every 64 or something like that there is some other page. Also when I did this I only had an old Garmin HRM-SS that IMHO doesn't know/send the battery data. Now I mostly use the Polar H10, which I did not debug but I know that it sends the battery info because it shows up under the Sensors.

    So my guess is that if you start to log every message (or even only every message that you don't know yet) and let it run for at least a minute or 2 then look at the logs, then you should be able to see the pages that report the battery. Let me know if you succeeded.

  • I don't see your code, but I guess currently you have some code that is general and there you have the onMessage, and because each connected device will just call onMessage(msg as Ant.Message) so you should have the ANT ID of the sender in msg.deviceNumber according to the documentation.

  • I've tried that. I have a Garmin Radar device and Bontrager ANT headlights. The RADAR sends me onMessage() pages (which is a taillight, LightType = 2) and sends it's deviceNumber. When I get an onMessage() with LightType = 0 (headlight), the msg.deviceNumber stays the same as the RADAR unit. So maybe that is the issue... Bontrager has a flawed ANT implementation and does not send their device number? But that doesn't make sense either, because the new "msg" object should overwrite the deviceNumber, which would be valid, null or zero. Not sure why the HEADLIGHT deviceNumber would retain the RADAR deviceNumber from a prior message? As you know, each LISTENER implements its own onMessage(), so there is no generic onMessage... I do have a general onMessage() for my Lights listener, for example. I can't receive messages from a HR strap since there is no listener for that, right?

  • I get that... but since there is no HeartRate listener, I can't receive onMessage() for that type of device. Each device type implements its own onMessage() that only receives messages from that specific type of device (eg: lights, power, shifting, speed, etc). Unless that is an ANTPLUS construct, and the regular ANT class listens to all ANT devices, not device specific?

  • Yeah, that still sounds like a bug in CIQ. It sounds like the 1st device id is kept forever. If that's the case you should be able to test it by "reverting" the order. Either by trying it a couple of times, and randomly sometimes the order should be different, or better: turn off the radar, keep only the headlight powered. Now hopefully you'll be able to see the id of the headlight. And then if you power the radar it should connect, and if the theory is right then you'l get messages from the radar but with the headlight's ant id. With this you can report to Garmin, and I think it's a good idea to include the relevant code.

    Now I don't understand your last sentence. Until now I thought you only have 1 onMessage method on only 1 object. If that's not the case then each object could know the ant id it is connected to, so when any of the objects get an onMessage call it would see the ant id in it's mAntId that was saved when it connected.

    Maybe you should post here the relevant parts of your code, 'cause I don't understand where you have/haven't got listeners, etc,