bluenviron / mavp2p

flexible and efficient Mavlink router
MIT License
127 stars 31 forks source link

Hardware flow control support #50

Open Kester-Broatch opened 11 months ago

Kester-Broatch commented 11 months ago

Hi again!

I noticed recently when testing mavp2p with a pixhawk flight controller (with px4 firmware) that mavp2p does not support serial hardware flow control. Some PX4/pixhawk versions uses flow control for it's telemetry serial ports - https://docs.px4.io/main/en/flight_controller/pixhawk4.html#serial-port-mapping - so I was unable to connect.

I had a look at the mavp2p code base to see if i could enable it, but you seem to use the https://github.com/tarm/serial library which does not support flow control I think (I saw this ticket https://github.com/tarm/serial/issues/68).

So I was wondering if you would consider changing serial library to one which can support flow control, and then presumably to add an argument to the mavp2p serial port selection to enable/disable flow control?

Thanks! Kester

aler9 commented 9 months ago

Hello @Kester-Broatch, i replaced github.com/tarm/serial with go.bug.st/serial and added calls to SetDTR(true) and SetRTS(true), but since i don't own a hardware flow control-capable board, i can't to merge those changes into the main branch without a real test.

Therefore, the result is in the serial-hfc branch in both gomavlib and mavp2p:

https://github.com/bluenviron/gomavlib/tree/serial-hfc https://github.com/bluenviron/mavp2p/tree/serial-hfc

You can find a nightly release here (click on artifacts, binaries):

https://github.com/bluenviron/mavp2p/actions/runs/7201143388

If you confirm that this feature works, i'll merge it into the main branch.