SRAM AXS Battery Status

Is it possible to get battery status for a SRAM AXS system using shiftinglistener? I am using the following, but the answer is always '7' And, if it is possible, does it give the battery status of the front or rear derailleur. In my groupset the rear derailleur is the master component so I assume it would give the battery status of this??

ShifterListener = new AntPlus.ShiftingListener();
BikeShifter = new AntPlus.Shifting(ShifterListener);

if(BikeShifter has :batteryStatus) {
if(BikeShifter.batteryStatus != null) {
ShifterBattery = BikeShifter.batteryStatus;
} else {
ShifterBattery = 7;
}
}

  • Correct way to read battery status is to use getBatteryStatus(), like this:

    var battStatus = BikeShifter.getBatteryStatus(null);
    if (battStatus != null) {
        System.println(
            "state = " + battStatus.batteryStatus +
            ", voltage = " + battStatus.batteryVoltage);
        ShifterBattery = battStatus.batteryStatus;
    }

    I never had a chance to try any of the shifting devices on real Garmin, so I don't know if SRAM AXS is visible via Shifting API, or from which component the battery level would be coming.

    In case of LightNetwork, 'null' parameter in getBatteryStatus() would be used for light index, but it is not used for Shifting devices for that.

  • Thanks for that Kurev.

    I tried your code, but was still not getting anything. After looking at the shifter in the sensor details on my edge device, I realised the problem, and also answered my second question. It does have individual component battery status for both shifters and both derailleurs. I have had to modify your code as follows, but can confirm it works for SRAM etap AXS.

    var ShifterArray = BikeShifter.getComponentIdentifiers();
    if (ShifterArray != null) {
    	var battStatus = BikeShifter.getBatteryStatus(ShifterArray[0]);
    	if (battStatus != null) {
    		RearDerailleurBattery = battStatus.batteryStatus;
    	}
    }

    And so on for the other components.

  • Awesome, great that you found about the component identifiers, I totally forgot about them :)

    Seems that documentation about getBatteryStatus() is lacking a bit, since not only lights can have identifiers but also shifters.

    About identifiers, I'd expect devices not to be the same position in the array always, but possibly in the order of connecting to head unit. Have you checked how that goes?

  • How did you work out the RearDerailleur was [0],

    when I check getComponentIdentifiers() I get four Identifiers, and then subsequently for the Manufacture ID, Model, Hardware & Battery (note, I've just fully charged both batteries so I'll reconfirm values after riding them tomorrow)

    eShiftingList:[1, 2, 3, 4]
    eShiftingManuID:268:268:268:268
    eShiftingManuModel#:384:385:256:257
    eShiftingManuHW:16:16:16:16
    eShiftingBatt:1:1:1:1

    I figure the model number is the key but I can't find any reference to them. What I plan to do is go for a long ride tomorrow, that should drain the Rear Battery much more than the front, so then hopefully I can see the batteryStatus change. Then I can map the Model# to a specific Battery. (I did a similar experiment with my ANT+ Bontrager lights to identify which is the front and which is the rear) The other 2 components (3&4) I assume are the shifters but I'm sure they would report their battery as 1:New, as I haven't changed them in 5000km.

    NOTE: I'm using the SRAM Red eTAP, not the new AXS.

  • Answering my own question.

    By looking at the voltage reported .batteryVoltage and then checking the batteries with Multimeter I was able to work out which modelNumber represents the front and rear Derailleur.

    This is what I looked like for me

    eShiftingList:[1, 2, 3, 4]
    eShiftingManuModel#:384:385:256:257
    eShiftingBattVoltage:8.250000:7.972656:2.433594:2.453125

    Model 384 = Front

    Model 385 = Rear

    Model 256/257 = Front Shifters.

  • Just following along on this thread, and somewhat related. I'm wondering if dual-sided power meters have two components?  I have a single-sided PM and batterystatus comes back passing in null, but I wonder what happens with a Dual-sided?  and, what happens if one battery dies before the other?  Do you have to getComponentIdentifiers() each time you want to check the status?  Actually, these last two questions are applicable with lights and SRAM shifters...  

  • The battery identifier is used by systems that are made up of components and have a need to report battery status information from multiple batteries. The upper nibble of this field is used identify the battery in the system to which this message pertains while the lower nibble is used to indicate the total number of batteries in the system.

    Identifier: Identifies battery in system to which this message pertains.
    Number of batteries: Total number of batteries in the system needing to report battery status.

    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.

    Taken verbatim from the Bike Power ANT+ Specs. Suggest you peruse through the specs if you wish to know more about how it is read etc. 

    for Lights, that's a tough one since the specs are NOT available for end-users or developers unless you're a paying member of the ANT+ Alliance.

  • For my double sided Garmin Vector 2 power meter i don't have to use getComponentIdentifiers. I get only one value when i use  AntPlus to get battery status.
    By the way. For Shimanos DI2 i don't get a battery status using AntPlus. No matter if using component identifiers or not.

    A note in the AntPlus api docs says that there is no status provided for Shimano shifting systems.

  • Thanks for responding Nikeow and providing that info.  Good to know.

  • Thanks Werner-H for providing your "in the field" experience.  And yeah, it's pretty annoying di2 doesn't provide battery status in Antplus (not sure who that falls to - Garmin or Shimano).  Be great to tap into the existing garmin datafeild that provides a di2 battery percentage.  c'est la vie