Issues with smart battery driver

Hello all, I am trying to interface a battery with a Pixhawk 4 running Ardupilot 3.7. I’ve tried setting both BATT_MONITOR and BATT2_MONITOR to both Maxell and Solo, which both use SMBus standard. I’ve determined that the Pixhawk is actually not searching for 0x0b on the bus (12C A). Has anybody had this issue?

I implemented my own smart battery with an arduino via the Maxell protocol and it works with 0x0B, just checked it in my code, but that was on 3.6…

What are you trying to do?

Did you have any luck with this @nbelanger99?
@Vabe what kind of Pixhawk did you use?
I’m also trying to make my own smart battery and have also determined that the Pixhawk 4 is not searching for 0x0B. I’m looking into it now, but I suspect it might be looking on the wrong bus - I say this because to get an IRLock to work on my Pixhawk 4, I had to change its bus. This was luckily a parameter, however it was not a value that was available in Qgroundcontrol as a dropdown. I had to go to ‘Advanced’ and manually input the number ‘3’. In PX4 1.9 I also had to change the source code to look for the airspeed sensor on a different bus, so I’ve seen there are some compatibility issues with the Pixhawk 4 I2C bus assignment

Yep, confirmed.
The SMBus driver only checks for I2C busses 0 and 1.
If you go into AP_BattMonitor_SMBus.h and change lines 10 and 11




The flight controller starts pinging the battery on 0x0B on I2C A

This is the same reason IRLock does not work on Pixhawk 4 unless you change the parameter PLND_BUS = 3

I used a PixHawk 2.4.8

Excellent, that clarifies it, thank you, as on Pixhawk 2.4.8 the external I2C is bus 1, so it works with the current firmware