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.

  • Here's how to parse state and voltage from Common Page 82 (0x52)
    function onMessage(msg) {
            var payload = msg.getPayload();
            if ((payload[0] & 0x7F) == 0x52) {
                Sys.println("Ant: [RX] " + payload + " [" + msg.deviceNumber + "], PAGE_BATTERY_STATUS");
    
                var state = (payload[7] >> 4) & 0x7;
    
                var voltage = (payload[7] & 0xF);
                if (voltage != 0xF) {
                    voltage = voltage + (payload[6] / 256.0);
                } else {
                    voltage = 0.00;
                }
    
                Sys.println("Ant: Battery Status: state: " + state + ", voltage: " + voltage);
            }
        }
  • Looks like 82 could be also broadcasted regularly: "Only the battery with the lowest battery level should be broadcast in the regular common page transmission pattern. This ensures that display devices that do not support the device identifier field still show a consistent and meaningful value. The display may request battery information of all other devices individually using the Request Data Page (Common Page 70), and setting descriptor byte 1 to the value of the desired identifier."
  • Ok I'll play with that and let you know
  • Thanks for testing. So it does look like the sensor details view really has access to more information that is provided to AntPlus API. What I understand from the specs, for speed and cadence sensors there are two ways to get battery status: 1. Speed/Cadence Data Page 4 - Battery Status. This is mandatory and should be sent periodically by the sensor. I don't know if old speed sensor does that. 2. Common Data Page 82 - Battery Status. This is not sent periodically, to my knowledge. To get the data, specific request should be sent using sendPageRequest(), and then handle response in listener in onMessage(). I don't know which method is used to get the data to device details, but whichever it is the data is not passed on to us. Would be great if you guys could implement onMessage in listener, and print out the payload data. From that we should see if if page 4 is coming, or if you get answer to page 82 request.
  • I have 5 of these 6 devices. (I don't have the old combined speedcadence sensor). I'll update my DF to display the status off 5 of the devices I have and report on results. The battery level is what I really want for all of these. I wish they also had a way to get HR sensor battery status. /resized-image/__size/320x240/__key/commentfiles/fb5d84b10a5745448a7a45dafc1faa43-bef7cf5b-cf7f-40ec-813a-c5651a6c4bee/pastedimage1604961633877v2.png