29 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

roki12
Help please with error in sendlivedata2abrp.js - ReferenceError:

I need some help please.

I'm trying to save script sendlivedata2abrp.js to /store/scripts/sendlivedata2abrp.js

The script is c/p from https://docs.openvehicles.com/en/latest/plugin/abrp/README.html, I changed lines:

 *   CAR_MODEL: 
 *   OVMS_API_KEY : 
 *   MY_TOKEN : 

The rest (timer, url and cr) was already there...

If I check "EvaluateJS" I get following error:

ERROR: ReferenceError: identifier 'exports' undefined
    at [anon] (duk_js_var.c:1236) internal
    at eval (eval:308) preventsyield (line 308)

Any suggestions how to correct this?

The second error is when I try to save the script to file on this location (or any other in /store) the system hangs and it doesn't save the file and then I get "timeout" and have to login again. Looks like it resets itself.

***EDIT: I deleted some files and then managed to save it into the scripts folder.***

OVMS# module summary
OVMS MODULE SUMMARY

Module
  Version:  3.3.003/ota_0/main (build idf v3.3.4-848-g1ff5e24b1b Sep  3 2022 11:32:12)
  Hardware: OVMS WIFI BLE BT cores=2 rev=ESP32/3; MODEM SIM7600
  12v:      14.6v

MODEM Status
  Model: SIM7600
  Network Registration: RegisteredRoaming
    Provider: ******* Hologram
    Signal: -65 dBm
    Mode: LTE,Online
  State: NetMode
    Ticker: 179
    User Data: 0
  UART:
    FIFO overflows: 0
    Buffer overflows: 0
    Parity errors: 0
    Frame errors: 0
    Driver Buffer overflows: 0
  Mux: Status up
    Open Channels: 4
    Framing Errors: 0
    RX frames: 280
    TX frames: 35
    Last RX frame: 0 sec(s) ago
  PPP: Connected on channel: #2
  GPS: Connected on channel: #1
     Status: enabled
     Time: enabled

Configuration
  [auto]
    dbc: no
    egpio: no
    ext12v: no
    init: yes
    modem: yes
    obd2ecu: 
    scripting: yes
    server.v2: yes
    server.v3: no
    vehicle.type: KN
    wifi.mode: apclient
    wifi.ssid.ap: *****
    wifi.ssid.client: ******
  [can]
  [dbc]
  [egpio]
    monitor.ports: 
  [http.plugin]
  [http.server]
  [locations]
    Home: 46.038348,14.611619,30
  [log]
    file.enable: no
    file.path: /store/log
    level: info
  [modem]
    apn: hologram
    apn.password: 
    apn.user: 
    enable.gps: yes
    enable.gpstime: yes
    enable.net: yes
    enable.sms: yes
    pincode: 
  [module]
    cfgversion: 2020053100
    init: done
  [network]
    dns: 
  [notify]
    log.trip.minlength: 20
    report.trip.enable: yes
    report.trip.minlength: 20
  [obd2ecu]
  [obd2ecu.map]
  [ota]
    http.mru: https://ovms.dexters-web.de/firmware/ota/v3.3/main/ovms3.bin
    server: https://ovms.dexters-web.de/firmware/ota
  [password]
    module: **redacted**
    pin: **redacted**
    server.v2: **redacted**
    server.v3: **redacted**
  [plugin]
  [plugin.disabled]
  [plugin.enabled]
  [plugin.repos]
  [power]
    12v_shutdown_delay: 30
    enabled: yes
    modemoff_delay: 96
    wifioff_delay: 24
  [pushover]
  [sdcard]
  [server.v2]
    port: 
    server: api.openvehicles.com
    tls: yes
    updatetime.connected: 
    updatetime.idle: 
  [server.v3]
    port: ******
    server: *******
    tls: no
    topic.prefix: 
    updatetime.charging: 120
    updatetime.connected: 120
    updatetime.idle: 600
    updatetime.on: 120
    user: *****
  [ssh.info]
    fingerprint: **********
  [ssh.keys]
  [ssh.server]
    key: **redacted**
  [system.adc]
    factor12v: 195.7
  [tpms]
  [usr]
  [vehicle]
    12v.alert: 11
    12v.ref: 
    bms.alerts.enabled: no
    id: 62KHC
    minsoc: 20
    name: Kia Niro EV
    registered.phone: +38641383576
    stream: 10
    timezone: CET-1CEST,M3.5.0,M10.5.0/3
    timezone_region: Europe/*******
    units.distance: K
  [wifi.ap]
    62-KHC: **redacted**
  [wifi.ssid]
    A63574: **redacted**
    Pixel: **redacted**
    TP-Link_2D46: **redacted**
  [xkn]
    canwrite: yes
    cap_act_kwh: 
    consoleKilometers: yes
    leftDrive: yes
    maxrange: 440
    suffrange: 0
    suffsoc: 0

REPORT ENDS
IamMattM
BLE data transfer directly to ABRP on phone

BLE data transfer directly to ABRP on phone ?

Would it not be great to send the collected OBD2 data directly over BLE to phone ABRP app rather than push those info out on LTE...
ABRP now supports this mode out of the box ?
https://www.iternio.com/abrp-obd

So if LTE coverage is bad, the ABRP navigation solution would still be correct.
GPS accuracy of the OVMS might also be better than using the phone GPS in ABRP.

Not too sure what it would take to enable the BLE radio of the ESP32 to act as one of those OBD2 BLE Dongles...

Here is an ESP32 based open source project that presents itself as an els327-protocol OBD dongle over BLE:
https://github.com/meatpiHQ/wican-fw

Log in or register to post comments