Ticket Created
over 4 years ago

WERETECH-10039

ANT+ Battery Status

The latest in the saga for Battery Status. I used an ANT+ dongle on my Windows Laptop, and paired it with the Eclipse Simulator. I tried both an older Garmin Cadence Sensor, and a brand new one (the one that does both ANT and BT). Same outcome. In both cases, the CIQ data field immediately gets Device State info. After maybe 30-40 seconds, the ProductInfo.serial number comes thru. Just like in real life when paired to a real Garmin Edge computer. But in both cases, even after several minutes, the Battery Status remains null.

When I pair the new cadence sensor to my actual Garmin Edge computer, the Battery Status does come up as OK within 15 seconds or so and then maybe 30 seconds later the Serial # info comes through.

Any clue why the polling code isn't seeing the Battery Status?

Oh, also, the State Update Listener is triggering, but the BatteryStatusListener is not.

  • I assumed that meant no more than every 2 seconds per sensor. So I send to each sensor every 15 secs. But the error was it didn't like the value (0x04). Strange.
  • [quote userid="43945" url="~/developer/connect-iq/f/discussion/245190/ant-battery-status/1162642"]So, I tried to setup the "sendPageRequest" to request pages 4 and 82 every 15 seconds. But sendPageRequest fails.[/quote] Not sure, but you are sending two requests in a bunch, for both device. The spec says you can only send request once per 2 seconds. Although if you send too often, it should raise AntPlusNotAllowedException. pageNumber — (Toybox.Lang.Number) — The requested page number. Requesting the ANTFS page (0x43) isn't allowed. Page request can change the page rotation of the sensor so they will not be allowed to be sent too frequently. Sending page requests is limited to once every 2 seconds.
  • Thanks! That explains it. Great find. Seems to be a bug because they should support the range of IDs
  • Looking at the IDs mentioned by Dave it looks like 747003 (1011 0110 0101 1111 1011) just has been cut to a 16-bit integer (0110 0101 1111 1011 -> 26107). But according to the docs deviceState.deviceNumber should be a 32-bit signed integer. Seems to be a bug (code or docs???)
  • [quote userid="76914" url="~/developer/connect-iq/f/discussion/245190/ant-battery-status/1162632"]looking at my devices i observed these "strange values" returned by deviceState.deviceNumber when a sensor has a 6 digit ANT ID. For devices with 5 digit ANT IDs the deviceState.deviceNumber matches the ANT ID.[/quote] Possibly it cannot handle extended device number feature, which increases maximum device number from 65535 to 1048575.