Skip to content

Commit 68acbb8

Browse files
committed
Fix socat bridge baudrate and path
1 parent c22a69c commit 68acbb8

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

docker/px4/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ RUN cat 6011_typhoon_h480 >> ROMFS/px4fmu_common/init.d-posix/airframes/6011_gaz
6262
# TODO: configure GPS serial ports in environment variables
6363
# Cube Orange: GPS 1 -> ttyS2, GPS 2 --> ttyS5
6464
RUN echo "gps start -d /dev/ttyS2 -e /dev/ttyS5 -p ubx" >> ROMFS/px4fmu_common/init.d-posix/rcS \
65-
&& echo "CONFIG_BOARD_SERIAL_GPS1=\"/dev/ttyS2\"" >> boards/px4/sitl/default.px4board \
66-
&& echo "CONFIG_BOARD_SERIAL_GPS2=\"/dev/ttyS5\"" >> boards/px4/sitl/default.px4board
65+
&& echo "CONFIG_BOARD_SERIAL_GPS1=\"/dev/pts/0\"" >> boards/px4/sitl/default.px4board # TODO use dynamically allocated PTY device, not hard-coded pts/0
66+
#&& echo "CONFIG_BOARD_SERIAL_GPS1=\"/dev/ttyS2\"" >> boards/px4/sitl/default.px4board \
67+
#&& echo "CONFIG_BOARD_SERIAL_GPS2=\"/dev/ttyS5\"" >> boards/px4/sitl/default.px4board
6768

6869
# Fix uXRCE-DDS bridge host (uXRCE-DDS middleware not on localhost)
6970
# GISNAV_COMPANION_IP needs to be set in entrypoint.sh

docker/px4/entrypoint.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@ mavlink-routerd -e ${GISNAV_COMPANION_IP:?empty or not set}:${GISNAV_CMP_MAVROS_
1414
# Docker than e.g. bridging via virtual serial ports (pseudo-ttys) on Docker
1515
# host
1616
#socat tcp-listen:15000 pty,link=/dev/ACM0 &
17-
echo "Setting up socat bridge at from TCP port ${SOCAT_BRIDGE_PORT:?empty or not set} to device /dev/ACM0"
18-
socat tcp-listen:${SOCAT_BRIDGE_PORT:?empty or not set},reuseaddr,fork pty,raw,echo=0,link=/dev/ACM0 &
17+
# TODO: do not hard code /dev/ttyS2, use .env file
18+
echo "Setting up socat bridge at from TCP port ${SOCAT_BRIDGE_PORT:?empty or not set} to /tmp/gisnav-pty-link"
19+
socat tcp-listen:${SOCAT_BRIDGE_PORT:?empty or not set},reuseaddr,fork pty,raw,echo=0,link=/tmp/gisnav-pty-link &
20+
echo "PTY device created at (might not show up until client connects at ${SOCAT_BRIDGE_PORT}): $(readlink /tmp/gisnav-pty-link)"
21+
22+
# Start socat and capture the PTY name
23+
#echo "Setting up socat bridge at from TCP port ${SOCAT_BRIDGE_PORT:?empty or not set} to PTY"
24+
#socat tcp-listen:${SOCAT_BRIDGE_PORT},reuseaddr,fork pty,link=/tmp/gisnav-pty-link,raw,echo=0 || (echo "Could not establish TCP-to-serial bridge."; exit 1) &
25+
#echo "PTS device created at (might not show up until client connects at ${SOCAT_BRIDGE_PORT}): $(readlink /tmp/gisnav-pty-link)"
1926

2027
# Setup uXRCE agent IP
2128
# PX4 needs the IP as int32 - convert_ip.py script does the conversion

docker/ubx/opt/colcon_ws/src/ubx_publisher/ubx_publisher/ubx_publisher_node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def __init__(self):
1313

1414
# Declare and get parameters
1515
self.declare_parameter("serial_port", "/dev/ttyUSB0")
16-
self.declare_parameter("baud_rate", 115200)
16+
self.declare_parameter("baud_rate", 9600)
1717

1818
self.serial_port = self.get_parameter("serial_port").value
1919
self.baud_rate = self.get_parameter("baud_rate").value

0 commit comments

Comments
 (0)