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

Add MAVLink forwarding via WebSocket server #3423

Closed
wants to merge 2 commits into from

Conversation

IamPete1
Copy link
Member

@IamPete1 IamPete1 commented Sep 28, 2024

This adds forwarding to WebSockets. I have only tested sending from MissionPlanner to the WebSocket not the other way (my application does not support send). So far I have been using pymavlink with ArduPilot/pymavlink#967.

This very hacky currently. It doesn't work if you open the same connection more than once for example. I'm not cleaning up correctly I guess, but this is right on the edge of my c# knowledge.

This does add Fleck as a new dependency, it makes the server stuff easier. https://github.com/statianzo/Fleck

This is more or less a Fleck example and code copied from the existing client WebServer stuff.

@meee1
Copy link
Contributor

meee1 commented Sep 28, 2024

if (url.Contains(" /websocket/server"))

This is the internal server I mentioned.

Looks like your code is a client though, vs the existing is serverside

@meee1
Copy link
Contributor

meee1 commented Sep 28, 2024

My use case was a browser connecting to MP as the data source

Yours is to push data to somewhere?

@meee1
Copy link
Contributor

meee1 commented Sep 28, 2024

public class WebSocket : CommsBase, ICommsSerial, IDisposable

This one is for connecting to a socketio ws service as a client

@IamPete1
Copy link
Member Author

My use case was a browser connecting to MP as the data source

Yours is to push data to somewhere?

Right, mission planner connects directly to the vehicle then it forwards onto a web based dashboard.

@meee1
Copy link
Contributor

meee1 commented Sep 28, 2024

I assume you have something working? As I would have thought the dashboard makes the connection to the backend vs the backend connecting to the frontend

Ws://127.0.0.1:56781/websocket/server

Ws://127.0.0.1:56781/websocket/raw

Http://127.0.0.1:56781/hud.html

Example

     https://yar.oborne.me/

@IamPete1
Copy link
Member Author

I assume you have something working?

https://github.com/IamPete1/WebTools/tree/MAVLink_Dashboard

As with all the WebTools it is 100% client side, so the only option we have is WebSocket client (we could do direct COM ports too but I haven't implemented).

@IamPete1
Copy link
Member Author

Turns out MissionPlanner already forwards on ws://127.0.0.1:56781. So we don't need this PR. ArduPilot/WebTools#196 adds auto connection.

@IamPete1 IamPete1 closed this Oct 24, 2024
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.

2 participants