• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS20 MSFS2020 Cockpit Companion - an http interface for SimConnect

hankhank10

Resource contributor
Messages
12
Country
unitedkingdom
Find it annoying to click around in the cockpit trying to set the autopilot heading when you’re supposed to be flying the plane?

Want to use your laptop or iPad to display secondary instruments so you can soak in all that photo realistic scenery?

Struggling to fly over your house because MSFS2020 doesn’t give you a real time location overlaid on a street map?

Wish you could set your engine on fire / generate an electrical failure / run out of fuel now and then for a challenge?


If you answer yes, then MSFS2020 Cockpit Companion may be for you.

Screenshot 2020-09-09 at 20.36.25.png


MSFS2020 Cockpit Companion (full details at http://msfs2020.cc) is a free, open source application written in python. Once you download it and run, it starts a lightweight web server running locally on your machine which you can then navigate to with your browser (either on the same computer, another computer on your local network or over the web).

It also incorporates a RESTful API which allows you to get individual sim variables or collections of them in JSON format, set variables and trigger sim events.

In terms of the http interface, it displays your location on a moving map with a bunch of different options and overlays:

Aviation_Map.png


It also lets you control secondary instruments such as gear or autopilot by pressing buttons and typing numbers rather than fumbling around in the panel.

Screenshot 2020-09-09 at 20.37.29.png


And, who doesn't love breaking up a long flight over Montana by having the engines set on fire *and* having the electrics fail on you:

Screenshot 2020-09-09 at 12.54.43.png


This is all very much work in progress... (In particular the autopilot settings are a bit finnicky, although I can't tell whether that's because my coding sucks or whether it's because of how broken the autopilot is on this game.)

I should also mention that this is very much a collaboration and that while I've done a lot of work on the front end, the majority of the hard work sits in the Python-SimConnect library produced by someone else.

If you have ways that this can be improved then *please, please* do get involved by forking the code and submitting pull requests.

You can get full details at http://msfs2020.cc/ and the github repo is https://github.com/hankhank10/MSFS2020-cockpit-companion
 
This looks great - I'm currently waiting for a PC to arrive so I can learn to fly and want to 'copilot' with my dad, who's got his PPL. This looks like a great way to fly together.
 
Great addon!!!!
Just a simple question : is there a way to increase the refresh period... currently is set to 2sec but more could be better.
How can I increase the refresh period?

Thanks
Stefano
 
Hi hankhank10

Can this be used with FSX as well or is it only MSFS2020?

Ok in answer to my Q - it cannot as there is code to work only with 64bit MSFS and simconnect.

But there should be a way to get this to work with FSX as the calls,methods, properties etc. are all the same. After all you point to the ESP SDK as the documentation for your code. And you use SIMCONNECT.DLL anyway.
Unfortunately I am not familiar with Python.
Any ideas?
 
Last edited:
Ok managed to get this to work with FSX.

1. Install the 32bit version of Python. I installed it into c:\pythonv39x86. (I already have the 64bit version installed in c:\python39) At the time of install do not check any file associations.
2. Change the environment variables of the path to c:\pythonv39x86 and also c:\pythonv39x86\scripts (mine was pointing to the 64bit version)
3. As per the github page Cockpit Companion install the python dependencies of Simconnect and Flask
Note: After pip has installed python Simconnect navigate to C:\Python39x86\Lib\site-packages\SimConnect and you will find a file there Simconnect.dll which is the 64bit simconnect. Rename it to something else and replace it with the Simconnect.dll found in your FSX SDK - C:\FSX-SE\SDK\Core Utilities Kit\SimConnect SDK\lib\. This 32 bit version is needed here.
4. Extract the github repository into a folder - I used c:\CockpitCompanion
5. Open a command prompt in c:\CockpitCompanion
6. Type "python" (without quotes) to verify you are using the 32bit version of python -
Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:23:07) [MSC v.1927 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

7. Important. Start FSX and start a flight before running the server.
8.Type python glass_server.py to start the server. You will get a window from Windows firewall so click Allow to allow the web server to run.
9.Open your browser to page http://localhost:5000/

Enjoy Cockpit Companion with FSX.
CockpitCompanion.jpg
 
Last edited:
Back
Top