Jump to content
Jason (ABRP)

New Torque and LeafSpy API

Recommended Posts

Posted (edited)

HTTPS.

I just made a simple but interesting test:

Just sitting in the car, Leaf Spy running and sending data every 10 seconds to my server and by that to ABRP API. Live View was green, all data correct. Interval shown as 6 seconds.

I did that for several minutes and then Live View showed an interval of 20 seconds. Still same Leaf Spy settings. And after a few more minutes values were marked with that cyan color that indicate no data - and the LED indicator in the settings was no longer green.

I did the test a second time by shutting of Leaf Spy and the ABRP page for a minute and started both again. After several minutes (maybe ten or more) same picture.

I checked my server logs. Nothing to tell. Every 10 seconds a http request of leaf spy and I logged the requests and responses or the HTTPS request to ABRP API, all fine, no error, all requests finished under a second.

So from my side it looks like after many requests the data is no longer sent to the frontend.

Maybe helpful: tests were at about 22:00 to 22:17 CEST.

 

Edited by green light

Share this post


Link to post
Share on other sites
4 hours ago, green light said:

HTTPS.

I just made a simple but interesting test:

Just sitting in the car, Leaf Spy running and sending data every 10 seconds to my server and by that to ABRP API. Live View was green, all data correct. Interval shown as 6 seconds.

I did that for several minutes and then Live View showed an interval of 20 seconds. Still same Leaf Spy settings. And after a few more minutes values were marked with that cyan color that indicate no data - and the LED indicator in the settings was no longer green.

I did the test a second time by shutting of Leaf Spy and the ABRP page for a minute and started both again. After several minutes (maybe ten or more) same picture.

I checked my server logs. Nothing to tell. Every 10 seconds a http request of leaf spy and I logged the requests and responses or the HTTPS request to ABRP API, all fine, no error, all requests finished under a second.

So from my side it looks like after many requests the data is no longer sent to the frontend.

Maybe helpful: tests were at about 22:00 to 22:17 CEST.

Ah, yeah, the interval setting is a holdover from when I set the retrieval interval dynamically.  It made generalization with multiple data sources difficult, so for the moment it's merely set to once every 6 seconds (on further thought, this should probably be 5 seconds, as that's a typical interval multiple).
In any case, I updated the timer and changed the staleness timeout so it's longer than 20 seconds.  See if you're still seeing the indications? If you do see your data go stale again, what happens if you click "Refresh" on the live data view?

Also, for anyone else interested, I added some of the new parameters the new API supports better to the viewer.  Let me know if any of the data needs re-formatting! For example, the Bolt's SoH comes through as kWh, so I have to back-convert to %.

Share this post


Link to post
Share on other sites
13 hours ago, green light said:

Current version broke Leaf Spy support completely. No values shown in live view for me.

Very strange.  All of my test packets provide the correct response to LeafSpy (not that that matters for your server), and update my telemetry on the website.

I changed a few things that I think might be a culprit, could you refresh the website and try again?  

Alternately, could you send me the URL your server is sending along so I can try it on my side and try to diagnose?

13 hours ago, Lexpowermetal@gmail.com said:

@Jason (ABRP) after you mentioned you did some fixed few days, my stats from Ioniq started working for the first time since new web server, but it stopped working after your latest post.

Sorry about that!  All my test packets for the Ioniq seemed to work just fine when I released it, so there's got to be something screwy I missed.

What happens when you view the live data and click refresh? (More Settings > View Live Data > Refresh)

 

Could anyone encountering issues provide me with some details so I can diagnose:

  1. Do a hard refresh (Ctrl + F5) of the webpage
  2. Screenshot of the Live Data display
  3. Press F12 on the ABRP website, select the Console - provide a screenshot

Share this post


Link to post
Share on other sites
Posted (edited)
7 hours ago, Jason (ABRP) said:

Very strange.  All of my test packets provide the correct response to LeafSpy (not that that matters for your server), and update my telemetry on the website.

I changed a few things that I think might be a culprit, could you refresh the website and try again?  

Alternately, could you send me the URL your server is sending along so I can try it on my side and try to diagnose?

Sorry about that!  All my test packets for the Ioniq seemed to work just fine when I released it, so there's got to be something screwy I missed.

What happens when you view the live data and click refresh? (More Settings > View Live Data > Refresh)

 

Could anyone encountering issues provide me with some details so I can diagnose:

  1. Do a hard refresh (Ctrl + F5) of the webpage
  2. Screenshot of the Live Data display
  3. Press F12 on the ABRP website, select the Console - provide a screenshot

Hi Jason,

what I found out last night (using Abrptransmitter App, not Torque on an IONIQ) :

- if I delete browser data or refresh (F5, ctrl-F5) or use a brand new browser I get a new token (not requested). W10 Chrome, also tested with MS Edge. 

- if I log of from ABRP and log on with a 2nd account on my mobile (Android Pie, Chrome) the old data of the session log on before will stay (token, saved plans) regardless any manual refreshing until I delete browser data. 

I receive no live data but also now not be sure to use the right token (of 30?:-)) or not knowing if I am correctly logged in? 

Regards 

Curd 

Edited by curd

Share this post


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

Very strange.  All of my test packets provide the correct response to LeafSpy (not that that matters for your server), and update my telemetry on the website.

I changed a few things that I think might be a culprit, could you refresh the website and try again?  

Alternately, could you send me the URL your server is sending along so I can try it on my side and try to diagnose?

Sent by private message.

Share this post


Link to post
Share on other sites
1 hour ago, curd said:

I receive no live data but also now not be sure to use the right token (of 30?:-)) or not knowing if I am correctly logged in? 

Regards 

Curd 

Add: if I try to issue a new token on my mobile (Android Pie, Chrome) nothing happens. Not to be sure if new token is issued in the background but displayed data will not be refreshed...

/Curd

Share this post


Link to post
Share on other sites

Very sorry to everyone for the delay, @green light helped me solve it, my utmost thanks for the help troubleshooting and diagnosing the bug!

Turns out it was indeed my last push (as @Lexpowermetal@gmail.com noted), had a typo in the new battery temp field that only affected metric units, and as a wacky-imperial-units-using American I forgot to test in metric before releasing.  Please let me know if you're still seeing issues, the more details you can provide about what you're seeing the better!

Feel free to email me if you'd like to get more direct help (jason@abetterrouteplanner.com)

Share this post


Link to post
Share on other sites
Posted (edited)
On 5/1/2019 at 11:16 PM, curd said:

I receive no live data but also now not be sure to use the right token (of 30?:-)) or not knowing if I am correctly logged in? 

 

 

Just in the moment I had captured the outgoing http packet on my router... ABRP gives me live data of 700sec before.

The http session was:

GET /1/tlm/send?token={curd's token}&api_key=7726b9c9-e606-4839-b587-8b35fbd4494c&tlm=%7B%22lon%22:9.745105555555556,%22ext_temp%22:11,%22speed%22:0,%22elevation%22:54,%22car_model%22:%22hyundai:ioniq:17:28:other%22,%22utc%22:1556797830,%22is_charging%22:0,%22power%22:0,%22lat%22:52.29381111111111,%22soc%22:73%7D HTTP/1.1

Content-Length: 0

Host: api.iternio.com

Connection: Keep-Alive

Accept-Encoding: gzip

 

HTTP/1.1 200 OK

Date: Thu, 02 May 2019 11:50:31 GMT

Server: Apache/2.4.29 (Ubuntu)

Keep-Alive: timeout=2, max=1000

Connection: Keep-Alive

Transfer-Encoding: chunked

Content-Type: application/json;charset=utf-8

 

10

{"status": "ok"}

0

 

😉

I will test later again with a "live ride".

/Curd

 

Edited by Jason (ABRP)
Removed token

Share this post


Link to post
Share on other sites
Posted (edited)

@Jason (ABRP) thanks, that's seem to fixed it. Just on observation, if I log from 2 different browser on my android phone it will give me 2 different tokens on each browser (see screenshot attached) but live data is working on both browsers regardless of token. But why different browsers give different token, isn't it supposed to be the same?

Screenshot_20190502-145708.png

Screenshot_20190502-145717.png

Screenshot_20190502-150003.png

Screenshot_20190502-145948.png

Edited by Lexpowermetal@gmail.com

Share this post


Link to post
Share on other sites

Both tokens are associated with your account.  Each time you click the reload button on the display or come in on a fresh session and enter that page on the settings another token is generated.  This doesn't break your old token.  These tokens are only for setting up your Live Data, and obfuscating your information if we were to be subject to a MITM attack.

Share this post


Link to post
Share on other sites

Well, you might want to add a feature (button, menu, ...) to invalidate a token. Eg. there are already several tokens published in this thread. And this forum is public readable.

Share this post


Link to post
Share on other sites
On 5/2/2019 at 11:16 PM, green light said:

Well, you might want to add a feature (button, menu, ...) to invalidate a token. Eg. there are already several tokens published in this thread. And this forum is public readable.

Yep, this is coming soon.  We need better account management in general, so that will be wrapped into that update.

I went through the thread and removed any tokens that were still posted.

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