Jump to content
Jason (ABRP)

New Torque and LeafSpy API

Recommended Posts

Posted (edited)

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

Share this post


Link to post
Share on other sites
Posted (edited)

Well, "issue a new token" does nothing for me. But also sending data to the new address is not updating anything. Using the old address does it fine. (leaf40)

Edited by green light

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites
Posted (edited)
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Posted (edited)

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

Share this post


Link to post
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).

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

@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!

Share this post


Link to post
Share on other sites

 

8 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.

 

Same for me. 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Today I copied the ID again. It was different maybe due to my recreate tests at beginning. Working like a charme!

So with old ID the live view was updating but now with current ID charts are shown! Wonderful.

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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!

Share this post


Link to post
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.

 

Share this post


Link to post
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.

Share this post


Link to post
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?

 

Share this post


Link to post
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!

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
Reply to this topic...

×   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...