[Ovmsdev] some partial success

Nikolay Shishkov nshishkov at yahoo.com
Thu Jan 3 03:48:41 HKT 2013


Michael, 

I have had some conflicting experiences with CAN bus, and have learned the lesson to test where the values are and take it from there. This is why I actually used the car_linevoltage and car_charging current variables and put the can_buffer bytes 0,1,2,3 in them to see what am I getting... and the result was zeros. While the 4 and 5 are getting the old value.
It almost seems like the CAN bus registers are not written when I am reading them. And the can_2_soc2 variable is just getting its value from the same memory location as last time... although it should have been initialized. 

Do the can_soc variable need to be declared as "volatile"?

What is "internal" GPS? Is it internal to the car? Or internal to the OVMS module? What should be the setting if there is no GPS coordinates reported on the CAN bus?

Can I see my debug commands (like when I send DEBUG SMS) from the openvehicle.com server? Or I need the android app for that?

Thanks,
Nikolay





________________________________
 From: Michael Balzer <dexter at expeedo.de>
To: ovmsdev at lists.teslaclub.hk 
Sent: Wednesday, January 2, 2013 8:34 PM
Subject: Re: [Ovmsdev] some partial success
 

Nikolay, Mark,

Am 02.01.2013 19:28, schrieb Nikolay Shishkov:


>
>            can_2_soc2 = ((unsigned int) can_databuffer[4] << 8) + can_databuffer[5];
>Initially I got the 5th and 6th array elements, but noticed that I had it wrong... so I changed to 4th and 5th... 
>
>
>And finally at the debug sms handler:
>    s = stp_i  ( s, " SOC=",   can_2_soc2 );
>
>
>I changed the strings abit and can see that the new code is running, but do not understand how come a completely different values are reported - the value is from can_databuffer[5] and can_databuffer[6].
>So the 301 contains the following bytes (viewed with PCAN) 00 00 0e 7d 01 b2 0a 4a. 
>The SOC is supposed to be in 0E7D (actually it is the DOD), but I am getting the 0AB2 in the can_2_soc2 value.
>
I don't know PCAN, but the CAN byte numbering normally begins at 0
    on the left, so 0e in your example is can_databuffer[2] and 7d is
    ...[3].

If you get 0AB2, that would be [6][5] = your initial code?

Btw: we could solve variable name conflicts between vehicle modules
    by introducing some namespace prefix (replacing "can_") like Mark
    already did for the functions. I'd shorten that for vars to e.g.
    "vrt_" for "vehicle renault twizy", accordingly "vtc_" for the Think
    and so on. OK, Mark?

Regards,
Michael


-- 
Michael Balzer * Paradestr. 8 * D-42107 Wuppertal
Fon 0202 / 272 2201 * Handy 0176 / 206 989 26 
_______________________________________________
OvmsDev mailing list
OvmsDev at lists.teslaclub.hk
http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20130102/4e280173/attachment.htm>


More information about the OvmsDev mailing list