Jump to content
The simFlight Network Forums

Best way to make browser interface with FSUIPC?


Recommended Posts

Paul, this is working great! And so far is faultless when doing everything locally (on my computer). The only issue I have is, accessing this from various devices On my network fails, I think it requires a secure websocket (wss), could this be an option at all?

well I’m assuming it does as I can’t make connections from devices on my network, even using your website. Tested with chrome and safari.

EDIT: Looks like this is a windows firewall issue after all!

Thanks 

Link to post
Share on other sites

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!

Link to post
Share on other sites

Hi Firefly,

Quote

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?

It can't be changed from my code. It's the Windows security that's blocking it.

If you don't want to run as admin you can grant permissions to your user account to use a particular URL. The only way I've found to do this is via the command line: (note you'll need to run the command line as admin, and you need use the http version of the url).

Example for using 192.168.0.1 port 2048

netsh http add urlacl url=http://192.168.0.1:2048/fsuipc/ user=DOMAIN\user

Your user account will be able to use the URL without running as admin. But it will also block you from using all other URLs (including localhost), unless you register them in the same way.

To delete the permissions use:

netsh http delete urlacl url=http://192.168.0.1:2048/fsuipc/

Paul

Link to post
Share on other sites

Hi Paul,

I will take my words back - I think we do need an option for wss after all. If the web page we implement this on is https the browser does not allow using an insecure socket connection. I ran into this issue when trying to inject a little script into the Skyvector map to show aircraft position there... 🙂

Allan

Link to post
Share on other sites

There is now an installer ready that includes the WebSocket server + integration into FSUIPC7 (via an Add-ons menu entry). You can download from here:

 
There is an issue if the WebServer is already running when FSUIPC7 is started as it currently doesn't check for this. I may add this at a later date.
Also, there is currently no indication if the WebSocket server is running or not (apart from entries in the log). I think I'll update the FSUIPC7 title bar to include this information at some point. 
 
Let me know if you have any issues or suggestions.
 
John
Link to post
Share on other sites

Hi everyone,

I've just released version 0.2.0 of the server.

Changes and additions are as follows:

  • Added option to use SSL (wss://). Requires you have an SSL certificate from a trusted issuing authority installed, and bound to the port you are using
  • Default address for new installations is now 'localhost' rather than 127.0.0.1
  • Website now supports the browser's back and forward buttons
  • Browser bookmarks will now deep-link to the selected page
  • Added payload commands to more easily read and write payload station and fuel tank data.

Paul

Link to post
Share on other sites
2 minutes ago, Paul Henty said:

I've just released version 0.2.0 of the server.

Ok, thanks Paul. I'll update the installer for this version for the next release. I would appreciate some feedback on the current release though first, in case I need to make some other updates. Thanks,

John

Link to post
Share on other sites

Hi John,

I don't have MSFS so I assumed I couldn't install/start FSUIPC7, but I just found that I can.

I tested with version V0.2.0 (0.1.0 threw an error on shutdown). All looks good including starting, shutting down, autostart.

Thanks,

Paul

 

Link to post
Share on other sites
6 minutes ago, Paul Henty said:

I don't have MSFS so I assumed I couldn't install/start FSUIPC7, but I just found that I can.

Yes, with FSUIPC7 now being a stand-alone exe rather than a dll, you don't need to have MSFS installed to install or run FSUIPC7. But of course, doesn't normally make much sense doing this!

7 minutes ago, Paul Henty said:

I tested with version V0.2.0 (0.1.0 threw an error on shutdown). All looks good including starting, shutting down, autostart.

Ok, thanks, I'll update the installer to include V0.2.0 and release sometime next week...once I've updated the FSUIPC7 user manual.

I'll also update the FSUIPC6 installer to include this, although I'm not sure yet if I'll add the start/stop/etc integration. I may do that at a later stage, via menu items in the P3D Add-on drop down menu entry, but that will depend if needed (i.e. requested). 

Regards,

John

  • Like 1
Link to post
Share on other sites
  • 2 months later...

Hi Paul, first of all... thanks for jumping onto the Websocket-Train. 🙂

I tried to approach something similar with https://gitlab.com/joeherwig/portable-sim-panels-fsuipc-server which is used for https://github.com/joeherwig/portable-sim-panels
But It seems, i should investigate into the new Websocket-Server you provided.

What is essential is that only updated data is sent to the subscribers, as registering on events of course is a performance-bottleneck if you're receiving information which you don't need, as they did not change.
May i suppose, that this feature is already there?

And one more suggestion...
If we anyway have a "list" of FSUIPC offsets, there types and calculations... Wouldn't it be a good idea, to provide that already in the right format (JSON array), so that users can just import that without the need of fiddling around with the right types and conversions.

I'm sure based on the documentation Pete and John are doing anyway, it is also possible to render it into JSON right?

Thanks a lot!

        Joe


 

Link to post
Share on other sites

Hi Joe,

Quote

What is essential is that only updated data is sent to the subscribers, as registering on events of course is a performance-bottleneck if you're receiving information which you don't need, as they did not change.
May i suppose, that this feature is already there?

Yes. Offsets can be registered in groups. An update for the group is only sent to the client when there are changes to any of the offsets in that group. Additionally there is an option per group to only include data from offsets that have changed since the last update was sent. 

This give two methods of consuming data, one suitable for real time displays and another for event driven applications like flight logs.

Quote

Wouldn't it be a good idea, to provide that already in the right format (JSON array), so that users can just import that without the need of fiddling around with the right types and conversions.

The types are handled (as in string, int, float etc). The unit conversions are not. That still needs to be done by the client (except for Lon and Lat which are done for you).

While it's possible to add unit conversion on the server side, it's a lot of manual work given the number of offsets. In the PDF offset lists the formulas are embedded in blocks of text and are not in a standard format so it makes it difficult to pull them out programmatically.

There will be helper modules added in the future (like in my .NET DLL for FSUIPC) that will make it easier to deal with certain data. The only one I've added at the moment is Payload and Fuel services. This allows reading and writing of the payload and fuel levels directly in common units (lbs/litres/gallons/kg etc). 

Paul

 

Link to post
Share on other sites
  • 4 months later...

Hi Paul Henty and John Dowson

That are fantastic news since I have begin planning my annunciator implementation of my own design cockpit of the 737.

I have bought Prosim 737 and I am needing somwhere to read and see which annnuciatorn wich is active .... . My idea now is having a simple monitor running a Desktop app connected to a node server which will listen for offsett from FSUIPC Webbsocket?

If I am not all wrong I think the webbsocket is implemented in FSUIPC7 for FS2020 🙂

Best regards Fredrik Hjärpe

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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