ETS2/ATS Telemetry Web Server + Mobile Dashboard

arcypreste
Posts: 5
Joined: 02 Dec 2017 11:20

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#1401 Post by arcypreste » 31 Jan 2021 19:40

mgysgtdev wrote: 31 Jan 2021 13:41 @arcypreste i think it should be
utils.formatFloat(data.truck.fuelAverageConsumption*data.truck.speed)
try using that for the data.(WhatYouCalledIt)
so for instance data.kmPerHour = (utils.formatFloat(data.truck.fuelAverageConsumption*data.truck.speed), 1);
if you don't wand a , with a number after it use this -> utils.formatFloat(data.truck.fuelAverageConsumption*data.truck.speed)
i think this should work but you have to test it yourself

btw that is the way i started to do it myself aswell, after time went by i learned to do it from scratch. i recently made a actros mp4 from scratch. if you want it is on the forum aswell and realistic like in real life. aswell as other i am making.
viewtopic.php?f=41&t=293518
Perfect!! Thank you very much!! I had to modify it a bit but it works !!

data.litroshour = utils.formatFloat ((data.truck.fuelAverageConsumption * data.truck.speed / 100), 1) + '': '';

Thank you very much for the help, as soon as I have it finished I will post it here.

PS: I have seen your Mercedes Actros dashboard and it is magnificent, thanks to all this work you do, I have also been able to make my own dashboards.

Regards!
mgysgtdev
Posts: 484
Joined: 05 Sep 2015 18:32
Location: netherlands
Contact:

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#1402 Post by mgysgtdev » 31 Jan 2021 21:13

@arcypreste Your welcome mate. Nice to see it work ;) Might use that piece of code aswell if I find a dashboard menu that has the Liters Per Hour consumption.
Proud owner of a homemade DAF XF105 Simpit
[ external image ]
User avatar
HeadSwitch
Posts: 150
Joined: 05 Jan 2016 06:20
Location: Down Under

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#1403 Post by HeadSwitch » 14 Mar 2021 09:16

Had the error below while using the Telemetry server.

Code: Select all

{
    "message": "An error has occurred.",
    "exceptionMessage": "Error getting value from 'FineOffense' on 'Funbit.Ets.Telemetry.Server.Data.Ets2FinedGameplayEvent'.",
    "exceptionType": "Newtonsoft.Json.JsonSerializationException",
    "stackTrace": "   at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target)\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CalculatePropertyValues(JsonWriter writer, Object value, JsonContainerContract contract, JsonProperty member, JsonProperty property, JsonContract& memberContract, Object& memberValue)\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)\r\n   at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n   at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer)\r\n   at Funbit.Ets.Telemetry.Server.Controllers.Ets2TelemetryController.GetEts2TelemetryJson()\r\n   at Funbit.Ets.Telemetry.Server.Controllers.Ets2TelemetryController.Get()\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()",
    "innerException": {
        "message": "An error has occurred.",
        "exceptionMessage": "Non-negative number required.\r\nParameter name: count",
        "exceptionType": "System.ArgumentOutOfRangeException",
        "stackTrace": "   at System.Text.UTF8Encoding.GetString(Byte[] bytes, Int32 index, Int32 count)\r\n   at GetFineOffense(Object )\r\n   at Newtonsoft.Json.Serialization.DynamicValueProvider.GetValue(Object target)"
    }
}
Not too sure what had caused it though. Hopefully someone can understand what is going on in here.
mgysgtdev
Posts: 484
Joined: 05 Sep 2015 18:32
Location: netherlands
Contact:

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#1404 Post by mgysgtdev » 14 Mar 2021 09:31

@HeadSwitch seems like an error regarding counting the times you get a fine
Proud owner of a homemade DAF XF105 Simpit
[ external image ]
User avatar
HeadSwitch
Posts: 150
Joined: 05 Jan 2016 06:20
Location: Down Under

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#1405 Post by HeadSwitch » 14 Mar 2021 09:42

@mgysgtdev hmmmm maybe I've been getting a few too many.....
mgysgtdev
Posts: 484
Joined: 05 Sep 2015 18:32
Location: netherlands
Contact:

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#1406 Post by mgysgtdev » 14 Mar 2021 09:52

@HeadSwitch
Can you pm me the part of the code that counts the fines? Maybe i can find what the problem might be
Proud owner of a homemade DAF XF105 Simpit
[ external image ]
User avatar
HeadSwitch
Posts: 150
Joined: 05 Jan 2016 06:20
Location: Down Under

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#1407 Post by HeadSwitch » 14 Mar 2021 11:06

@mgysgtdev I haven't been diving into the code myself. Not even going to attempt to try and understand it. I was only using the server and my own basic dashboard at the time.
mgysgtdev
Posts: 484
Joined: 05 Sep 2015 18:32
Location: netherlands
Contact:

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#1408 Post by mgysgtdev » 14 Mar 2021 12:52

@HeadSwitch which skin is it? maybe i can take a look into the code and see what might be wrong. i think it has to do either with the data it gets from the offense name or counting the fined times
Proud owner of a homemade DAF XF105 Simpit
[ external image ]
User avatar
HeadSwitch
Posts: 150
Joined: 05 Jan 2016 06:20
Location: Down Under

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#1409 Post by HeadSwitch » 15 Mar 2021 05:49

The error wans't from the skin but the telemtry data coming from the game.
No skins would work until after I restarted the game as there was no data to load.
ampersand
Posts: 45
Joined: 05 Sep 2019 15:28

Re: ETS2/ATS Telemetry Web Server + Mobile Dashboard

#1410 Post by ampersand » 20 Mar 2021 09:27

Hey.

Is there any way to get the cargo name? I mean 'human' name like "Used package" as it is shown in the game.
Post Reply

Return to “General discussion about the game”

Who is online

Users browsing this forum: AleksaVP and 13 guests