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.

  • Ugh - I missed your reply. Thank you!!
  • Kurev: I think you misread the print statement. The printout hardcodes Battery Status 0x04. That is really the page number. Not the status (which would be LOW). Is the "state" value the status (which in my case was a 3)? Or is there another page value to parse to get the status? Sys.println("Ant: Battery Status 0x04: state: " + state + ", voltage: " + voltage);
  • [quote userid="43945" url="~/developer/connect-iq/f/discussion/245190/ant-battery-status/1162416"]Ah perfect... the 0x4. Makes sense, and much better than a voltage translation.[/quote] Actually I said wrong, the state is actually 3, which makes it BATT_STATUS_OK. If you work with multiple manufacturers, you'll find they report state very differently.  Some may use full range of enums, and report new level every 20% or so of capacity. This is nice and good. Some may report OK for first 90% of capacity, and then jump directly to Low for rest of 10%. Makes the whole thing a bit useless in those cases.
  • Ah perfect... the 0x4. Makes sense, and much better than a voltage translation.
  • You don't need to translate it, the status is directly one of the enums. In your case it says battery is low. Garmin device or AntPlus doesn't decide which voltage means which level. This is coming from the sensor manufacturer. Inside sensor software, they decide which voltage level matches which enum level (or any other internal method for deciding the level) and report that. Voltages also vary quite a lot between devices, especially normal battery vs. rechargeable battery. I think you need to observe which it maximum and minimum voltage for each sensor, and make your conclusions from that.