Telemetry SDK example working with OSX El Cap

Post Reply
User avatar
RootlessAgrarian
Posts: 423
Joined: 25 Nov 2015 18:43
Location: Cortes Island BC Canada

Telemetry SDK example working with OSX El Cap

#1 Post by RootlessAgrarian » 22 Sep 2017 17:44

Just wanted to confirm for the record that v1.9 of the telemetry SDK seems to work with El Capitan 10.11.6. I am not sure how stable it is (I had some segv experiences at first) but here's the recipe if you want to try it out.

1) get the sdk zip from http://download.eurotrucksimulator2.com/scs_sdk_1_9.zip (it is not so easy to find just by googling)
2) unpack and simply type 'make' in the example dir of your choice (I chose telemetry_position). result s/b a .so file.
3) locate the directory in which your game executable really lives. I have the Steam version which means that my dir path is lengthy:

Code: Select all

/Users/USERNAME/Library/Application Support/Steam/steamapps/common/Euro Truck Simulator 2/Euro Truck Simulator 2.app/Contents/MacOS/
4) in this directory, create a dir 'plugins' if it does not already exist
5) copy the .so to the plugins dir (modify the makefile to add an install target so you don't have to type that horrible long dir path ever again!)
6) now start the game. you should get a popup dialogue during startup that warns you about invoking advanced SDK features
7) if you look in the game_log and search for ".so" you should see a line confirming loading of your installed plugin
8) the telemetry_position plugin writes a log file with the X;Y;Z game coordinates of the driver's head, on a very frequent basis (per frame I think from reading the doco). the path of this logfile is unspecified in the fopen command in the source, which can make it a challenge to find the output file. I expected it to be in the same ETS2 library dir with the game log file, profiles, mod dir etc. it is not. it is in the same directory where you created the plugins dir, the directory where your game binary lives. if you want to put it somewhere else, like /tmp, just edit this line in the source .cpp:

Code: Select all

log_file = fopen("telemetry_position.log", "wt");
9) this log file will get big fast. an hour of play, in my experience, created a log file over 3MB in size. it is overwritten on each game start.
10) If you want to instrument and debug your plugin-in-progress, the Q&D way is a call to game_log, which is made accessible early in the plugin init function scs_telemetry_init. I have so far identified 2 levels of log message, _warning and _error. Presumably there is a harmless info level but I haven't tried empirically discovering its name yet :-) and have not so far found any programmer's reference that documents basic functions of this kind. game_log will write to the game_log.txt file and to the dev con (when visible), so it's very handy.
11) you can edit and retry your plugin without shutting down the game. the command 'sdk reload' from the dev con should reload all plugins. I believe that 'sdk reinit' will restart the plugin without reloading it, but I haven't verified this yet. reload would be useful (as the readme points out) if you have made your plugin depend on a config file for its initial state.

My impression is that the API is still at a pretty technical level, i.e. no one has yet written a higher-level library to simplify access to the telemetry data. I don't think my C coding skills are quite up to that, but if I do produce anything useful along those lines I'll share. If anyone else is working on telemetry for OSX/linux please keep in touch :-) And if anyone knows how game coords map to reality (i.e. to game km, which I guess map to real-world km by way of local scale) I would really like to know this!

My goal is a generic telemetry data server using UDP datagrams, with keyword based data request; I'd like to end up with a plugin that starts at run time, monitors all the available data, and serves it to any connected client on request. There's a lot of code between me and that goal, and it's going to be hard slogging with my primitive C coding chops -- so if anyone from OSX/Unix land feels like helping I'd be very happy to set up a github project and collaborate, or join in an existing effort.
Level 42 and rising... i7 8700K -- AMD Radeon 5700XT -- ASUS MAXIMUS XI HERO - WIN10
NoCabView minimod
Euro Bike Simulator
The Beginner's Guide To SCS Mapping (WIP)

User avatar
bacon
Posts: 1
Joined: 09 Jan 2021 16:40
Location: UK
Contact:

Re: Telemetry SDK example working with OSX El Cap

#2 Post by bacon » 09 Jan 2021 16:56

Good evening.
Thank you for the guide to getting the samples running, that was a great help.
Today I've been playing with the idea of something that sounds remarkably similar to what you where explaining here.
I code mainly in C#.NET and sometimes in Xamarin so I'm trying to work on an App to allow using a smartphone/tablet as the GPS and/or a map viewer while in-game.
I've got the telemetry samples and also a C++ UDP broadcast library, I now just need to stick the two together and then pick up the broadcast messages on the app.
Did you managed to get anywhere with your original idea or find something that was similar?
Many Thanks
Simon

Post Reply

Return to “Mac OS Beta Testing”

Who is online

Users browsing this forum: No registered users and 1 guest