Skip to content

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Jul 29, 2025

This builds on the work by @IamPete1 in #995 and gets the generated javascript to pass tests, plus work in both a browser and in command line node tools

example usage: ArduPilot/WebTools#265

also adds wss support to mavutil.py, so mavproxy can use wss: connections

@tridge tridge force-pushed the pr-javascript-browser branch from ce6dbd9 to 6a41537 Compare July 29, 2025 10:58
@tridge tridge force-pushed the pr-javascript-browser branch from 6a41537 to eeec1d7 Compare July 29, 2025 10:58
@tridge tridge force-pushed the pr-javascript-browser branch from eeec1d7 to 0a33fe4 Compare July 29, 2025 22:23
@tridge
Copy link
Contributor Author

tridge commented Jul 30, 2025

@Huibean could you test this with your browser efforts?

@Huibean
Copy link
Member

Huibean commented Jul 30, 2025

@tridge I just have a try using mavlink.js generated in this pr, the program freeze up every time after connect websocket/webserial, something wrong inside mavlinkProcessor.send, tomorrow will digging into it
image

@tridge
Copy link
Contributor Author

tridge commented Jul 30, 2025

something wrong inside mavlinkProcessor.send, tomorrow will digging into it

ok, thanks!

@Huibean
Copy link
Member

Huibean commented Jul 30, 2025

@tridge there is a dead loop here
image

@tridge
Copy link
Contributor Author

tridge commented Jul 30, 2025

there is a dead loop here

does it keep getting messages?

@Huibean
Copy link
Member

Huibean commented Jul 30, 2025

there is a dead loop here

does it keep getting messages?

function just called once, I set a breakpoint there once enter while never return, then memory leak and crash

@Huibean
Copy link
Member

Huibean commented Jul 31, 2025

image runtime error logs is going into the parse buffer, I temporary fix it by checking BAD_DATA, now I will fix the "Unpack" import error and continue
MAVLink20Processor.prototype.parseBuffer = function(s) {

    // Get a message, if one is available in the stream.
    var m = this.parseChar(s);

    // No messages available, bail.
    if ( null === m ) {
        return null;
    }

    // While more valid messages can be read from the existing buffer, add
    // them to the array of new messages and return them.
    var ret = [];
    ret.push(m);
    while(true) {
        m = this.parseChar(null);
        if ( null === m || m._id === mavlink20.MAVLINK_MSG_ID_BAD_DATA) {
            // No more messages left.
            return ret;
        }
        ret.push(m);
    }

}

@tridge
Copy link
Contributor Author

tridge commented Aug 1, 2025

discussed with @Huibean, working now

@tridge tridge merged commit ff5d644 into ArduPilot:master Aug 1, 2025
22 checks passed
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