April 5Apr 5 Hi, i will try to get this working, someone got a plugin for WinWing to get the screen of the WT21 CDU's from MSFS2024. its this plugin for the Community folder: https://flightsim.to/addon/105898/mobiflight-plugin-for-msfs-2024-wt21-cdus the .js script code says it sends the screen via: const MF_CAPT = "ws://localhost:8320/winwing/cdu-captain"; so i need a websocket -> HTTP bridge to get it to work with AaO. With my very limited programming skills and ChatGTP i just go the following code for the main.js const express = require("express"); const WebSocket = require("ws"); const path = require("path"); const app = express(); const port = 9080; const WS_URL = "ws://localhost:8320/winwing/cdu-captain"; let latestData = null; const ws = new WebSocket(WS_URL); ws.on("open", () => { console.log("Verbunden mit MSFS CDU WebSocket"); }); ws.on("message", (data) => { try { latestData = JSON.parse(data); } catch (e) {} }); ws.on("close", () => { console.log(" Verbindung verloren – reconnect in 5s..."); setTimeout(() => process.exit(1), 5000); }); app.get("/cdu", (req, res) => { res.json(latestData); }); app.use("/", express.static(path.join(__dirname, "public"))); app.listen(port, () => { console.log(`CDU läuft auf http://localhost:${port}`); }); my index.html for AaO looks like this <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>CJ4 CDU</title> <style> body { background: #111; color: #0f0; font-family: monospace; display: flex; justify-content: center; align-items: center; height: 100vh; } #cdu { display: grid; grid-template-columns: repeat(24, 14px); grid-template-rows: repeat(14, 20px); gap: 2px; background: black; padding: 10px; border: 3px solid #333; } .cell { text-align: center; white-space: pre; } /* Farben */ .c-w { color: white; } .c-g { color: #00ff00; } .c-y { color: yellow; } .c-m { color: magenta; } .c-o { color: cyan; } .c-e { color: grey; } /* Größen */ .small { font-size: 10px; } .large { font-size: 14px; font-weight: bold; } </style> </head> <body> <div id="cdu"></div> <script> async function update() { try { const res = await fetch("/cdu"); const data = await res.json(); if (!data || !data.Data) return; const container = document.getElementById("cdu"); container.innerHTML = ""; data.Data.forEach(cell => { const el = document.createElement("div"); el.classList.add("cell"); const char = cell[0] || " "; const color = cell[1] || "w"; const size = cell[2] === 1 ? "small" : "large"; el.textContent = char; el.classList.add("c-" + color); el.classList.add(size); container.appendChild(el); }); } catch (e) {} } setInterval(update, 150); </script> </body> </html> sadly this did not the trick and i just see the HTML border i created for the screen when i open the html file. So any advice to the right direction appreaciated 🙂 Edit: in short is there a way for me to websocket -> HTTP bridge via Axis and Ohs, or is this not implemented and i need another bridge for that? Mobiflight/Node.js Bridge ? Edited April 5Apr 5 by Bam2000
April 5Apr 5 Commercial Member Sorry, no clue. Node JS is not my world. And Mobiflight even less so. From my point of view it would be a lot easier to make a native bridge, similar for example to the one that I made for the BKSQ Starship. Or maybe this requires a Plugin, like the WT G1000. This would require that you familiarize yourself with the Coherent Debugger from the MSFS SDK. Very powerful tool to analyze the HTML/Js part of the running sim. Edited April 5Apr 5 by Lorby_SI LORBY-SI
April 5Apr 5 Commercial Member 13 hours ago, Bam2000 said: will try to get this working, Here you go: https://www.dropbox.com/scl/fi/fezkl6lkfhe6as7ovbhv4/cj4fmc.zip?rlkey=61fxa7agz5cwqrlc46z9m1ein&dl=0 This is the old native CDU technique as an AAO web page (in fact, it is actually the old one...) but with an updated Community package for MSFS 2024. I've tested it with the CJ4 and it seemed to work fine. The WT21 supports the MSFS2024 instrument plugin system, so no problems there. Edited April 5Apr 5 by Lorby_SI LORBY-SI
April 6Apr 6 Author 10 hours ago, Lorby_SI said: Here you go: https://www.dropbox.com/scl/fi/fezkl6lkfhe6as7ovbhv4/cj4fmc.zip?rlkey=61fxa7agz5cwqrlc46z9m1ein&dl=0 This is the old native CDU technique as an AAO web page (in fact, it is actually the old one...) but with an updated Community package for MSFS 2024. I've tested it with the CJ4 and it seemed to work fine. The WT21 supports the MSFS2024 instrument plugin system, so no problems there. working like a charm, thank you soooo much :)
Create an account or sign in to comment