Enable MAVLINK on a port other than /dev/ttyACM0 in px4 support package

8 views (last 30 days)
Hi, I am trying to run a HITL simulation on a pixhawk 4 mini using the px4 support package. I need to enable MAVLINK on /dev/ttyS1 (TELEM1) port on the pixhawk as this is where I have an onboard computer processing sesnor data and sending it via MAVROS (MAVLINK) to the pixhawk.
The connection works when booting the pixhawk without rc.txt. I know in the old version you could add some lines to rc.txt and start mavlink on a spercific port, however now (in 2021a) there is a GUI option to activate mavlink in the hardware settings for the model. Here you can only activate mavlink over /dev/ttyACM0. This is an issue as i need the USB to monitor and tune and i need to run mavros over the TELEM port.
Is there a way to enable mavlink on a spercific port ive treid using the lines in rc.txt from the old version which did'nt work, anyone have any insight i cant find much documentation on this.
Cheers :)
  1 Comment
Dave Mansfield
Dave Mansfield on 7 Feb 2022
i have noticed that putting these lines in the rc.txt file does establish connection between my onboard computer and the pixhawk:
mavlink start -d /dev/ttyS1 -m onboard -b 921600 –x
mavlink boot_complete
however there is still no mavlink hearbeat detected and the mavros terminal stops after saying the pixhawks IMU has been detected.

Sign in to comment.

Answers (1)

Arun Mathamkode
Arun Mathamkode on 6 Apr 2022
PX4 HITL support is available from R2021b (Example Link), and I would highly recommend using R2021b for trying HITL. If you are trying HITL you must use the rCS as the startup script instead of custom rc.txt. You have an option to choose this in the Hardware setup screens from R2021b.
You can consider to use MAV_X_CONFIG parameter to enable MAVLink Telemetry on a specific serial port. As per PX4 documentation, MAVlink is defaulty enabled over TELEM1 (MAV_0_CONFIG) if you use rCS as startup script.

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!