Jump to content
The simFlight Network Forums

Firefly

Members
  • Posts

    25
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Firefly

  1. On 9/22/2021 at 12:31 PM, John Dowson said:

    The problem is with the G1000.hvar file. You need to add a 'H:' before each hvar name. I will correct this in the next WASM release so this is optional (and the provided hvar files will work as is), but for the time being make sure that each hvar name in your .hvar files are preceded with  'H:'.

    Finally had time to continue with this. Adding the "H:" did seem to fix it.

  2. 52 minutes ago, John Dowson said:

    Did you rename the hvar file so that it is loaded with the aircraft you are using? To check, can you see the hvar in the Add-ons->WASM->Activate Hvar... menu item, and if so does it work there? If not, please let me know the aircraft you are using + any mods and I will check here.

    I didn't rename the file (it's still called G1000.hvar) but it shows up in the Activate HVAR window so I'm presume it's loaded. But nothing happens when I press Activate. (Only using stock C172 with WT G1000 mod)

  3. 7 hours ago, John Dowson said:

    You can use the MF WASM if you want to use those events, but the events are translated by the MF WASM and to calculator code which can simply activate lvars/hvars/etc, although some of the code is more complex. You can see what calculator code each MF event uses using the preset app list here: https://hubhop.mobiflight.com/#/list

    Oh, that's a godsent link right there! Using the calculator codes I find there it works beautifully. I just wonder why calculator code "(>H:AS1000_PFD_SOFTKEYS_4)" works but the Hvar "AS1000_PFD_SOFTKEYS_4" doesn't - isn't that what the CalcCode is doing? (yes, I did copy the .hvar file to the modules folder in fsuipc-lvar-module). I don't really need to know why though, since I have a working solution, I just wondered...

    And this means I don't need to install the MF WASM - how nice.

     

    7 hours ago, John Dowson said:

    Check what the MF presets use.  Did you try with the G1000.hvar file (included in the HvarFiles subfolder)? This was created quite a while ago now and may be out of date, I'll review those hvar files when I get a chance. The hvars may also be different if using a mod for the G1000 (e.g. the WorkingTitle G1000 mod). What aircraft and/or mod are you using?
     

    I'm using stock C172 and is indeed using the WorkingTitle G1000 mod. Tried googling hvars for that but didn't really find anything... But it seems to work with the code from hubhop.

  4. 8 hours ago, Paul Henty said:

    I've found that bug. Please try 0.3.1 - you shouldn't get that particular crash any more.

    Great - now the MSFS Variable Service connected correctly to the sim and I was able to successfully use both the L and Hvars in the A320 as you have in your documentation example. It's just awesome to have this working so smoothly and responsive - looking so much forward to further reduce the use of that pesky mouse! So far so good.

    Now I also got some of the G1000 buttons to work, eg. MFD range inc/dec, but most other Hvars don't work (none on the PFD). They don't work when I trigger them from FSUIPC either, so it's not an issue of the websocket server though...

    • Like 1
  5. 12 hours ago, John Dowson said:

    The MF WASM module will not give you access to more variables. It will provide additional 'controls/events' (or what MF now call 'presets') that act upon existing variables (A, K, H, L).

    Okay, maybe I misunderstood what I was reading then, eg. here:

     

    So now I'm all confused... Don't I need to install the MF WASM module to control the G1000 if I already have the FSUIPC WASM module installed? And for eg. the softkeys, isn't it the Hvars (or Lvars?!) I need to use to activate those?

  6. On 9/12/2021 at 12:51 AM, Paul Henty said:

    Version 0.3.0 is now available on the website.

    I was playing around with it and believe I was successfully sending Hvars to the sim although I probably didn't use the right ones yet. The websocket response to the vars.write command was success=true at least.

    But now I ran into some issue. I read about the MobiFlight WASM module and that it made more variables available (eg. for the G1000), so I installed that into the Community folder and when I then started MSFS and was trying to use the websocket server I got the error that it couldn't start the Variables service (see the first screenshot). Since I also had the FSUIPC WASM installed I was thinking that maybe I could not have both WASM modules installed at the same time, so I removed the MobiFlight one again, restarted MSFS and tried again. But I still get the same error (see second screenshot) - and if I click the Start button I get the unhandled exception which I also copied in below. (also tried restarting the computer entirely)

    Since I got success=true in the beginning I believe everything was connecting ok under the MSFS Variables tab - but since I don't specifically recall what it said there I can't for sure say whether this problem was there before I tried the MobiFlight WASM module... Any ideas?

     

    System.InvalidOperationException: Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
       at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
       at System.Windows.Forms.Control.Invoke(Delegate method, Object[] args)
       at FSUIPCWebSocketServer.GUI.ctlVariableServiceStatus.vs_LogEntryReceived(Object sender, LogEventArgs e)
       at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
       at FSUIPCWebSocketServer.VariableServices.VS_OnLogEntryReceived(Object sender, LogEventArgs e)
       at FSUIPC.WAPI.fsuipcw_start()
       at FSUIPCWebSocketServer.VariableServices.Start()
       at FSUIPCWebSocketServer.GUI.ctlVariableServiceStatus.btnStartStop_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

     

    fsuipcwebsocket server error1.png

    fsuipcwebsocket server error2.png

  7. 10 hours ago, Paul Henty said:

    My FSUIPCClient DLL (used by the socket server) now has support for accessing LVars/HVars directly from the WASM module. It seems to be stable now so next week I will expose this via the Socket Server.

    This will mean you won't need to assign LVars to offsets anymore. You'll have direct access to them with something like "lvar.request". You'll also be able to set HVars and execute calculator code.

    This will only be for MSFS/FSUIPC7.

     

    Oh Paul, that sounds awesome - not even having to assign them in FSUIPC first. You're an angel! 🙂 I will be waiting as patiently as I can 🙇‍♂️

  8. Hi Paul

    So above you mentioned how to send controls and also deal with L:Vars. So now the inevitable question comes - how can I activate H:Vars? They are not assigned to an offset. I don't see much in the manual for advanced users on how to use the H:Vars...

    I don't yet have a use for it yet but just wondering about even executing Calculator Code in the WASM module?! Is that something that could be dealt with if needed?

    -Allan

  9. wss shouldn't be necessary - and doing the encryption will just take extra resources. Would only be for security purposes but there isn't much point when you are just on a home LAN. 

    If it only listens on 127.0.0.1 it will only work locally, but if you select to listen on the LAN IP it works from other computers. The only problem I had was that I had to run the program as Administrator in order to be allowed to listen on the LAN IP. Can that changed?

    Normally you can also set a program to listen on 0.0.0.0 which means any IP can connect to it...

    Otherwise I'm looking forward to test this out more as soon as I get a chance!

  10. I have reviewed the code now - it looks terrific! Good to see you have the "name" ID in there so that we can match the response in case we need to use it a-la-HTTP. Will it only send a message with offset values if there is a change in at least one of them, or what do you think about that? Could save a lot of network traffic for values that rarely change... eg. if you wanted to monitor taxi lights for example...

    Will you be able to subscribe to multiple offsets.read requests with different intervals or only one? Just curious as I'm not sure if that would be needed... I guess the same reasoning goes for whether or not one can stop receiving messages for something you have previously subscribed to...

  11. Hi Paul,

    You're fast! This is great - it's exactly what I had in mind for HTTP communication. It can certainly work in a lot of scenarios - I'm just thinking that in case you for example wanted to do a gauge you would want very frequent updates, at least every 50-100 ms, and in that case there would be quite a bit of overhead in constantly opening/closing the HTTP connection and passing headers. At least theoretically that would be a concern... so that's why I was thinking of websockets. I was imagining that you could subscribe to a set of offsets which would then continually be sent back to the client at a given interval (maybe even user desired interval?). Either all the subscribed offsets could be returned, or even better, only those that have changed since last time.

    I understand that FSUIPC in itself is stateless - poll and response - so this would of course require a running websocket server with some logic in it. But due to the overhead of HTTP I believe it would perform substantially better to have that websocket server continually poll FSUIPC internally than doing the polling over the HTTP protocol? Or is there something I'm missing?

    Thanks,

    Allan

  12. What is the best way to make a browser web page interface with FSUIPC? So that we can easily design our own panels with buttons and information from the aircraft/simulator using HTML/CSS/Javascript? How could that be done?

    It seems like it should utilize websockets since that provides two-way instant communication and the WebSocket API is supported by any modern browser. But FSUIPC doesn't have a websocket server in-built I presume... Plain requests via the HTTP protocol could be an alternative but would only be optimal for button presses...

    I'm aware of WideFS button capabilities - it would be some similar to that but just done in the browser instead so that it will have many more options for layout and information. Seems with today's browsers it should be doable performance-wise and therefore an obvious feature to have.

  13. On 8/25/2020 at 4:46 PM, John Dowson said:

    You can use Lua as plugins to FSUIPC7, but not  for stand-alone applications.

    I thought FSUIPC7 was currently only this beta stand-alone application, so I don't quite understand what you mean by that? Can I use Lua as it is now or not?

  14. No. What would you use it for? You'd need to be able to move the mouse pointer to the correct place for a click to be of any use in any case, and where, exactly is "the right place" going to be?

    Well, of course you would have to define the x,y coordinates in pixels for where the mouse click should happen, but that's not a problem. I have the Wilco Airbus and there are some functions I can't do any other way than using a mouse click. And if I use the same view all the time (I use Ezdok) the location of the buttons will always be the same, so it will work just fine even though its not the most desirable solution. Right now I'm using HIDmacros which can send mouse clicks but it's annoying to have FCU functions on a keyboard when I have the MCP Combo buttons that are meant for doing those functions...!

    There is a program called "Key2Mouse" which allows you to assign mouse moves and clicks to keypresses. But really, these days, this sort of thing is not often a lot of use.

    Well I can't use it with the MCP Combo. Also, it costs money - and quite a lot compared to what it does! The developer for the Wilco Airbus do sell an extension that gives me FSUIPC offsets - but it's RIDICULOUSLY expensive! (cost more than the full PMDG 737 NGX!!)

    What about normal FS controls or assigned keypresses in the add-on?

    FS controls are n/a. Mouse macros don't work. No Lvars are available. Assigned keypresses do exist but only to a key press. And the key press doesn't work for the MCP Combo with LINDA.

    I could consider adding a mouse manipulation library to the Lua support but I would like good reasons and practical applications to make it worthwhile, and it is not easy to think of many.

    Hmmm, to me it seems like a logical fallback option when everything else fails... Also with vasfmc some of the mouse macros don't work and I have no other option than to find the mouse, move it to the exact location, and then click. In a busy cockpit I'm sure you know how annoying that is! :)

    Regards,

    Allan

  15. Hi Pete,

    Is there an API available in the Lua that comes with FSUIPC for simulating a normal left and right mouse click?

    I can't find anything in the documentation, but wonder if a "simple" thing like this really isn't possible...

    My goal is to be able to assign mouse clicks to buttons on my VRInsight MCP-Combo through LINDA.

    (Mouse macros, Lvars etc doesn't work for the functions I need)

    Allan

  16. Pete, (I hope you see this :) )

    I have a question along the lines of information from HIDMacros to FSUIPC/Lua.

    From a script in hidmacros I'm running a Lua script through FSUIPC by calling this (thanks to Petr recently adding the SetFSUIPCString call):

    HIDMacros.SetFSUIPCString &HD70, 40, "Lua testlua"
    

    But at the same time I want to pass a parameter (a string) to that program. I tried the parameter offset like this (before the above line):

    HIDMacros.SetFSUIPCString &HD6C, 4, "mystring"      (not sure if SetFSUIPCString is correct and if I can max write 4 chars/bytes!)
    

    But when I access the ipcPARAM variable within the Lua script it always translates to some number which I can't use for anything. Any idea how to solve this, or any other idea how to pass a string to a Lua program? I could maybe write it to a file from within hidmacros and then read that file from Lua but I would guess that would be inefficient?!!

    -Allan

×
×
  • 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.