Jump to content
The simFlight Network Forums

Dabull

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by Dabull

  1. No probem. Got it now. Thanks for the great tool.
  2. I get a notice the v0.3.2 is available but when I got to the website on v0.3.1 is available. Should I be checking somewhere else?
  3. It happens while in use . I haven't been able to pnpoint a specific interval as it could be a couple times in a minute and then not at all for ten minutes. I won't worry about it anymore since I have a handler on reestablishing the connection if it closes. Thanks.
  4. Is it normal for the Web Socket to intermittently disconnect. It took me awhile to figure out this behavior and write logic to deal with it, which I can handle now without crashing the program. But is it normal to have these unexpected disconnects?
  5. I got it now. It works now. Thanks for your patience in helping me.
  6. I think I tried that before. Sitting at MGCT airport (latitude: 14.6946573257446 Longitude: -91.8814315795899). When I read 6010/6018 as lat/lon type versus float I get this: { name: "latitude", address: 0x6010, type: "float", size: 8 }, { name: "writelatitude", address: 0x6010, type: "lat", size: 8 }, { name: "longitude", address: 0x6018, type: "float", size: 8 }, { name: "writelongitude", address: 0x6018, type: "lon", size: 8 }, Lat/Lon Float: 14.696005552849051,-91.87789736218718 Lat/Lon Write : 9688.75418157663,-89.522262409018 Float is correct. The lat/lon type isn;t returning correct values.
  7. I just realized that I can't write to 6010 and 6018 for latitude/longitude. I have to use 0560 & 0568. However, the computation for that field is complicated and I have no clue what some of the terms are. Any one know what the computation is to turn degrees lat/lon to write to those offsets? Thanks.
  8. Ok never mind. They referred to 0574 but that one is not listed explicitly in the FSUIPC document. x0574 is for the whole meters and x0570 is for the fractional part of the altitude. Hence my crashing at low altitude.
  9. It worked for heading. But for altitude I could not write as x6020 you cannot write to. So I found x0570 that you can write to. But it behaves oddly when I pass the altitude in meters. It flips the plane over and shuts the engine off. Is the computation for writing to this offset different?
  10. Can someone please verify if this is the correct reverse computation to write back heading (0x0580) and altitude (0x6020) to the sim? I think altitude is pretty much easy. I am not convinced of the heading though. I extracted it as follows: heading = Math.round(response.data.heading * 360 / (65536*65536)) altitude = Math.round(response.data.altitude * 3.28084) And I plan to write back as follows: var newheading = (plannedrecord.heading / 360) * (65536/65536) var newaltitude = plannedrecord.altitude / 3.28084
  11. I added more weight and I can see the aircraft reacting to the load. So it is a UI issue of not refreshing based on weight loaded from backend.
  12. Interestingly when I read back the payload after sending specific amounts I can see the stations have been loaded correctly at least data wise in MSFS: payloadStations: [ { index: 0, name: 'TT:MENU.PAYLOAD.', weight: 170, position: [Object] }, { index: 1, name: 'TT:MENU.PAYLOAD.', weight: 170, position: [Object] } ], But when you look in the UI it doesn't show up. This is the same result whether I use 'payload.autoload' or 'payload.write', using different aircraft. So it may be an MSFS issue.
  13. I am not sure why the passenger load is not working. The fuel part loads fine. Here is my code. I have been testing on stock DA40NG in MSFS. Cargo variable is 0. So I am trying to load 510 which is equivalent to 3 passengers at 170lbs/pax. But the stations all remain zero. Also does the payload include the pilot station? var fuelload = Math.round(plannedrecord.maxFuel * .75) var passengers if (plannedrecord.passengers === 0){ passengers = 0 } else { passengers = plannedrecord.passengers * 170 } var payload = (510 + plannedrecord.cargo) console.log (payload) var request = { command: 'payload.autoload', volumeUnit: 'gal', weightUnit: 'Lbs', length: 'm', method: 'set', totalFuelWeight: fuelload, totalPayloadWeight: payload } // send to the server as a JSON string if (wsstatus !== 'null' || wsstatus !== 'error'){ ws.send(JSON.stringify(request)); }
  14. Thank you that makes sense now. Took me awhile to understand it. I am able to convert the values to meaningful ones.
  15. Honestly most of the values don't make sense: I sent this: offsets: [ { name: 'aircraftName', address: 0x3D00, type: 'string', size: 256 }, { name: 'altitude', address: 0x0570, type: 'uint', size: 8 }, { name: 'heading', address: 0x0580, type: 'uint', size: 4 }, {name: 'groundSpeed', address: 0x6030, type: 'uint', size: 8}, {name: 'latitude', address: 0x6010, type: 'int', size: 8}, {name: 'longitude', address: 0x6018, type: 'int', size: 8}, {name: 'verticalSpeed', address: 0x030C, type: 'int', size: 4}, {name: 'onGround', address: 0x0366, type: 'int', size: 2} ] and I get this: { aircraftName: 'Cessna CJ4 Citation WT', altitude: 61267640065450, heading: 1445037629, groundSpeed: 4641275633426061000, latitude: -4606115315203747000, longitude: -4588245414674943500, verticalSpeed: 8, onGround: 0 } I have no clue what a floating point double is. How do I convert these values to something meaningful.
  16. Funny you mentioned lat and lon I am trying to read those and the values don't look correct. I send this: {name: 'latitude', address: 0x6010, type: 'int', size: 8}, {name: 'longitude', address: 0x6018, type: 'int', size: 8}, But the returned values aren't correct. Is there another way to get those values?
  17. Thanks Paul. That worked. I just have one more question. I noticed you have to pass the offset type when requesting. Where do you get the type from. The FSUIPC Offset Status document doesn't have the type.
  18. Ah. Silly me I didn't pay attention to that. I can make the offsets.declare call now. But...I am not sure how to sequence the declare request and that read request to make it repeatable . Does all the commands need to be in the ws.onopen function?
  19. Yes. I am on the latest version of of WebSocketServer. I am running JS code in VS Code. Here is the code: const WebSocket = require('ws'); var ws = new WebSocket('ws://localhost:2048/fsuipc/', "fsuipc"); // Handle the onopen event ws.onopen = function () { console.log("Connection Open"); var request = { command: 'offsets.declare', name: 'myOffsets', offsets: [ { name: 'altitude', address: 0x0570, type: 'int', size: 8 }, { name: 'avionicsMaster', address: 0x2E80, type: 'uint', size: 4 }, { name: 'heading', address: 0x0580, type: 'uint', size: 4 }, { name: 'aircraftName', address: 0x3D00, type: 'string', size: 256 }, ] } ws.send(JSON.stringify(request)); ws.close() }; // Handle the onclose event ws.onclose = function () { console.log("Connection Closed"); // clear the WebSocket so we can try again ws = null; }; // Handle the onerror event ws.onerror = function (err) { console.error("WebSocket Error: ",err.message); }; ws.onmessage = function (msg) { // parse the JCON string to a Javascript object var response = JSON.parse(msg.data); // If the response indicated success then we can proceed to process it if (response.success) { // handle the response according to the command. // could also use the name, or both. switch (response.command) { case "about.read": console.log(response.data) break; default: // Unhandled command console.log("Unknown command: " + response.command); break; } } else { // The request failed. Handle the errors here. // In this example we just display errors to the webpage var error = 'Error for ' + response.name + ' (' + response.command + '): '; error += response.errorCode + " - " + response.errorMessage; console.log(error); } };
  20. I am running the client and everything is connected, but when I try the following commands it says it is not recognized: Unknown command: payload.read Unknown command: offsets.declare I am using the example requests from the website. The only command that works is: about.read I am running MSFS on Windows 10. Can someone help find out what I may be doing wrong? Thanks.
  21. Thanks for the quick reply. Yeah. I am not sure what device that is. Not sure how to find it and disable it. But if it will be fixed in a couple days I can wait. How do I know an update is available. Will there be an email notification?
  22. Please help. I just registered FSUIPC4 and now FSX crashes on load. I tried the Loader.DLL solution. FSX loads now, but I do not see the AddOn menu for FSUIPC anymore. Does that mean it is loaded? Install Log: Installer for FSUIPC4.DLL version 4.967 Looking in registry for FSX install path: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Flight Simulator\10.0 Parameter"SetupPath" ... >>> OK! FOUND FSX! <<< ... SetupPath=C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\ Looking in registry for FSX-SE install path: HKEY_LOCAL_MACHINE\SOFTWARE\DovetailGames\FSX Parameter"Install_Path" Not there, so looking in: HKEY_CURRENT_USER\SOFTWARE\DovetailGames\FSX Parameter"AppPath" Not there, so looking in: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Flight Simulator - Steam Edition\10.0 Parameter"SetupPath" Not there, so looking in: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Microsoft Games\Flight Simulator - Steam Edition\10.0 Parameter"AppPath" ... NOT found! ... Looking in registry for Prepar3D v1 install path: HKEY_LOCAL_MACHINE\SOFTWARE\LockheedMartin\Prepar3D Parameter"SetupPath" Not there, so looking in: HKEY_CURRENT_USER\SOFTWARE\LockheedMartin\Prepar3D Parameter"AppPath" ... NOT found! ... Looking in registry for Prepar3D v2 install path: HKEY_LOCAL_MACHINE\SOFTWARE\Lockheed Martin\Prepar3D v2 Parameter"SetupPath" Not there, so looking in: HKEY_CURRENT_USER\SOFTWARE\Lockheed Martin\Prepar3D v2 Parameter"AppPath" ... NOT found! ... Looking in registry for Prepar3D v3 install path: HKEY_LOCAL_MACHINE\SOFTWARE\Lockheed Martin\Prepar3D v3 Parameter"SetupPath" Not there, so looking in: HKEY_CURRENT_USER\SOFTWARE\Lockheed Martin\Prepar3D v3 Parameter"AppPath" ... NOT found! ... =========================================================== INSTALLATION FOR FSX: SetupPath="C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\" Checking version of the FSX EXE: ... Version 10.0.61472.0 (Need at least 10.0.60905.0) Checking compatibility with installed SimConnect: Found SimConnect build 60905 (Original) Found SimConnect build 61242 (SP1 May07) Found SimConnect build 61259 (Acc/SP2 Oct07) Checking if there's already a version of FSUIPC4 installed in: C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\FSUIPC4.DLL ... Version 4.967 found. FSX Modules folder already exists. Okay -- installed FSUIPC4 into "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\FSUIPC4.DLL" Looking for the current user's Application Data path: ... found as "C:\Users\XXX\AppData\Roaming" Now finding \Microsoft\FSX\FSX.CFG for all users, including this one Looking in "C:\Users\All Users\AppData\Roaming" ... No FSX.CFG there Looking in "C:\Users\Default\AppData\Roaming" ... No FSX.CFG there Looking in "C:\Users\Default User\AppData\Roaming" ... No FSX.CFG there Looking in "C:\Users\Default.migrated\AppData\Roaming" ... No FSX.CFG there Looking in "C:\Users\XXX\AppData\Roaming" ... No FSX.CFG there Looking in "C:\Users\XXX\AppData\Roaming" ... No FSX.CFG there Looking in "C:\Users\XXX\AppData\Roaming" Found FSX.CFG in "C:\Users\XXX\AppData\Roaming\Microsoft\FSX\FSX.CFG" Now checking DLL.XML ... ... There is a previous DLL.XML, checking for FSUIPC4 section. ... FSUIPC4 section already exists but will be replaced. (with FSUIPC4_Loader entry) ... FSUIPC4 section of DLL.XML written okay Now checking for a SimConnect.XML file ... ... No SimConnect.XML file found. This is okay. Looking in "C:\Users\Public\AppData\Roaming" ... No FSX.CFG there "Modules\FSUIPC Documents" folder already exists. Now installing additional files into the "Modules\FSUIPC Documents" folder: Installed "FSUIPC4 User Guide.pdf" okay Installed "FSUIPC4 for Advanced Users.pdf" okay Installed "FSUIPC4 History.pdf" okay Installed "The 2016 List of FSX and P3D Controls.pdf" okay Installed "FSUIPC Lua Library.pdf" okay Installed "FSUIPC Lua Plug-Ins.pdf" okay Installed "Lua License.pdf" okay Installed "Lua Plugins for VRInsight Devices.pdf" okay Installed "LuaFileSystem.pdf" okay Installed "Example LUA plugins.zip" okay Installed "ASN WX Radar facilities in FSUIPC4.pdf" okay Installed "Offset Mapping for PMDG 737NGX.pdf" okay Installed "Offset Mapping for PMDG 777X.pdf" okay Installed "Offset Mapping for PMDG 747QOTSII.pdf" okay Installed "FSUIPC4 Offsets Status.pdf" okay Installed "Profiles in Separate Files.pdf" okay Installed "FSUIPC4_Loader.dll" okay =========================================================== All installer tasks completed. Registration dialog exit: selected FSUIPC CHECK Checking FSUIPC registration ... Registration check for FSUIPC4 was successful! (result code 00) *************** End of Install Log *************** FSUIPC Log Modules Folder: ********* FSUIPC4, Version 4.967 (1st June 2017) by Pete Dowson ********* Windows 10 Home 64 Bit reported as Build 10586, Release ID: 1511 (OS 6.0) fsx.exe version = 10.0.61472.0 Reading options from "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\Modules\FSUIPC4.ini" Running inside FSX on Windows Vista Module base=5FFE0000 User Name="" User Addr="" FSUIPC4 Key is provided WIDEFS7 not user registered, or expired 31 System time = 07/06/2017 14:47:07 31 FLT path = "C:\Users\XXX\Documents\Flight Simulator X Files\" 31 ------ Module Version Check ------ 31 acontain.dll: 10.0.61472.0 31 api.dll: 10.0.61472.0 31 controls.dll: 10.0.61472.0 31 fs-traffic.dll: 10.0.61472.0 31 G3D.dll: 10.0.61472.0 31 language.dll: 10.0.61472.0 31 sim1.dll: 10.0.61472.0 31 visualfx.dll: 10.0.61472.0 62 weather.dll: 10.0.61472.0 62 window.dll: 10.0.61472.0 62 ---------------------------------- 125 Trying to connect to SimConnect Acc/SP2 Oct07 ... 187 FS path = "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\" 609 ---------------------- Joystick Device Scan ----------------------- 609 Product= UMDF Virtual hidmini device Product string 609 Manufacturer= UMDF Virtual hidmini device Manufacturer string 609 Serial Number= UMDF Virtual hidmini device Serial Number string 609 Vendor=BEEF, Product=FEED (Version 1.1) 625 -------------------------------------------------------------------
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.