Jump to content
Jason-ABRP

New Torque and LeafSpy API

Recommended Posts

We've updated the Torque and LeafSpy API to use our new API portal at "api.iternio.com".  This means that anyone who was using the old system at "abetterrouteplanner.com:4441" will need to re-run the setup instructions at "Show Settings > Show More Settings > Live Car Connection > Setup"

This thread is for bug reports, feature requests, and other discussion about the API.

Thanks for helping make A Better Route Planner better!

Basic Troubleshooting:

If you're having issues getting this new connection to work try the following steps:

  1. Refresh the web browser (Reloading the page from scratch will force it to check if the new API is active)
  2. Double check all PIDs to be selected in Torque (Required are: Lat/Lon, Speed, SoC, Charging state/power)
  3. Double check the Address and Token
  4. If using Torque, turn off "Ignore short gaps between trips", close, and re-open (This will force Torque to restart the session, re-sending the setup packets).
Edited by Jason (ABRP)
Added troubleshooting steps
Link to comment
Share on other sites

43 minutes ago, Cnous3 said:

When choosing "test settings", it now fails saying the email address is not valid. 

This is expected, since Torque checks for a valid email format, and the token is not a valid email.  It will still work, though!

27 minutes ago, green light said:

Data is coming now! Looking good.

Great news! What did you have to do to get it to create a token? Or did refreshing / trying again do the trick?

Link to comment
Share on other sites

33 minutes ago, Jason (ABRP) said:

Great news! What did you have to do to get it to create a token? Or did refreshing / trying again do the trick?

I got no new token, the old one started working after several minutes, switching back to old URL, new URL, old several times and finally the new URL and data was shown. So it is still the old (first) token.

One thing I remember: I must not press the "refresh" button on the "view live data" because then it didn't (!) update. Just waiting several seconds and the correct data was shown.

Btw: just pressing the "new token" button and by that breaking Leaf Spy until the new token is entered seams too easy. You should add a warning dialog before that.

Edited by green light
Link to comment
Share on other sites

53 minutes ago, green light said:

I got no new token, the old one started working after several minutes, switching back to old URL, new URL, old several times and finally the new URL and data was shown. So it is still the old (first) token.

One thing I remember: I must not press the "refresh" button on the "view live data" because then it didn't (!) update. Just waiting several seconds and the correct data was shown.

Btw: just pressing the "new token" button and by that breaking Leaf Spy until the new token is entered seams too easy. You should add a warning dialog before that.

Issuing a new token shouldn't invalidate your old token (We do plan to add an interface at some point so you can manage tokens associated with your account).  That means something else must be broken - my money is on the "refresh" button on the live data display, I'll have a look at that and see if I can identify anything odd.

Link to comment
Share on other sites

After charging to new web address and inserting token, it's not updating on live view. It worked on old web address. With old setup it was wrong web address on setup wizard I had to dig a correct one on forum and it worked. Could you check web address for Ioniq, please. Other thing is when I quit Torque it shows a window stating log uploading left (see screenshot). 

Screenshot_20190422-080952.png

 

Screenshot_20190422-082941.png

Edited by Lexpowermetal@gmail.com
Link to comment
Share on other sites

Good catch, I've updated the instructions, but the address should be /ioniq28 (to match the format of the other vehicles' addresses, and to make it easier to differentiate support for the new higher-capacity Ioniq later this year).

Link to comment
Share on other sites

11 hours ago, green light said:

Well, looks like bad news: while driving the browser was not showing the location nor the charge chart. Switched back to the old address, working.

 

Ah, this is an oversight on my part, the website would get latched on the old system and not retry the new one if it already saw data on the old one.  I've updated this and it should work now @green light and @Cnous3, give it another try?

3 hours ago, g4rb4g3 said:

@Jason (ABRP)

Hi, did you change anything with the pids too? Or is ist just the new URL for the API and a token instead of the mail adress?

I wonder if the token is still "eml" in the API call?

Thanks!

Ah, actually for you I can do you one better! I built out a proper telemetry API instead of having to replicate the PIDs, should be easier to implement for you and easier to maintain in the future.  I promise I'll get it properly documented at some point...

I'll PM you with the details.

Link to comment
Share on other sites

11 hours ago, green light said:

Actually on a trip: old URL did no charge update but showed graph. News URL worked some time but then failed completely. Not graph, no location in map.

I'm sorry about that!

It seems I had some poor handling of missing data.  I looked through the error logs, and most of them revolve around missing speed or missing battery temp.  I've added a text output to the "View Live Data" display with an error message telling you what you're missing so you can re-run setup and hopefully get what you're looking for.

Speed is definitely required, so re-check your PIDs if you don't have the Speed parameter I'm looking for, add it!

Battery temperature is an optional parameter, so that was an error, and should not stop you from sending in your data.

Overall the error handling should be a lot better now, but there are likely still bugs to wring out.  I really appreciate all the bug reporting and system tests!

Link to comment
Share on other sites

5 hours ago, green light said:

Leaf Spy does not offer speed. Hopefully you are not expecting this.

 

Concur, it's unfortunate, but for LeafSpy specifically I have coded a workaround where I compute the speed from the latest and current lat/lon points.  It's not perfect, but better than nothing.  If this isn't working as expected, let me know!

5 hours ago, Shidar said:

I hope this works by tommorow, because I have a 700km Trip to do. ?
But I will test and report everything for sure. ?

If you need help troubleshooting send me an email at jason@abetterrouteplanner.com and I'll see what I can do to help you out!

Also, for anyone having trouble, I've added some basic troubleshooting steps in the OP.

Link to comment
Share on other sites

3 hours ago, Shidar said:

I just tested it but it does not work for me. ABRP just says: No units found, restart Torque Session to re-send Units packet.

I tried with both torque and the tool for Ioniq.

@g4rb4g3 - How do we force the ABRPTransmitter to re-send the units packet?  That error message means that the units stored for your profile are non-existent, and the data can't be used because we don't know what units they're in.

For Torque, it only sends the units packet at the beginning of each session.  The problem is, Torque is a little fuzzy on how it determines what a session is, so if you do the setup and it already thinks a session has started, I won't get the units packet until the start of a new session, whenever that is.  In theory this should work unless there's a bug in my code (definitely possible):

  1. Make sure the "Ignore short gaps between trips" setting on Data Logging and Upload is not checked
  2. Disconnect your phone from your OBD
  3. Perform the logging setup (if you haven't already).

 

Finally, after some tinkering with my test packets, I found and fixed another bug that was preventing units processing in some cases, so give it another go!

Link to comment
Share on other sites

5 hours ago, Jason (ABRP) said:

@g4rb4g3 - How do we force the ABRPTransmitter to re-send the units packet?  That error message means that the units stored for your profile are non-existent, and the data can't be used because we don't know what units they're in..

Currently there is no way to resend the default units. They will be sent before the first telemetry packet automatically. If that was successful the units won't be sent until the app is restarted.
 

Since I started already switching to the new API I won't make any changes here anymore.

I guess I'll get the first version ready in the next few days.

 

Link to comment
Share on other sites

For anyone still having issues, I've added some more error logging and fixed a few more minor bugs, so hopefully things should be settled out pretty well by now.  Give it another try if you were still having issues and let me know if it works, I'll be watching the log for errors and fixing them as I have time.

Link to comment
Share on other sites

Today I had a long 6 hours trip. Well.... bad mobil network sometimes but LeafSpy got its data sent most of the time (10 seconds intervall) but the ABRP web page mostly showed the battery symbol (so no live data).

Maybe this is an issue: I am sending all data of LeafSpy to my private server to log them and that PHP page does a request to the new ABRP API page (to reduce mobil traffic). So the HTTP request header has the same values but possibly other headers, too. Is this a problem?

 

Link to comment
Share on other sites

15 minutes ago, green light said:

Today I had a long 6 hours trip. Well.... bad mobil network sometimes but LeafSpy got its data sent most of the time (10 seconds intervall) but the ABRP web page mostly showed the battery symbol (so no live data).

Maybe this is an issue: I am sending all data of LeafSpy to my private server to log them and that PHP page does a request to the new ABRP API page (to reduce mobil traffic). So the HTTP request header has the same values but possibly other headers, too. Is this a problem?

Perhaps, but most likely not an issue.  We wanted to prefer HTTPS, are you sending HTTP or HTTPS? It shouldn't make a difference, and Torque is incapable of sending HTTPS, so we have to allow it.

What do you see on the Live Data display with LeafSpy / your server actively sending data? (Show More Settings > View Live Data) Does refreshing the page help?

If the basic troubleshooting in the OP doesn't help shoot me an email at jason@abetterrouteplanner.com and we'll solve it!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...