I’m trying to connect 2 battery with px4. One connected using UAVCAN and another is analog.
But QGC not showing 2nd battery. Please help
I’m trying to connect 2 battery with px4. One connected using UAVCAN and another is analog.
But QGC not showing 2nd battery. Please help
in uavcan status, node id is showing?
If showing, uavcan parameter was configured?
which battery data is coming? analog one or uavcan one?
UAVCAN data showing, node id showing and parameters configured. Only UAVCAN power module data showing. Analog one not showing.
assuming you have BAT1 on UAVCAN and BAT2 on Analog.
Enabling UAVCAN:
UAVCAN_ENABLE > 0
Setting source:
BAT1_SOURCE 1 (external)
BAT2_SOURCE 0 (analog)
Setup BATn_* parameters:
follow instructions in documentation or QGC, but parameters for decided methodology must be set-up properly first.
Reboot the vehicle.
Check that battery messages are distributed internally first (uORB listener), then check that MAVLink messages arrive to QGC.
Also, you did not mentioned the version you’re using, but be aware of what version of documentation you’re reading ![]()
I’m using px4: 1.16.1 and qgc: v5.0.8 64bit.
Setup done as per documentation and I noticed if I changed bat1 to analog then both battery showing.
that may be a PX4 quirk of battery module implementation.
here is what it may be happening;
Why does the Analog → External sequence show two batteries?
When the first battery (BAT1) is set to Analog, the driver immediately detects the physical presence of voltage at the ADC port upon startup and successfully creates instance 0 (battery_status with ID=0).
When the system encounters the second battery (BAT2), set to External, it registers as instance 1 (battery_status with ID=1) because space is available in the multi-battery structure and the system is awaiting MAVLink data for the second channel.
Consequently, the controller (in the GCS—QGroundControl or Mission Planner) identifies separate entities: BAT1 (analog source) and BAT2 (external source).
Why does the External → Analog sequence show only one battery?
Upon system startup, BAT1 initializes as External first. If the external device does not send an immediate MAVLink BATTERY_STATUS message at that moment (or if there is a delay in initializing the serial/MAVLink communication channel), PX4 sets the `connected` flag to `false` for BAT1, or the instance fails to fully initialize as active.
Because the system often filters out inactive or disconnected “primary” external sources—or because the sequence is reordered or overridden due to logical priority—the software may fail to display the second analog battery, or the entire channel mapping may collapse to just a single active report. In certain PX4 versions, the cascading check ignores subsequent candidates if the primary external source lacks a valid data stream at the moment of initialization, resulting in only one (or no) functional battery being detected.
How to resolve this?
If you wish to use a mixed system (analog + external source), verify that the external device is indeed sending MAVLink BATTERY_STATUS messages—and doing so quickly enough—upon system startup.
Check the log (using the `listener battery_status` command in the PX4 console) to see exactly which index (e.g., 0 or 1) is being created in each instance and what the connection status is.
hope this helps you resolve the issue in depth.