Discussion Elite Dangerous Companion Emulator (EDCE)

*This was published early 2015 before the API was officially allowed*

Elite Dangerous Companion Emulator (EDCE)

Everything mentioned in this post is a Good Thing™, and I encourage you to read it fully before voicing an opinion.

TL;DR
EDCE is a python script that securely retrieves your commander data from Frontier exactly like your iPhone would if you were using the Elite Dangerous Companion mobile app. It can also optionally post market data from where your commander is docked to EDDN.

Latest release
GitHub
EDCodex

Foreword (2016)
EDCE was meant as a proof-of-concept for other developers to learn how to use the Companion API, and to show FD how incredibly positive third-party apps can be when using the Companion API. As such this is why it’s not fully fleshed out comparatively to the other great tools out there.

With that in mind anyone else that wishes to become a collaborator to continue tweaking it, or turn it into a proper library for others to use, please do not hesitate to contact me.


*Begin historical documents*

Why?
Community developers have wanted access to game data since the earliest Alpha and Beta releases in order to produce cool tools that enhance the gaming experience for many commanders.

Initially, data was mined directly from the client, and this caused difficulties for Frontier: not only were there exploits, but it caused stability issues with the clients that strained their support capabilities. Frontier then obfuscated the client executable code and indicated to community developers that direct access to game data from the client would no longer be supported.

The first requests for an API (Application Programming Interface) where then made to Frontier for allowing game information to be extracted and processed by third-party tools. Frontier responded that it was an interesting idea, and that they would consider it in the future due to their limited resources.

Community developers have nevertheless continued to develop many incredible tools, using very difficult and unreliable techniques such as OCR (Optical Character Recognition) to access game information, to the great appreciation of commanders.

A thread was started by Frontier in January to collect ideas for an external API, which ran for 32 pages. However, to date, there are no definite plans by Frontier to develop this API in the near future. It is understood that their limited resources are fully dedicated to continue making a great game.

In the meantime Frontier released the Elite Dangerous Companion app for iPhones. This app uses SSL (Secure Sockets Layer) to retrieve commander data from a Frontier website using a Web-based API. All you need is the app and your Frontier store credentials, and you have access to your commander data.

Other developers and myself have contacted Frontier to see if they would allow community developers to use the Web API to extract game data for tool development. The response was that they do not have the resources to provide support for this approach, and that they would rather look at a real API when they will be able to.

Hence, in good faith, I am releasing the approach to access the Web API, with the undestanding that Frontier will not provide support for it. Hopefully, Frontier will tolerate its use by developers and commanders as long as it does not induce any extra effort on their part, affect the operation of their servers, and does not otherwise compromise their game.

What is in the data?
The same data as in the app. Commanders using this script do not have any more of an "advantage" over others than those using the Companion app. It just allows to access the data in a way to allow it to be stored and manipulated (e.g. commander's log for systems visited, etc.)

The data has a wealth of information about your commander that you can explore by viewing the logged data, namely:

  • Location
  • Ranks
  • Reputations
  • Credits
  • Systems visited
  • Full game stats (trade, combat, exploration, ...)
  • Current ship and loadout
  • Other ships and their locations
  • Last system visited and faction
  • Last station at which docked and faction
  • Last station market data and outfitting item availability
  • ..and more

Prerequisites
  • Runs on Windows, Linux and Mac OSX
  • Python 3.3+
  • You may need to install some modules if the script complains. Example, if "requests" is missing, run "pip3 install requests"
  • If you wish to obtain the source code, use git and use the command "git clone https://github.com/Andargor/edce-client.git"

Obtaining
Latest release

EDCE is open source and available on Github.

Installation
  • Unzip in any directory
  • Requirements:
  • - Python 3.3 or higher
  • - Python requests library: pip3 install requests
  • Run client-setup.py (use python3 client-setup.py on Linux and Mac)
  • Enter your Frontier store credentials (NOTE: The password is stored unencrypted in the edce.ini file. You can leave the password blank, however this means you will need to run the client in interactive mode and you will be prompted to enter the password every time)

Usage
EDCE is a really basic script that fetches your data, and optionally posts to EDDN. It needs to be manually executed every time you wish to fetch data.

There is a lot of information in the data, and community developers are free to write more sophisticated clients that uses this code. For example, if someone can figure out a way to determine when a commander is docked, then this can be automatically run at that time.

  • Run edce_client.py (use python3 edce_client on Linux and Mac)
  • The first time it is run, a verification code will be sent by Frontier to your account email. Enter it when prompted
  • If you have left either your Frontier store username or password empty, you will be prompted to enter it
  • The script will fetch your commander data, dump it to "last.json", and store it compressed in the "logs" directory. The data is in JSON format, which is machine-readable and marginally human readable. It is compressed (7-zip can read it)
  • Optionally, if you have enabled it, and if your commander is docked, it will post the current station market data to EDDN. No private information is sent.
  • You need to run the program manually every time you wish to fetch data (and post to EDDN)

Security
  • Protect your edce.ini file as it contains your Frontier store credentials in unencrypted form if you have not left them blank during setup
  • Your store credentials are transmitted in the same way the iPhone app does, using secure requests directly to Frontier, without any intermediaries. This communication is not logged.
  • This script has been developed as open source so that you may verify how your store credentials are handled

Other Notes
  • Avoid querying the Elite Dangerous Companion site too often in order to avoid overloading it. As a rule, try not to query more than once every 2-3 minutes.
  • By default, there is a 120 second delay imposed between queries.
  • The web API sometimes lags actual game state by several seconds. For example, you might dock, but only be able to post market data to EDDN after a few seconds until the web API catches up.
  • You can modify the code as you wish, the edce subdirectory contains the core module to access the Elite Dangerous Companion web API
 
Last edited:
Waaaait.... "
  • Last station market data and outfitting item availability"
Does that mean they provide all the data from the market you docked at?
 
Like I mentioned, what you and others did with OCR is nothing short of miraculous. You should be proud :)
Oh I am. But I'm also thankful I don't need to work on it too much longer. And I will be happier to work on a project based on your code an the "API".
 
EDITED

This is an error on my system and not related to your scripts, but any ideas as to why I'm seeing this :

C:\Temp\edce-client-1.0>client-setup.py
Job information querying failed

python 3.4.2, requests 2.5.1, windows 10 build 10074 64bit (64bit python)

I also see it trying to run Trade Dangerous :( Google foo gives me nothing useful.
 
Last edited:
EDITED

This is an error on my system and not related to your scripts, but any ideas as to why I'm seeing this :

C:\Temp\edce-client-1.0>client-setup.py
Job information querying failed

python 3.4.2, requests 2.5.1, windows 10 build 10074 64bit (64bit python)

I also see it trying to run Trade Dangerous :( Google foo gives me nothing useful.

I've... actually never seen that message. But I don't have Windows 10, might it be related to that?

EDIT: did you unzip somewhere, or are you trying to run from the archive?
 
Last edited:
i've been using win 10 for a while now with no issues regarding python, and yes have unzipped the archive and running from folder. Uninstalling python for clean install of 3.4.3 to see if that cures it.
 
i've been using win 10 for a while now with no issues regarding python, and yes have unzipped the archive and running from folder. Uninstalling python for clean install of 3.4.3 to see if that cures it.

I've reinstalled python 3.4.3 to see if I had something different, and I had to pip3 install requests, but other than that it seems to work fine. Stumped... :(
 
That didn't work, but calling 'python client-setup' did... odd as my path is still intact and worked fine up until today's windows update. Maybe a bug with current windows build.
 
Great work. This is much easier to use than other methods and a boon to the community. Now we just need more people to get out there and update stations...
 
Glad you like it, even though it is very basic. Can't wait to see what the other community developers will do with it. :)

I've made a few minor changes and released 1.0.1. There's a player_dump.py utility now that will give you your basic commander info, where your ships are and last visited locations, as a demonstration. This utility reads the last.json file, and doesn't query directly, which shows that you can process it offline.
 
There was an app that emulated the iPhone interface and FDev asked that it be stopped while they worked on an actual API, hence why we went with OCR.
 
There was an app that emulated the iPhone interface and FDev asked that it be stopped while they worked on an actual API, hence why we went with OCR.

If they have thus postponed it (an actual API) due to lack of staffing or resources, then this should be ok because none is coming soon. If one is actually in the works, there's no reason why one shouldn't have the ability to do it earlier, whether by OCR or whatever tool. Do you have the source for them asking for it to be stopped? (I'd like to see the context)
 

wolverine2710

Tutorial & Guide Writer
Because of my "third party tools thread" commanders seem to find me. I've already been contacted by a commander who is using the EDCE data and displays the results. A picture indeed says more then thousand words. Mindblowing. Perhaps the tool will finds it way to the public soon.

Andargor: I appreciate the time so put into the tool. It could change third party tools landscape as we know it. I very much like the way you try to minimize the effect of the usage of the iOS API - hardcoded time limits, not running it constantly (till we have a way to dectecting docking in a 100% (as in 1000%) reliable way). I'm confident other commanders using EDCE will do the same. Remember: With great power comes great responsibility. Hence use the tool wisely as in minimize the usage of it - as it queries the FD servers.

I DO hope that although unsupported by FD they are going to tolerate it. At least till the full fledged ED API is released.
BUT for that all commanders using EDCE must minimize its usage. So the load on the FD servers is minimal. This includes authors using EDCE as a base for their tools. Do NOT run EDCE every time you want to parse the .json file for testing. Just run EDCE once and then operate on the .JSON file to see how it displays in your tools.

Note: A lot of tools like the BPC and other trading tools which rely on manual input data have an option to import data in the form of a .csv file. This is either a file in the format of an EliteOCR format .csv file or in the case of the BPC a .BPC file (which basically is a slightly tweaked/enhanced EOCR .csv file). I'm hoping a tool using EDCE will create such a file. It would mean a lot of new and good data for trading tools.

@Andargor: Perhaps something to consider by you or other commanders. In case of Trade Dangerous. Its using a .prices file. If a tool using EDCE would edit its .prices file (for the station currently docked at) it would mean a lot of more good data for TD.
 
Last edited:
Very nice tool, I was waiting for something like that.

There are some differences to the displayed names:
Type JSON <-> DISPLAY
Category "Narcotics" <-> "Legal Drugs"
Item "Marine Supplies" <-> "Marine Equipment"
Item "Auto Fabricators" <-> "Auto-Fabricators"
Item "Hazardous Environment Suits" <-> "H.E. Suits"
Item "Atmospheric Extractors" <-> "Atmospheric Processors"
Item "Non Lethal Weapons" <-> "Non-Lethal Weapons"

And that's just from the station I'm at currently.
 
Last edited:

wolverine2710

Tutorial & Guide Writer
Very nice tool, I was waiting for something like that.

There are some differences to the displayed names:
Type JSON <-> DISPLAY
Category "Narcotics" <-> "Legal Drugs"
Item "Marine Supplies" <-> "Marine Equipment"
Item "Auto Fabricators" <-> "Auto-Fabricators"
Item "Hazardous Environment Suits" <-> "H.E. Suits"
Item "Atmospheric Extractors" <-> "Atmospheric Processors"
Item "Non Lethal Weapons" <-> "Non-Lethal Weapons"

And that's just from the station I'm at currently.

I believe that is what is being received from the FD servers. With release or 1..x.x FD changed the names. Can anyone check if its also displayed incorrectly in the iPhone app. Most likely its incorrect there also.

Regardless of this, irrc FD uses id's for the commodities and cateogories. This makes localization a snap. It also means that in EDCE using a simple mapping the names can be changed - when dumped to the JSON and when uploaded to EDDN (when enabled by the user).

This is the first iteration of EDCE so these kind of things can crop up. Hence your testing is very very useful. As is the testing by others. Let the little devil know what is not 100% correct so he can fix it ;-)
 
Last edited:
Top Bottom