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

mavutil: add WebSocket Server mavlink_connection type #967

Merged
merged 2 commits into from
Aug 19, 2024

Conversation

IamPete1
Copy link
Member

@IamPete1 IamPete1 commented Aug 15, 2024

This adds support for a WebSocket server connection type. This is used with the prefix wsserver. For example wsserver:localhost:5763.

https://github.com/mavlink/mavlink2rest also does WebSockets, however, it sends a MAVLink JSON object in a text WebSocket message. This sends raw MAVLink in the binary WebSocket message.

I have tested with a browser based client. It does work, but I wrote it too, so its not a independent test. I have also only tested sending from server to client, not from client to server.

The more common python WebSocket library is designed for a asyncio workflow which makes it hard to integrate here. I ended up using wsproto mostly because it had a synchronous server example.

It would be nice to get multi client working in the future. I'm not sure if we would want that to work under this same prefix or if we would want to add a new prefix to enable that.

Packetisation to get more data into each packet might also be a good idea.

@tridge
Copy link
Contributor

tridge commented Aug 19, 2024

nice!

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

Successfully merging this pull request may close these issues.

3 participants