Writing auto-pilots in JavaScript for MSFS

Error when Running API Server with MSFS: Illegal Offset RangeError#24

Closed
Opened 11/29/202314 commentsby mohammaddhaji
mohammaddhaji

Hi. I have problem running the code. Below is the API server log when i run it while MSFS is up: ``` No ALOS data folder specified, elevation service will not be available. Server listening on http://localhost:8080 Connected to MSFS Registering API server to PAUSE, UNPAUSED, CRASH, and SIM events. new flight started, resetting autopilot Server to server socket established sending MSFS event sending MSFS event adding event listener for SIM registering event listener with the simconnect wrapper adding event listener for PAUSED registering event listener with the simconnect wrapper adding event listener for UNPAUSED registering event listener with the simconnect wrapper adding event listener for VIEW registering event listener with the simconnect wrapper RecvException { exception: 7, sendId: 21, index: 2 } RecvException { exception: 7, sendId: 22, index: 2 } RecvException { exception: 7, sendId: 26, index: 2 } D:\Programming\Javascript\are-we-flying\node_modules\bytebuffer\dist\bytebuffer-node.js:1403 throw RangeError("Illegal offset: 0 <= "+offset+" (+"+8+") <= "+this.buffer.length); ^ RangeError: Illegal offset: 0 <= 616 (+8) <= 620 at module.exports.ByteBufferPrototype.readFloat64 (D:\Programming\Javascript\are-we-flying\node_modules\bytebuffer\dist\bytebuffer-node.js:1403:23) at RawBuffer.readFloat64 (D:\Programming\Javascript\are-we-flying\node_modules\node-simconnect\dist\RawBuffer.js:75:28) at Object.read (file:///D:/Programming/Javascript/are-we-flying/node_modules/msfs-simconnect-api-wrapper/simvars/simvar-utils.js:8:44) at file:///D:/Programming/Javascript/are-we-flying/node_modules/msfs-simconnect-api-wrapper/msfs-api.js:257:52 at Array.forEach (<anonymous>) at SimConnectConnection.handleDataRequest (file:///D:/Programming/Javascript/are-we-flying/node_modules/msfs-simconnect-api-wrapper/msfs-api.js:256:21) at SimConnectConnection.emit (node:events:524:35) at SimConnectConnection.emit (D:\Programming\Javascript\are-we-flying\node_modules\node-simconnect\dist\SimConnectConnection.js:89:22) at SimConnectConnection._handleMessage (D:\Programming\Javascript\are-we-flying\node_modules\node-simconnect\dist\SimConnectConnection.js:1042:22) at SimConnectSocket.emit (node:events:512:28) Node.js v19.5.0 ``` And the web server log: ``` Server listening on http://localhost:3000 no API server (yet), retrying in 5 seconds Client socket established. API Server socket established going back into wait mode no API server (yet), retrying in 5 seconds ``` I don't get this error when I run API server before MSFS. But in that case nothing works. (when i click on take-off nothing happens and I can't put waypoints on map). Node version: 19.5.0 .env file: ``` export DATA_FOLDER= export ALOS_PORT=9000 export WEB_PORT=3000 export API_PORT=8080 export FLIGHT_OWNER_KEY=FOK-12345 ``` Is there anything that I'm missing?

AI Analysis

This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by mohammaddhaji and has received 14 comments.

Add a comment
Comment form would go here