-
Notifications
You must be signed in to change notification settings - Fork 150
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
Mavlink router - add docs #412
base: master
Are you sure you want to change the base?
Conversation
Mode = Normal | ||
Address = 127.0.0.1 | ||
Port = 11000 | ||
Filter = 85 # Note: POSITION_TARGET_LOCAL_NED message id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we filter multiple messages - if so - how?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's comma separated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And although the old name should continue to work, it 's currently being renamed to AllowMsgIdOut
I've removed myself as a reviewer. I don't actually understand the config options of mavlink-router, and I've used it max 3 times in my life. I'm adding @JonasVautherin instead. |
@lucasdemarchi I was wondering if you could advise/review this PR. The purpose is to provide visibility of the tool from MAVLink.io. Also because the docs you have do not clearly outline the "options" (all the information is there, but not as "digestible" as listing the tool help output and better highlighting the sample config). I see you're doing some improvements too in mavlink-router/mavlink-router#305 |
|
||
### Routing from a UART to other endpoints | ||
|
||
To route mavlink packets from `ttyS1` to two UDP endpoints (from the official docs!): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the wording regarding "from" and "to" could be improved. mavlink-router doesn't differentiate endpoints like this
To route mavlink packets from `ttyS1` to two UDP endpoints (from the official docs!): | ||
|
||
```bash | ||
mavlink-routerd -e 192.168.7.1:14550 -e 127.0.0.1:14550 /dev/ttyS1:1500000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Traffic is also routed between 192.168.7.1:14550 and 127.0.0.1:14550 if a packet that is send to a system/component available in that endpoint (or if it's a broadcast).
I'm preferring to document it like:
mavlink-routerd -e 192.168.7.1:14550 -e 127.0.0.1:14550 -e /dev/ttyS1:1500000
so it's clear they are all "Endpoints". I realize this is not what the README.md is currently saying. Maybe one thing that could help is to show how the command line options translate to config, which is maybe clearer to understand. In this example it would be:
[UartEndpoint uart0]
Device = /dev/ttyS1
Baud = 1500000
[UdpEndpoint udp0]
Address = 192.168.7.1
Port = 14550
[UdpEndpoint udp1]
Address = 127.0.0.1
Port = 14550
It's also possible to route mavlinks packets from any interface using: | ||
|
||
```bash | ||
mavlink-routerd -e 192.168.7.1:14550 -e 127.0.0.1:14550 0.0.0.0:24550 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is equivalent to:
[UdpEndpoint udp0]
Address = 192.168.7.1
Port = 14550
[UdpEndpoint udp1]
Address = 127.0.0.1
Port = 14550
[UdpEndpoint udp0]
Address = 192.168.7.1
Port = 14550
[UdpEndpoint udp2]
Mode = server
Address = 0.0.0.0
Port = 24550
the missing -e
only matters for an UDP endpoint and makes that UDP endpoint be in "server mode". In other words, it will listen for packets in that specific port instead of sending to that specific port.
IPv6 addresses must be enclosed in square brackets like this: `[::1]`. | ||
The port number can be specified in the same way, as with IPv4 then: `[::1]:14550`. | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should also mention the provided systemd service. Provided one installed via package or via ninja -C build install
, the normal systemctl <start|enable> mavlink-router
can be used to make it permanent (which makes sense when it's running on a companion computer) rather than starting it manually or via hack scripts.
Port = 14550 | ||
|
||
[UdpEndpoint SIM] | ||
Mode = Eavesdropping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is deprecated, please use "server"
``` | ||
[UdpEndpoint QGC] | ||
Mode = Normal | ||
Address = 10.73.41.30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a better or more realistic example here would be to use a broadcast address. This has a special behavior: packets are sent as broadcast until something responds back. After the response we "lock into that ip:port that provided the reply". This way you don't have to bother with your desktop/laptop having a different IP assigned
Mode = Normal | ||
Address = 127.0.0.1 | ||
Port = 11000 | ||
Filter = 85 # Note: POSITION_TARGET_LOCAL_NED message id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's comma separated
Mode = Normal | ||
Address = 127.0.0.1 | ||
Port = 11000 | ||
Filter = 85 # Note: POSITION_TARGET_LOCAL_NED message id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And although the old name should continue to work, it 's currently being renamed to AllowMsgIdOut
@hamishwillee added some suggestions above. Also adding here @jbeyerstedt for feedback since he is cleaning up mavlink-router and improving it a lot lately. My worry is that this has a lot of copy and paste from mavlink-router and it will get outdated. Maybe it should focus on some real world scenarios rather than trying to replicate everything? Dunno, if you think this doc can be kept in sync, it's up to you. We have no plans to do changes that are not backward-compatible, but it's good if docs always points to the recommended options. |
The readme of mavlink-router definitely needs some more love especially regarding some confusion what the software does and what not. I already started to do some restructuring and re-wording (merged two weeks ago), but the main part is still WIP in mavlink-router/mavlink-router#305. I think, the mavlink website is a great place to "promote", what tools exist what you can do with them. But I also share the apprehension of Lucas, that having so many details of the syntax will lead to an outdated page quite soon. So a focus on usage examples might be a a good solution? But I will definitely take a look at your document when finishing mavlink-router/mavlink-router#305. Feel free to add comments there as well. I still need to think of a good solution to document the config file syntax, tough. |
@lucasdemarchi @jbeyerstedt Firstly, thanks for commenting and for your work on mavlink-router. I made this change for several reasons.
I share your concern. What I think we should do is put this on hold until your WIP is merge. I will try get some time to comment on that next week. It would be great if your readme could include some of the common use cases as examples. When I get a new question on how to do something we could discuss whether that new question belongs in the set of howtos. Then we could always advise the right way to do the common things. |
Moving to draft pending mavlink-router/mavlink-router#305 |
That sounds good. Thanks. Yeah, particularly about the config documentation: we need to move it somewhere. Maybe add a gh-pages and have all the options documented there? |
I don't have a strong opinion about where it should be, but it has to be a lot easier to find than it is now. That's why this PR included it front and centre. |
This provide docs about mavlink router. Note that the official docs are pretty good, but IMO have some flaws:
This adds the syntax, the sample config file, and a few use cases. Next time we get a new "how do I do this" we can add to that.
NOTE, the position in hierarchy might change. We should, for example, also talk about mavproxy.