27 posts / 0 new
Last post
dar63
Send live data to abrp

You probably know abetterrouteplanner.com
It is probably the best tool to plan a route, and to optimize where to charge.
It has a live function, which allows to adjust with the real consumption of the vehicle, by connecting an obd device and soft like EVNotify or Torque Pro.

Why not having this function with OVMS?

On abrp forum, it is explained how to send data:
https://forum.abetterrouteplanner.com/topic/97-submitting-live-data-thro...

What do you think?

Tobahc
Sounds like a great idea,

Sounds like a great idea, although I’m not the one who can contribute in programming, unfortunately.

When this works, does it mean I would get updated ABRP-data on my phone through the ABRP servers, or through direct communication between my phone and the OVMS plug?

dar63
It means once it will work,

It means once it will work, you can launch abrp on your phone, and follow your route and consumption and next stop to charge in this website- app like.

Tobahc
That is the functional answer

That is the functional answer. I was looking for the technical answer: what is the data flow, from where to where? Does the OVMS plug communicate with the ABRP server(s) or with the phone or tablet where ABRP is running?

dar63
Yes you're right.

Yes you're right.
Technically, OVMS box will send data directly to abrp server-side through 3g/4g link. No direct info from OVMS to the phone running client-side, as it is not an existing functionality I am aware of.

dar63
abrp live data using scripting ?

Maybe we could use scripting to do it?

We could use part of this java code: https://github.com/g4rb4g3/ABRPTransmitter/blob/master/app/src/main/java...

dar63
I finally found a way

Using the web plugin of OVMS web server, I am able in JavaScript to get vehicle data and send it to abrp.
I will test it tomorrow with a real travel to see how it works.
Unfortunately, it is not through the OVMS embedded script functionality.

dexter
dexter's picture
HTTP API

I just pushed the first implementation of a HTTP API:

https://docs.openvehicles.com/en/latest/userguide/scripting.html#http

Included in edge build version 3.2.008-147-g73ae2d19 on my server (dexters-web.de), will be in edge on openvehicles.com within 24 hours.

Testing & feedback is welcome.

Regards,
Michael

dar63
something new to test

wonderfull :-) something new to test now.
I'll keep you informed, thank you

Ningaloo
Reference error

Hello dar63, thank you for your great work. I installed the script as descripted. Only i get the error indentifier 'abrp' undefined. Any idea how to resolve this?

Dimitrie
Hi, when your follow the

Hi, when your follow the instruction in the doc. https://github.com/openvehicles/Open-Vehicle-Monitoring-System-3/tree/ma...
And copy past the
add to /store/scripts/ovmsmain.js:
abrp = require("sendlivedata2arbp");

there is a typo, it should be:
abrp = require("sendlivedata2abrp");

Ningaloo
Typo

Yes, i deed find the typo too. When i fixed the typo. The error was gone. Thanks

instrukcije
instrukcije's picture
Still not working

Hello. I followed the instruction on plugins side... created files, enter my_token, change car_model.

In OVMS I type Message: script eval abrp.info() and it turn me just OK.

Any idea? Anybody manage to conect OVMS to ABRP? 

Best regards, Joze

dar63
Hi,

Hi,

I am very sorry it doesn't work yet for you; of course I tried, but not since they changed the look and feel.

Let me try again and make it work, I will try this week and come back with answers I hope ;-)

kindly regards

David

dar63
work with abrp developer

Hi @instrukcije,

You're right, I tried to run my utility with abrp, using 'script eval abrp.onetime()', and I have as a reply a message '401 unauthorised'.

I am discussing now with the api developer, Jason, and we'll try to understand what is happening now.

I'll keep you informed.

David

dar63
Hello again,

Hello again,

You were right, there was a bug, following a change in the abrp server. JAson had fixed it.

So please find more explanations and screen copies to see how it works.

To install the plugin ABRP (https://docs.openvehicles.com/en/latest/plugin/abrp/README.html), you can simply use the editor of the embedded web server of the OVMS module. This editor will allow you to paste the plugin code from the documentation, and also to configure your own token and car model that you will find in th abrp website (in classic mode, https://abetterrouteplanner.com/classic ).

Don’t forget also to create/modify the ovmsmain module as described in the OVMS documentation.

Finally reboot your OVMS module.

You’re now ready. Test it with the shell page in the embedded web server using the command script eval abrp.info() and then with the command script eval abrp.onetime(). You can also do it with the mobile app. https://pasteboard.co/J47BzNs.jpg 

This was a one-time configuration. Done

Now your journey will start ;  you want to launch this plugin and send live data to abrp, you can simply launch it from the mobile app, in the ‘Messages’ window: write the command in the text box: script eval abrp.send(1)

start sending data: https://pasteboard.co/J47CXys.jpg 

abrp live data: https://pasteboard.co/J47zyvG.tiff 

shell in embedded web server: https://pasteboard.co/J47Cmvh.tiff 

To stop sending data when you arrived: write the command in the text box:  script eval abrp.send(0)

stop sending data : https://pasteboard.co/J47AbZ1.jpg

 

Ok I hope it could help you

/David

instrukcije
instrukcije's picture
Thanks, but I still got

Thanks, but I still got message: 

ERROR: ReferenceError: identifier 'abrp' undefined (line 1)

when I start script eval abrp.info().

What am I doing wrong? 

https://pasteboard.co/J4yGL7C4.jpg

https://pasteboard.co/J4yH4Fk.jpg

https://pasteboard.co/J4yHihW.jpg

https://pasteboard.co/J4yHuOX.jpg

https://pasteboard.co/J4yHGRd.jpg

KommyKT
Try to change the quota char

Try to change the quota char in omvmain.js

instrukcije
instrukcije's picture
Working yesss

Thanks yessmiley, working now.

inf0mike
inf0mike's picture
I have finally got around to

I have finally got around to setting this up and to put it simply, it's great.  I've wanted to have abrp integration from before I even discovered Ovms and my inital efforts with Torque Pro and a bluetooth OBD dongle were less than reliable.

As a part of getting this set up I have spotted and corrected a couple of minor bugs in the script and have also created some additional API methods for manipulating the stored configuration.

@dar63 I was intending to submit a PR for my updates.  I'm a professional software developer by day but I've never actually contributed any code to an open source project before so I would be grateful of any advice.

I've also submitted a request to join the developer mailing list.

Regards,

Mike.

inf0mike
inf0mike's picture
Code to contribute

I have finally got around to setting this up and to put it simply, it's great.  I've wanted to have abrp integration from before I even discovered Ovms and my inital efforts with Torque Pro and a bluetooth OBD dongle were less than reliable.

As a part of getting this set up I have spotted and corrected a couple of minor bugs in the script and have also created some additional API methods for manipulating the stored configuration.

@dar63 I was intending to submit a PR for my updates.  I'm a professional software developer by day but I've never actually contributed any code to an open source project before so I would be grateful of any advice.

I've also submitted a request to join the developer mailing list.

Regards,

Mike.

dexter
dexter's picture
Code to contribute

Welcome Mike :-)

I assume this is your fork: https://github.com/inf0mike/Open-Vehicle-Monitoring-System-3

General contribution rules are outlined here: https://github.com/inf0mike/Open-Vehicle-Monitoring-System-3#development-and-contributions

To create a pull request for a single change:

  1. Merge or rebase to the latest master changes. If you cloned your fork, you should be able to do  git pull --rebase --autostash upstream master  to update directly from the openvehicles repository.
  2. Push your local changes into your Github repository
  3. Create the pull request on Github (straight forward, see https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork)

We will then check your PR, tell you in case anything needs to be changed, or merge your changes.

If you continue pushing commits they will be added to the open PR. Close the PR if you want to do a larger rework. If you want to separate the PR from other work in progress, create it on a dedicated branch.

Regards,
Michael

Alenux
Doc plugin link dead

I went onto the webpage for the ABRP plugin and noticed that the "Edit on GitHub" link is broken. Could that be fixed? Also, I'm assuming that the script linked on that page won't automatically update as the code is changed on GitHub correct?

inf0mike
inf0mike's picture
You are correct that the

You are correct that the "edit on github" link is broken, I am not sure where that is defined but I'm sure someone will pick that up and fix it

I can confirm however, that the code that is shown on the documentation page has updated and is the latest version. (1.3)

Mike

kierank01
plugin installed/working, ABRP app not updating

Hi,

I have got OVMS delivered last week, and have installed the ABRP plugin today.

The plugin seems to be working...I think

I have set the following config parametres:
config set usr abrp.url "api.iternio.com/1/tlm/leaf24"   ***edit, I have set the url to https://api.iternio.com/1/tlm/leaf24
config set usr abrp.user_token "MY UUID"
config set usr abrp.car_model "nissan:leaf:12:24:other"

I have left the CONST values default in the sendlivedata2abrp.js file
I have issued the "script eval abrp.info(), script eval abrp.onetime() & script eval abrp.send(1) commands, without error

However, I created a plan in ABRP, and started driving. 25km out & back starting at 100% SOC

The SOC would not update in the app, when I got to the turnabout point, ABRP recalculated, and said that I would arrive with -300% SOC.

Not sure what I am doing wrong. The car that I have is a 2015 leaf 24 SV. I have unplugged the TCU

kierank01
ABRP::"SSL error"

Hi,

Following from my previous post, have been scratcing my head a bit...

Running the script commands while connected to the OVMS wifi AP, rather than the android app, I do seem to be getting errors

Sometimes, I get ABRP::"Too many open files in system"

Not sure what is causing that, but a reboot seems to resolve

But mostly I get: ABRP::"SSL error"

I (173313) script: [sendlivedata2abrp.js:256:OnRequestFail] error="SSL error"
I (173323) ovms-server-v2: Send MP-0 PIABRP::"SSL error"
I (173383) script: [sendlivedata2abrp.js:256:OnRequestFail] error="SSL error"
I (173403) ovms-server-v2: Send MP-0 PIABRP::"SSL error"
 

Not sure what that means, I have searched the forum, and the OVMS webinterface, and cannot see anything that might help.

kierank01
ok, I got this sorted!!! 

ok, I got this sorted!!! enlightened

config set usr abrp.url http://api.iternio.com/1/tlm/send

I think I was thinking about this too hard wink

Thaks for all the hard work, getting this setup

Log in or register to post comments