[Ovmsdev] Basic OVMS concepts

Craig Leres leres at xse.com
Sun Jun 9 10:39:38 HKT 2019


After a long period of procrastination it's time for me to get a OVMS 
module working in my Cadillac. If I can get it to the point where it 
doesn't kill the battery and lets me see where the car is it'll be about 
as usable as my free onstar account and I'll be able to kill that off.

The last time I worked on it I was able to decode/display/store the vin. 
I thought I had figured out the car awake messages but a capture I made 
today makes me doubt I have that correct. Either way I don't think I 
understand what it is I need.

I assume when the vehicle is "off" the ovms module wakes up periodically 
to check location, upload current status. And when the vehicle is "on" 
it stays booted. And this driven by some metrics?  Looking at other 
vehicles I was using:

     StdMetrics.ms_v_env_on->SetValue();
     StdMetrics.ms_v_env_awake->SetValue();

But I'm not sure what events should set/clear these. I'm used to 
thinking of a car being a few different states:

     off
     accessories on
     engine on
     engine running

So I guess "awake" is when something wakes up the bus (e.g. door unlock, 
key fob press, door open, etc.) and everybody starts sending their "I'm 
here" messages for awhile and if nothing else happens they go back to 
sleep. I see logic for this in vehicle_nissanleaf.cpp (awake on certain 
can ids, asleep from a 1 second watchdog if 
StandardMetrics.ms_v_env_awake->IsStale())

Still looking at the leaf (which doesn't have an engine) 
StdMetrics.ms_v_env_on seems to indicate the car can be driven.  Does 
that map to the engine running for a gas engine car?  I also see logic 
in the mitsubishi but it's not obvious if the transition is accessories 
on or engine on.

Are there other metrics I need to manage for miminal support?

One of the things I was hoping to do with the Cadillac was capture the 
frames that onstar sends to the navigation head unit when you use the 
"send to in-dash navigation" feature of the onstar app. But the list of 
things you can do with the free onstar account has constantly gotten 
shorter over the last few years and it appears they've killed off this 
feature in the last month or so. Too bad because this would have been a 
neat feature to add to ovms.

While I'm here...

The J1850 tools I've built up are not at all helpful with canbus; but I 
have a raspberrypi 2 that isn't doing anything and I believe I can use 
it to get wireshark going with a skpang.co.uk "PiCAN2 CAN-Bus Board" so 
I ordered one. Speaking of wireshark and canbus, this video shows an 
interesting product:

     https://youtu.be/xZNszFTaP0A

it has a mode that has a billboard which shows which can ids have been 
changing with lots of neat options like hiding and highlighting recently 
changed octets. I suspect it won't be difficult to write something with 
similar functionality. But I think my id mapping will go a lot faster if 
I can do things while watching a display.

		Craig


More information about the OvmsDev mailing list