RenCloud / scs-sdk-plugin

ETS2 (Euro Truck Simulator 2) & ATS (American Truck Simulator) SDK plug-in. Telemetry data is shared via SharedMemory/Memory Mapped Files.
MIT License
201 stars 40 forks source link

Daily mileage and other parameters ? #99

Closed NazarDiadiun closed 2 years ago

NazarDiadiun commented 2 years ago

Hello to all!

Is it possible to get a daily mileage, or is it only possible if SCS releases such a possibility in their SDK? The same question, for example, to the ambient temperature.

I connect the dashboard from DAF XF, I would like to fully implement the functionality :)

ndelta0 commented 2 years ago

To be honest, this seems to be outside of the scope of the plugin. Its job is only to relay the data from the game to the other applications. It already relays all of the available data, so if it's not there, it's not readable by the plugin.

Since you want to have an IRL dashboard, you'll most probably use some kind of a microcontroller. Some of them (like Arduinos and their AT microcontrollers) have a built-in EEPROM, which you could use to store the data and calculate it on the fly.

NazarDiadiun commented 2 years ago

Thank you for such a quick answer :)

So you think it’s a good idea to reset the mileage in the game and the dashboard and then store the differences in mileage in microcontroller memory ? Well, thanks for the advice, I’ll try!

P.S. Using ATmega32u4, custom PCB with 2 channel CAN bus

ndelta0 commented 2 years ago

So you think it’s a good idea to reset the mileage in the game and the dashboard and then store the differences in mileage in microcontroller memory?

For me that seems to be the only option, since the AVG fuel usage is not available to the telemetry.

N95JPL commented 2 years ago

To jump in on this, when I release the new version of SCS-Telemetry-Server I might actually include these as optional parameters... Calculating daily mileage also depends on what you count as daily? Per driving day? Per full 24 hours?

Also isn't Average Consumption already a part of the SDK?

NazarDiadiun commented 2 years ago

By daily mileage, I mean mileage, which is under total mileage. Which is manually resetting on the dashboard by button

ndelta0 commented 2 years ago

So you're talking about the odometer?

NazarDiadiun commented 2 years ago

Yes, but there is an odometer that displays a total mileage, for example, 180,000 km, and there is a separate so-called daily mileage that can be dropped

N95JPL commented 2 years ago

Also known as a "Trip Mileage" for British folks? Resets to 0 then counts per trip... example my car had the odometer then

Is this what you mean?

NazarDiadiun commented 2 years ago

Yes, it is. I didn’t know, by the way, that it would reset itself if the car didn’t move for an hour or more

ndelta0 commented 2 years ago

I didn’t know, by the way, that it would reset itself if the car didn’t move for an hour or more

It probably depends on the car, I only saw cars with Trip A and Trip B, both of which were manually resettable.

N95JPL commented 2 years ago

Yes, it is. I didn’t know, by the way, that it would reset itself if the car didn’t move for an hour or more

It depends on the car, some do, some don't, i was just referencing my own car as an example

That should be pretty easy to implement setting a var to the Odometer as the "reset value" then check the difference

NazarDiadiun commented 2 years ago

Yes, I found a CAN address that shows when the reset button is pressed. I’ll store this mileage in EEPROM, once just synchronize with the game. It would, of course, be cool if my ATmega32u4 could work with the serial port and as a HID device at the same time. Then I could press a button on the panel and reset mileage in the game. In any case, it would be great if the SCS added more data to the telemetry. The extra data will never be :)

N95JPL commented 2 years ago

Yes, I found a CAN address that shows when the reset button is pressed. I’ll store this mileage in EEPROM, once just synchronize with the game. It would, of course, be cool if my ATmega32u4 could work with the serial port and as a HID device at the same time. Then I could press a button on the panel and reset mileage in the game.

In any case, it would be great if the SCS added more data to the telemetry. The extra data will never be :)

If there's a button for it, why don't you get the ATmega32u4 to send a message back through the serial to the system that's brokering the telemetry messages (how are you doing that btw) I can't remember but does the ingame dash show trip miles? If so I never realised they were resettable? If they are, map a key to do it then the Telemetry Broker could emulate that keystroke?

NazarDiadiun commented 2 years ago

Damn, really!

I use telemetry server, and through simple python script parsing JSON document on URL request. Indeed, why not make the python script listen to the serial port, and simply imitate button press.

Yes, Euro Truck Simulator 2 has a daily mileage, and you can also reset it.

Thank you for such cool ideas :)

N95JPL commented 2 years ago

No problem! You'll have to show us your setup! I am really curious!

NazarDiadiun commented 2 years ago

It’s sad that not many people do that, or don’t want to share their projects. I plan to upload all my work into the public repository. I have already created a repository, I will soon publish part of the results of my work :)

https://github.com/NazarDiadiun/ETS2-DAF-Dashboard

RenCloud commented 2 years ago

So far I see there is no further question here? If not, just reopen the issue.

If some new questions came up, feel free to open another issue or if it's less related to the plugin, you may also can join the discord server. Currently, there is not a specific channel for that specific talk, but I think about changing that, due to some action lately.

Your project sound nice. Thanks for sharing.