Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTPS Serial Port Initialisation Insufficient #9428

Closed
drisebor opened this issue May 7, 2018 · 3 comments
Closed

RTPS Serial Port Initialisation Insufficient #9428

drisebor opened this issue May 7, 2018 · 3 comments

Comments

@drisebor
Copy link
Contributor

drisebor commented May 7, 2018

The msg/templates/urtps/microRTPS_transport.cpp file only sets up one of the termios configuration flags for the serial port, ie in UART_node::init() :

// Clear ONLCR flag (which appends a CR for every LF)
uart_config.c_oflag &= ~ONLCR;

This causes unpredictable behaviour on some platforms depending on the previous serial port setup.

When running posix_sitl_rtps on Ubuntu, accessing the same serial port beforehand as used for RTPS using PuTTY but with different settings causes serial communications to fail (no bytes received). For example setting up odd parity using putty prevents any communication over RTPS. Communication may also fail immediately after Ubuntu boots.

The setup code needs to be modified to lock down all relevant flags and variables in termios to non-canonical, binary transmit and receive, 8 bits, 1 stop bit, no parity, which is what RTPS over serial on the Pixhawk currently defaults to.

@bkueng
Copy link
Member

bkueng commented May 8, 2018

I agree. Can you send a PR please?

drisebor added a commit to drisebor/Firmware that referenced this issue May 8, 2018
…ion.

As per issue PX4#9428, this code change locks down the termios configuration
for the UART to non-canonical, binary tx/rx, 8 bits, 1 stop bit, no parity.
@drisebor
Copy link
Contributor Author

drisebor commented May 8, 2018

PR done. It should be ok. It's a very comprehensive lockdown of the Termios configuration.

LorenzMeier pushed a commit that referenced this issue May 11, 2018
…ion.

As per issue #9428, this code change locks down the termios configuration
for the UART to non-canonical, binary tx/rx, 8 bits, 1 stop bit, no parity.
@TSC21
Copy link
Member

TSC21 commented Dec 10, 2018

Solved.

@TSC21 TSC21 closed this as completed Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants