[Ovmsdev] Ovms for Think City - definition of variable car_tbattery
mark at webb-johnson.net
Thu Aug 15 23:28:43 HKT 2013
Wow! Nice reading about your progress. Looks like you have a few developers on board to help you.
It would be good to get your project integrated with the main OVMS code, so we can all see and work on it. Best to fork the latest OVMS, then make your changes and send me a pull request to merge in.
For the car_tbattery, changing signed int16 should be fine. Let me check tomorrow (I need to review the existing vehicle module and apps code).
For the other vehicle-specific parameters, what I have been thinking is to introduce an X type, and provide a hook for the vehicle module to provide it on request. That should be very expandable and allow vehicle-specific parameters to be supported and sent to the server and apps. If a particular variable is used by several vehicles, it should be standardised and put into ovms.h, otherwise it can be kept vehicle-specific. If you look at the tesla or Twizy vehicle modules you will see a local vehicle variables section at the top - that is arranged as an overlay so all vehicles share the same physical memory (only one vehicle active at once).
> On 15 Aug, 2013, at 10:51 pm, Håkon Markussen <hakon.markussen at gmail.com> wrote:
> Hi all,
> I'm a new user and have starting to develop/configure on the OVMS for Think City.
> Currently I've made success with both SMS and App interrogation and it works well!
> The result and some screenshots can be viewed at the Norwegian EV-forum in this post:
> Due to some problems with the definition of global variables (changing more files than vehicle_thinkcity.c), I've been doing my development locally, not uploaded anything to GitHub.
> The main problem is that the variable car_tbattery is defined as signed char.
> Most Think City EV's have a "Zebra-battery" which operating temperature is about 270 degrees celcius (oC).
> E.g. sending temperature 264 oC requires 9 bits -> 1 0000 10000
> I think the signed char offers only 8 bits (bit 7 is set for negative numbers), and turns my value into
> 0000 1000 -> 8 oC ...
> I understand that the OVMS-server (and the App) knows that car_tbattery is signed char, so to get around this I will ask if it's possible to redefine car_tbattery as signed int ?
> As a second priority request, I would also ask if it's possible to add pack_voltage and pack_current to the global variables
> unsigned int car_pack_voltage = 0; // Zebra battery pack voltage
> signed int car_pack_current = 0; // Zebra battery pack temp
> extern unsigned int car_pack_voltage; // Zebra battery pack voltage
> extern signed int car_pack_current; // Zebra battery pack temp
> I'm not sure how things are done here, so have me excused if I ask a little too much.
> Best regards
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OvmsDev