PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.13k stars 13.35k forks source link

Pixhawk 4 unable to complete serial connection with MicroXRCEAgent #22821

Open CannonFodder511 opened 6 months ago

CannonFodder511 commented 6 months ago

Describe the bug

I am running a connection from a Pixhawk 4 running firmware 1.14.0. It is connected via a serial connection to a raspberry pi running Jammy and ROS 2 humble. This runs eProsima's MicroXRCEAgent.

Things I've tried:

What else can I try to debug this?

Mavlink output: `nsh> uxrce_dds_client start -t serial -d /dev/ttyS2 -b 115200

nsh> uxrce_dds_client status

INFO [uxrce_dds_client] Running, disconnected

INFO [uxrce_dds_client] Using transport: serial`

Pi Output: `/ros_ws: MicroXRCEAgent serial --dev /dev/ttyUSB0 -b 115200 -v6

[1709157626.383849] info | TermiosAgentLinux.cpp | init | running... | fd: 3

[1709157626.385726] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 6`

To Reproduce

Setup according to this page: https://docs.px4.io/main/en/companion_computer/pixhawk_rpi.html Run "uxrce_dds_client start -t serial -d /dev/ttyS2 -b 115200" on the Pixhawk 4 over mavlink Run "MicroXRCEAgent serial --dev /dev/ttyUSB0 -b 115200 -v6" on the Pi

Expected behavior

Pi and PX4 should connect, the PX4 posting topics to the XRCE Agent

Screenshot / Media

No response

Flight Log

Mavlink output: nsh> uxrce_dds_client start -t serial -d /dev/ttyS2 -b 115200 nsh> uxrce_dds_client status INFO [uxrce_dds_client] Running, disconnected INFO [uxrce_dds_client] Using transport: serial

Pi Output: /ros_ws: MicroXRCEAgent serial --dev /dev/ttyUSB0 -b 115200 -v6 [1709157626.383849] info | TermiosAgentLinux.cpp | init | running... | fd: 3 [1709157626.385726] info | Root.cpp | set_verbose_level | logger setup | verbose_level: 6

Software Version

1.14.0

Flight controller

Pixhawk 4

Vehicle type

None

How are the different components wired up (including port information)

No response

Additional context

No response

mrpollo commented 6 months ago

Make sure you there's nothing else running on the same port, it's either MAVLink or DDS the link can't handle both

CannonFodder511 commented 6 months ago

Make sure you there's nothing else running on the same port, it's either MAVLink or DDS the link can't handle both

Is there any way to do this besides the parameters on QGC? All the mavlink parameters are set to disabled

chutsu commented 6 months ago
  1. Are you sure you swapped the serial RX / TX?

1709323459_screenshot

  1. Dialout permissions on the Pi?
CannonFodder511 commented 6 months ago

I followed the guide for the connections but did try swapping. Dial out permissions are enabled for the user and root

chutsu commented 5 months ago

Also couple other things.

Geol-23 commented 1 month ago

Hello, I am having the same issue. I'm using a Raspberry Pi 4 (22.04) to communicate with an mRo Pixhawk (1.14.3). I've followed the guide and installed the agent as a standalone on the Pi, I've used the reccommended baud rates and ports (921600, TELEM2 on the FC and UART0 on the Pi) and I believe the pins are the correct way around. I've also added the dialout permissions and I'm pretty sure nothing else is running on that port.

To diagnose this I've tried to boot up another FC (same version as the main FC) and the issue persists. I've established communication using mavproxy according to the guide.

I am getting the same logs per the issue. Any help is appreciated. Cheers.

mrpollo commented 1 month ago

@Geol-23 please open a new issue