Browse Source

posix-configs/rpi: Fix mavlink over UART (/dev/ttyAMA0)

UART is the primary interface for telemetry radio: https://docs.emlid.com/navio2/ardupilot/hardware-setup/#uart-radio

Check first if /dev/ttyUSB0 exists (https://docs.emlid.com/navio2/ardupilot/hardware-setup/#usb-radio); if not, fall back to configuring over UART (/dev/ttyAMA0).

Use stricter check for character special file (-c) rather than just file (-f).

'console=serial0,115200' needs to be removed from /cmdline.txt as additional configuration step. This should be documented in the Navio2 section of docs.px4.io. Presumably, this is already performed as part of the Raspberry Pi OS prebuilt image Emlid spins.
sbg
blazczak 4 years ago committed by GitHub
parent
commit
57da61dc17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      posix-configs/rpi/px4.config
  2. 5
      posix-configs/rpi/px4_fw.config
  3. 5
      posix-configs/rpi/px4_test.config

5
posix-configs/rpi/px4.config

@ -45,9 +45,12 @@ mc_rate_control start @@ -45,9 +45,12 @@ mc_rate_control start
mavlink start -x -u 14556 -r 1000000
if [ -f /dev/ttyUSB0 ]
if [ -c /dev/ttyUSB0 ]
then
mavlink start -x -d /dev/ttyUSB0
elif [ -c /dev/ttyAMA0 ]
then
mavlink start -x -d /dev/ttyAMA0
fi
navio_sysfs_rc_in start

5
posix-configs/rpi/px4_fw.config

@ -44,9 +44,12 @@ fw_pos_control_l1 start @@ -44,9 +44,12 @@ fw_pos_control_l1 start
mavlink start -x -u 14556 -r 1000000
if [ -f /dev/ttyUSB0 ]
if [ -c /dev/ttyUSB0 ]
then
mavlink start -x -d /dev/ttyUSB0
elif [ -c /dev/ttyAMA0 ]
then
mavlink start -x -d /dev/ttyAMA0
fi
navio_sysfs_rc_in start

5
posix-configs/rpi/px4_test.config

@ -44,9 +44,12 @@ mc_att_control start @@ -44,9 +44,12 @@ mc_att_control start
mavlink start -x -u 14556 -r 1000000
if [ -f /dev/ttyUSB0 ]
if [ -c /dev/ttyUSB0 ]
then
mavlink start -x -d /dev/ttyUSB0
elif [ -c /dev/ttyAMA0 ]
then
mavlink start -x -d /dev/ttyAMA0
fi
navio_sysfs_rc_in start

Loading…
Cancel
Save