Jump to content
  • 0
noradtux

Submitting live data through NOT torque

Question

Hi,

I am working on collecting data from my Ioniq through a Raspberry Pi. I'd like to send that data to ABRP. I can't quite figure out how to emulate Torque's webrequests, so I'd like to know if there is some other way of transmitting the data? Maybe something JSON based? Or maybe someone could point me to how ABRP expects the "torque"-data to look.

Regards

Malte

Share this post


Link to post
Share on other sites

18 answers to this question

Recommended Posts

  • 0

Yes, absolutely! For the Ioniq all you need to do is send two types HTTP GET requests.  One when you first start a session telling me what units you're sending me, a second at the intervals you want to send me data.  The format of the two requests is:

Units: 

http://abetterrouteplanner.com:4441/ioniq_data?eml=jason@abetterrouteplanner.com&session=123456789&time=1536275713174&defaultUniteeba76=C&defaultUnite50c2b=%...

Data: 

http://abetterrouteplanner.com:4441/ioniq_data?eml=jason@abetterrouteplanner.com&session=123456789&time=1536275713174&keeba76=4.4&ke50c2b=55.23...

Just add a "k" in front of each PID in the data, and a "defaultUnit" in front of each PID in the Units.  For reference, I really only need units for the GPS speed, elevation, OBD Speed and Temperature, the rest doesn't change much user-to-user.  The format I generally see is: F or C for temperature, kmh or mph for speed, and ft or m for elevation.  I prefer everything in metric, but I've got conversions in place if you give me imperial instead.

 

PID Names:

    # "email":      "eml",    # email of user, identifies user
    "time":       "time",   # time at which data was taken
    # "torque_id":    "id",     # torque ID, identifies user
    "session_id":     "session",  # session ID, keeps trips together. Useful for eventually offering viewer.
    "pack_current":   "eeba76",  # A
    "pack_voltage":   "e6f992",  # V
    "pack_power":     "e0484f",  # kW
    "pack_soc":       "e50c2b",   # %
    "pack_capacity":  "ea9e51",  # %
    "charger_power":  "e52d8a",  # unitless, 1 or 0 depending on if charging is taking place
    "obd_speed":      "ee4ea0",     # km/h
    "gps_speed":      "ff1001",  # km/h
    "gps_elevation":  "ff1010",  # m
    "gps_lon":        "ff1005",  # deg
    "gps_lat":        "ff1006",   # deg

 

Share this post


Link to post
Share on other sites
  • 0

Hi Malte,

I also have a Raspberry running in my Ioniq and "emulating" the Torque interface. Runs ok for me so far. In case you are running into issues feel free to contact me.

@Jason (ABRP) As I am currently charging in a non GPS covered parking and therefore logging "without" GPS coordinates it seems the data is ignored by ABRP and I do not get my real latest SOC for route planning. Would it be possible to change this behaviour to just use the latest available SOC for "live view" and planning?

Best regards, Rolf

Share this post


Link to post
Share on other sites
  • 0

@RolFus - Yes, absolutely! I'll make this change when I get some time, but it might be good for you to just re-send the last known coordinates that way you get an updated car position on your map.  Could use that to find your car in the parking lot.  

Share this post


Link to post
Share on other sites
  • 0

@Jason

I found out about you route planner in www.goingelectric.de forum. That place where I found out that the Ioniq navigation unit is Android based too. 🙂

A few days ago I discovered that the navi sends out a broadcast with the exact gps coordinates. Before I already discovered how to communicate with the so called "GreenCarManager" which provides the current SoC and other stuff. So I have almost everything to create an app thats installed to the navi system and talks to your webserver. 🙂

Edited by g4rb4g3

Share this post


Link to post
Share on other sites
  • 0

Somehow I struggled to finish my post....

I just have a few questions, first of all I don't understand the time format for the url... It's not an unix epoch timestamp, but what is it then?

Another thing I would like to know is if there are more gps parmeters that I can send to your webserver? From the Ioniq I get the full package including heading, hdod and pdop. In the javascript I found out that it uses heading too, any chance I can send that via the GET request too?

And whats then maximum length of the session id?

 

I played around a little bit yesterday already. I just created a simple app with a WebView loading your site. Then I called the setcarposition everytime I got a broadcast message from the navi unit.

See yourself:

 

20190219_204543.jpg

Edited by g4rb4g3
image uploaded

Share this post


Link to post
Share on other sites
  • 0
5 hours ago, g4rb4g3 said:

@Jason

I found out about you route planner in www.goingelectric.de forum. That place where I found out that the Ioniq navigation unit is Android based too. 🙂

A few days ago I discovered that the navi sends out a broadcast with the exact gps coordinates. Before I already discovered how to communicate with the so called "GreenCarManager" which provides the current SoC and other stuff. So I have almost everything to create an app thats installed to the navi system and talks to your webserver. 🙂

That is incredibly interesting! 

4 hours ago, g4rb4g3 said:

Somehow I struggled to finish my post....

I just have a few questions, first of all I don't understand the time format for the url... It's not an unix epoch timestamp, but what is it then?

Another thing I would like to know is if there are more gps parmeters that I can send to your webserver? From the Ioniq I get the full package including heading, hdod and pdop. In the javascript I found out that it uses heading too, any chance I can send that via the GET request too?

 And whats then maximum length of the session id?

Time format is GMT/UTC milliseconds.  Honestly, I don't really care about that, I just need it to compute delta time to figure out how often the frontend should poll the backend for data (And for eventual analysis.)  Realistically, you could just count up ms from the start of the session in milliseconds in the time field and that would be perfectly functional.  Or just pass me GMT milliseconds. Or unix milliseconds. Or UTC+7.75 milliseconds.

The only GPS parameters I actually use are lat/long/elevation.  Heading is unreliable since phones are the source typically, and who knows what orientation the phone is in the car.  We compute actual heading based on your motion.

What are hdod and pdop?

Session ID is 20 characters max, just needs to be a unique-to-you value.  I use it to distinguish between simultaneously driving cars of the same type when I run analysis to improve our carmodels.  If you generate a random string of letters and numbers that would probably be close enough.

Share this post


Link to post
Share on other sites
  • 0
4 hours ago, Jason (ABRP) said:

That is incredibly interesting! 

Time format is GMT/UTC milliseconds.  Honestly, I don't really care about that, I just need it to compute delta time to figure out how often the frontend should poll the backend for data (And for eventual analysis.)  Realistically, you could just count up ms from the start of the session in milliseconds in the time field and that would be perfectly functional.  Or just pass me GMT milliseconds. Or unix milliseconds. Or UTC+7.75 milliseconds.

The only GPS parameters I actually use are lat/long/elevation.  Heading is unreliable since phones are the source typically, and who knows what orientation the phone is in the car.  We compute actual heading based on your motion.

What are hdod and pdop?

Session ID is 20 characters max, just needs to be a unique-to-you value.  I use it to distinguish between simultaneously driving cars of the same type when I run analysis to improve our carmodels.  If you generate a random string of letters and numbers that would probably be close enough.

Thank you alot for the information!

 

HDOP & PDOP seem to show you how exactly the GPS position is.

https://en.wikipedia.org/wiki/Dilution_of_precision_(navigation)

 

In the frontend you seem to use the heading in function setCarLocation(lat, lon, heading, locationinfo, timestamp).

When I tried you website in my webview calling the setcarlocation with heading the cursor always showed the right direction.

Yesterday I just tried it with Firefox and sometimes the cursor moved sideways because it didn't turn around. Thats why I asked if there is support for more gps parameters via url.

 

For the Session ID I thougt about a simple timestamp yyyymmddHHmmss, no special chars just numbers. That should work out for you if you combine it with mail address for you analysis.

 

Are the values for voltage, current and so on important for anything? Because it seems that I can't get those values. I just get the SoC.

 

And another thing, who often can I call the url from your server? Because it seems like I get a few updates per second. That would be too much I guess, do you know a "best practice" value?

Share this post


Link to post
Share on other sites
  • 0

For heading, we do have one that's used for car-provided data (Teslas mostly), but when none is provided it sets the heading to the direction provided by the line between your last GPS point and your current GPS point.  

Your session ID should work, any character is allowed, so fire away!

Current / Voltage / Power are nice to have, make my analysis easier.  SoC is the minimum for following along with a plan.

There isn't a parameter identified for outside temperature for the Ioniq in the PIDs that are accessible over OBD.  If you have that available to you, then send it to me as "&ext_temp=12.34" and "&defaultUnitext_temp=C" and I'll update the server to receive that.

Assuming you get this all working, how easy would it be for other users to run ABRP in their Ioniq's webviews? Would it be worth incorporating your edits to the main site to allow anyone to do what you've done?

Share this post


Link to post
Share on other sites
  • 0

Wow, cool news. Great you would add temperature parameter for that!

Would it make sense to add one for heading too? It's the car that reports those values and in the webview it worked pretty good.

I don't plan to implement a webview anymore since there is no one working on this old version of Android anymore that works with your site too. And it doesn't support the Chrome provided webview too since support was added with Android 5 and the Ioniq has 4.2.2....

So I thought about shipping a pretty small apk that just uploads the car data to your site.

Then anyone could install a modern browser like Firefox and open your website.

So to sum it up, anyone interested would have to install two apps and make sure the Ioniq can go online somehow.

Give me a few more days to finish up everything and then we could setup some instructions for interested people.

 

Share this post


Link to post
Share on other sites
  • 0

Well, I just revamped the instructions for setting live data up (More Settings > Live Data > Setup).  Would be pretty easy to add an alternate path for the Ioniq.

Share this post


Link to post
Share on other sites
  • 0

Ok so here it is, after long and hard work from Jason and me I finally released ABRPTransmitter.

https://github.com/g4rb4g3/ABRPTransmitter

It uses all the available data (GPS, SoC, Energy consumption, Temperatur) and transmitts it to ABRP. 🙂

Just install it, start it, enter your mail address you have used to register at ABRP and the app will start to push the data.

Once it's configured it will autmatically start in background when the cars navigation system had a GPS lock.

 

Special thanks to Jamson who supported me alot!

Share this post


Link to post
Share on other sites
  • 0

Sounds great... just me being to stupid to install it?!? How do I get it installed on the onboard Unit? Sorry for the hassle...

Share this post


Link to post
Share on other sites
  • 0

Download the apk from the releaes on GitHub.

Then follow this guide to install apps.

 

Share this post


Link to post
Share on other sites
  • 0

Thanks for the Video This part I gat installed flawlessly...
but sorry for anoying you again ;(

Where do i find the "com.lge.ivi.jar" file to put into "/app/externallibs/"? 

Share this post


Link to post
Share on other sites
  • 0
On 3/8/2019 at 3:09 PM, RolFus said:

Thanks for the Video This part I gat installed flawlessly...
but sorry for anoying you again ;(

Where do i find the "com.lge.ivi.jar" file to put into "/app/externallibs/"? 

Do you want do build it yourself? If so then you have to pull the all the /system/framework files from your car to your computer.

Then you have to deodex com.lge.ivi.jar and convert it with dex2jar back to java. Then you rename it to com.lge.ivi.jar and put it in the directory.

Since this is property of Hyundai I'm not allowed to distribute it.

If you don't want to build it yourself grab the apk file from the releases.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


Contact Us

Bo - Lead Developer and Tesla owner: bo@abetterrouteplanner.com

Jason - New Car Models, Developer and Bolt owner : jason@abetterrouteplanner.com

Idreams - Forums Administrator, Forums Developer and Tesla owner : idreams@abetterrouteplanner.com

×
×
  • Create New...