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

about baudrate of serial #10450

Closed
roseyangyu opened this issue Sep 11, 2018 · 12 comments
Closed

about baudrate of serial #10450

roseyangyu opened this issue Sep 11, 2018 · 12 comments
Labels

Comments

@roseyangyu
Copy link

I want to control the telem 1 to stop sending mavlink message,I want telem 1 to output the message that is Custom-Defined.And how do I do to config the baudrate of serial4/5?

@julianoes
Copy link
Contributor

May I ask what piece of hardware you are referring to? That way we can figure out what your requests map to in code.

@roseyangyu
Copy link
Author

I used pixhawk 2,I want to config telem1 and serial4/5.I hope the telem1 don't output mavlink so much so that I can make it output the message that is I need.And the baudrate of serial4/5 how to config?

@roseyangyu
Copy link
Author

In QGC ,I can't fiind the parameter to config that

@julianoes
Copy link
Contributor

Ok, Pixhawk2, let's check the docs:
https://docs.px4.io/en/flight_controller/pixhawk-2.html

It tells us that this is a FMUv3. Therefore, let's check the init script which is run:
https://github.com/PX4/Firmware/blob/90b60d44dc4fa4d859051ef2f46c8d6f03054279/ROMFS/px4fmu_common/init.d/rcS#L18-L25

Then everything mavlink will be started in rc.mavlink according to:
https://github.com/PX4/Firmware/blob/90b60d44dc4fa4d859051ef2f46c8d6f03054279/ROMFS/px4fmu_common/init.d/rcS#L486-L489

So, let's look at rc.mavlink. I believe the default Telem1 mavlink instance is this:
https://github.com/PX4/Firmware/blob/90b60d44dc4fa4d859051ef2f46c8d6f03054279/ROMFS/px4fmu_common/init.d/rc.mavlink#L38
https://github.com/PX4/Firmware/blob/90b60d44dc4fa4d859051ef2f46c8d6f03054279/ROMFS/px4fmu_common/init.d/rc.mavlink#L78

I want telem 1 to output the message that is Custom-Defined.

For this you can comment out the line above, so mavlink is not started on telem1. Then you can write your own module which writes your custom defined thing.

And how do I do to config the baudrate of serial4/5?

Let's go back to this:
https://github.com/PX4/Firmware/blob/90b60d44dc4fa4d859051ef2f46c8d6f03054279/ROMFS/px4fmu_common/init.d/rcS#L24-L25

Therefore Serial 4/5 should be UART7/UART8. The baudrate is defined in the defconfig:
https://github.com/PX4/Firmware/blob/90b60d44dc4fa4d859051ef2f46c8d6f03054279/platforms/nuttx/nuttx-configs/px4fmu-v2/nsh/defconfig#L1100
https://github.com/PX4/Firmware/blob/90b60d44dc4fa4d859051ef2f46c8d6f03054279/platforms/nuttx/nuttx-configs/px4fmu-v2/nsh/defconfig#L1113

@bkueng
Copy link
Member

bkueng commented Sep 12, 2018

FYI this will make the UARTs configurable: #10337

@roseyangyu
Copy link
Author

I‘m exciting very much! Thank you very much! @julianoes and @bkueng

@roseyangyu
Copy link
Author

but I have not rc.mavlink. I use v1.8.0.

@julianoes
Copy link
Contributor

but I have not rc.mavlink. I use v1.8.0.

Same thing there:
https://github.com/PX4/Firmware/blob/v1.8.0/ROMFS/px4fmu_common/init.d/rcS#L604

@roseyangyu roseyangyu reopened this Sep 13, 2018
@roseyangyu
Copy link
Author

I have config UART7 and UART8 to 115200,but It seems that the baud rate has not changed.It still is 57600.

@roseyangyu
Copy link
Author

config telem1 sucessfully! thank you again

@julianoes
Copy link
Contributor

@roseyangyu have you done a make clean after changing the defconfig?

@roseyangyu
Copy link
Author

oh i'm sorry.thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants