Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: CREST - a.k.a. Cars REST API

  1. #1
    WMD Member Lars Rosenquist's Avatar
    Join Date
    Oct 2011
    Location
    The Netherlands
    Posts
    301
    Platform
    PC

    CREST - a.k.a. Cars REST API

    Introducing CREST - also known as the CARS REST API

    Project type: Data server/API.

    Project status: 1.0.2 has been released.

    Project web site: http://www.cars-rest-api.com

    Public repository: https://github.com/NLxAROSA/CREST

    Description:

    This project provides a way for developers to have access to the data provided by pCars Shared Memory in a more portable and accessible format than a mapped memory file. It's a windows native command line application (written in C++ and a fair bit of plain old C) that will act as a local web/application server and serve the data via JSON over HTTP by accessing a URL. Any web browser or HTTP client will be able to access the data both locally and inside the local network, which facilitates easy add-on development in any language (e.g. JavaScript, Java, C, C++, C#, etc. etc.) and platform (e.g. web browser, iOS, Android, Windows Phone or other) with a vast array of client REST libraries at your disposal.

    I started this mainly for myself to play around with the pCars Shared Memory SDK/API and to brush up on the good 'ol C/C++ skills, but decided to make it available to the general public for free. Since I'm using a couple of libraries that are licensed with the GNU GPL license.

    Screenshots:

    Click image for larger version. 

Name:	crest-pcars-race-start.jpg 
Views:	11 
Size:	245.4 KB 
ID:	207102

    Sample JSON

    Click here.

    Current build:

    Download link available at this location.

    Installation instructions

    1. Download the source code from the Github repository and build/run it in Visual Studio (check the README for instructions).

    - OR -

    1. Download the application from the download link at this location.
    2. Start the application by double-clicking it.
    3. Windows will complain about security (coming from an unknown/unverified source) both when downloading and starting the application. Please allow/unblock the application in order to allow it to start. Windows Firewall will also ask for permission to access the local network. Please allow it access for proper functioning.
    4. If Windows complains about missing DLLs (e.g. MSVCR120.DLL or similar), please download and install the Visual C++ Redistributable Packages for Visual Studio 2013 from http://www.microsoft.com/en-us/downl....aspx?id=40784 (vcredist_x86.exe), then start again.
    5. Console will show a notification about the server being up and running and display port and URL information.

    Connecting to Project CARS

    1. Start Project CARS.
    2. Enable Shared Memory in Options -> Visual -> Hardware
    3. Open up a browser (Chrome works best) and go to http://localhost:8080/crest/v1/api
    4. Profit! F5/Refresh until you drop!

    Known issues:

    Issues are listed in GitHub: https://github.com/NLxAROSA/CREST/issues.
    Feel free to add bugs you may find, or feature requests, etc.
    PC: i7-4790k/16GB/GTX970 4GB/Z97-PRO/Logitech G27/Xbox 360 Controller
    Laptop: i7-6700HQ/16GB/GTX1070 8GB/Xbox One Controller
    LT Profiler: Strength: 100% - Spring 0% - Damper 0% - Center Spring 0% - 900 degrees - game can change
    The following 8 users likes this Post: Diluvian, eckhchri, ermo, Gassolini, Joeri Blootacker, Raymond de Vries, Rober, STINGER_LP


  2. #2
    Kart Driver
    Join Date
    Nov 2015
    Posts
    7
    Platform
    PC

    Wrong speed value in CRest

    Hi

    I discovered that the Speed value in CREST (V.1.0.2) is wrong. When I drive with 100km/h the value "mSpeed" is 23 or little bit higher. I run the
    standard json-request from the example. No own code!

    As first I thinked that I have to convert from miles to kilometer, but that is not the solution.

    Has anybody make the same discovery?

  3. #3
    Kart Driver
    Join Date
    Nov 2015
    Posts
    7
    Platform
    PC
    OK, the Problem is solved. The value mSpeed is "Meter per Second"!

    Sorry for the confusion!

  4. #4
    WMD Member Lars Rosenquist's Avatar
    Join Date
    Oct 2011
    Location
    The Netherlands
    Posts
    301
    Platform
    PC
    No worries, it can get confusing sometimes, and bugs do happen, so always report if you think something is out of the ordinary.
    PC: i7-4790k/16GB/GTX970 4GB/Z97-PRO/Logitech G27/Xbox 360 Controller
    Laptop: i7-6700HQ/16GB/GTX1070 8GB/Xbox One Controller
    LT Profiler: Strength: 100% - Spring 0% - Damper 0% - Center Spring 0% - 900 degrees - game can change

  5. #5
    Superkart Pilot
    Join Date
    Sep 2012
    Location
    Uldum, Denmark
    Posts
    197
    Platform
    XBOX1
    Hi Lars, is this API working for console network data also?

  6. #6
    WMD Member TonyR's Avatar
    Join Date
    Oct 2011
    Posts
    288
    Platform
    PC
    Thank you very much for creating this. It is a great help to add streaming tools via a website, wonderful!

  7. #7
    WMD Member TonyR's Avatar
    Join Date
    Oct 2011
    Posts
    288
    Platform
    PC
    One thing though, it seems that Unicode characters like German umlauts are not available. Is that due to the Shared Mem or the Crest App?

  8. #8
    WMD Member Lars Rosenquist's Avatar
    Join Date
    Oct 2011
    Location
    The Netherlands
    Posts
    301
    Platform
    PC
    Looking into this right now, not sure where the problem is just yet, but if it's on my end I'll fix it.
    PC: i7-4790k/16GB/GTX970 4GB/Z97-PRO/Logitech G27/Xbox 360 Controller
    Laptop: i7-6700HQ/16GB/GTX1070 8GB/Xbox One Controller
    LT Profiler: Strength: 100% - Spring 0% - Damper 0% - Center Spring 0% - 900 degrees - game can change
    The following user likes this Post: TonyR


  9. #9
    WMD Member TonyR's Avatar
    Join Date
    Oct 2011
    Posts
    288
    Platform
    PC
    Quote Originally Posted by Lars Rosenquist View Post
    Looking into this right now, not sure where the problem is just yet, but if it's on my end I'll fix it.
    It's really strange Lars. When I'm showing the REST Url http://localhost:8080/crest/v1/api?participants=true in my browser all participant names are correct (Unicode characters correctly displayed).

    So I now assume the problem is on my side :/ But I'm receiving the REST data with "$.getJSON('http://localhost:8080/crest/v1/api?participants=true', ....." (and displaying this raw data with Chrome console.log already shows wrongly displayed characters)
    Not sure what can be wrong with that.

  10. #10
    WMD Member Lars Rosenquist's Avatar
    Join Date
    Oct 2011
    Location
    The Netherlands
    Posts
    301
    Platform
    PC
    Sounds like a classical encoding issue to me. So what happens is that CREST returns the output (but it doesn't specifiy which encoding on the Content-Type header) and when rendered in your browser, Chrome correctly guesses (or defaults to) the correct encoding and displays it properly. The same probably does not apply to the console (or your) app, which probably defaults to the default system encoding (probably latin if it's Windows) instead of UTF-8. What I can do on my end is add the specific charset (UTF-8) to the Content-Type header. That should prevent any guessing about the charset on the client end. Quick fix on my end, so if I'm not interrupted I can have that out by tonight.
    PC: i7-4790k/16GB/GTX970 4GB/Z97-PRO/Logitech G27/Xbox 360 Controller
    Laptop: i7-6700HQ/16GB/GTX1070 8GB/Xbox One Controller
    LT Profiler: Strength: 100% - Spring 0% - Damper 0% - Center Spring 0% - 900 degrees - game can change
    The following user likes this Post: TonyR


Similar Threads

  1. [Bug] T300 going crazy after PS4 Rest mode
    By dwalldorf in forum PS4 - Technical Help & Support
    Replies: 3
    Last Post: 02-06-2015, 03:45
  2. PS4 No online after REST MODE
    By KartKingCorre in forum PS4 - Technical Help & Support
    Replies: 7
    Last Post: 01-06-2015, 16:47
  3. Project Cars - Singapore and the rest of ASIA
    By NetBladeZ in forum Multiplayer
    Replies: 2
    Last Post: 23-05-2015, 05:14
  4. T300RS messed up after rest mode
    By TheStigsCanadianCousin in forum Project CARS on Playstation 4
    Replies: 15
    Last Post: 22-05-2015, 23:36
  5. PS4 - One track, one car available. All the rest is locked?
    By PSK-023 in forum PC - Technical Help & Support
    Replies: 1
    Last Post: 08-05-2015, 10:52

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •