<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I’ve added the standard metrics that I could work out, and pushed that to the main. About 80 in total now. That should work for 99% of the functionality, and is a nice format for MQTT and GATT (although more work for v2 server protocol).<div class=""><br class=""></div><div class="">The ones I haven’t done are:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned char car_charge_b4; // B4 byte of charge state</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned int car_chargepower; // Charge Power (1/10 kW)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned char car_lockstate; // Lock State</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern char sys_features[FEATURES_MAX]; // System features</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned char net_link; // Network link status</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned int car_max_idealrange; // Maximum ideal range in miles</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern signed int car_power; // Current battery power level (1/10 kW)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned long car_energy_used; // Energy used on trip (Wh)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned long car_energy_recd; // Energy recovered on trip (Wh)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned char car_stopped_mincnt; // Minute countdown while stopped</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned int car_12v_current; // 12V (DC converter) current in 1/10 A</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern signed int car_chargefull_minsremaining;  // ETR for 100%</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern signed int car_chargelimit_minsremaining_range; // ETR for range limit</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern signed int car_chargelimit_minsremaining_soc; // ETR for SOC limit</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned int car_chargelimit_rangelimit;   // Range limit (in vehicle units)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned char car_chargelimit_soclimit;    // SOC% limit</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern signed char car_coolingdown;              // >=0 if car is cooling down</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned char car_cooldown_chargemode;    // 0=standard, 1=storage, 3=range, 4=performance</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned char car_cooldown_chargelimit;   // Charge Limit (amps)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern signed int car_cooldown_tbattery;         // Cooldown temperature limit</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned int car_cooldown_timelimit;      // Cooldown time limit (minutes) remaining</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned char car_cooldown_wascharging;   // TRUE if car was charging when cooldown started</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 14px;" class="">extern unsigned char car_SOCalertlimit;           // Low limit of SOC at which alert should be raised</span></font></div></div></blockquote><div class=""><br class=""></div><div class="">As they seem either vehicle-specific, or internal working variables.</div><div class=""><br class=""></div><div class="">I think they should be fairly self-explanatory, although in places I’ve renamed them to make more sense (e.g. MS_V_CHARGE_MINUTES and MS_V_CHARGE_KWH, rather than car_chargeduration and car_chargekwh). I’ve also dropped a few that were really duplicating the same basic information.</div><div class=""><br class=""></div><div class="">Do the best you can, and if you can’t work out how to get something in particular, let me know or leave it as a “TODO” marked in the code.</div><div class=""><br class=""></div><div class="">Thanks, Mark</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 8 Oct 2017, at 5:40 PM, Tom Parker <<a href="mailto:tom@carrott.org" class="">tom@carrott.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 04/10/17 02:30, Mark Webb-Johnson wrote:<br class=""><blockquote type="cite" class="">I just added the very basic ones, as a starting point and proof of concept. Hadn’t decided if I needed anything special for the bitmapped ones at the time (either a new MetricBitmap type, or extend MetricInt). Looking at how things have evolved, and bearing in mind the GAPP bluetooth stuff, and OVMS v3 MQTT, it seems that each bit should be a metric of their own. Not too hard for ovms_server_v2 to convert that back to an integer bitmap, for backwards compatibility. To do that, car_doors1 becomes:<br class=""></blockquote><br class="">I fully support the concept of storing the data in the most appropriate format and serializing it into the v2 message in the v2 server code. I like the idea of storing the bit field stuff as separate boolean objects. I don't know if you can do anything clever with C++ to use less memory while preserving a nice API within the vehicle code, but we probably have enough memory to not need to worry too much?<br class=""><br class=""><blockquote type="cite" class="">So, if you have time, please go ahead and add the other standard ones that are simple and shared across all cars.<br class=""></blockquote><br class="">I'll add them as I need them for porting the leaf code. I don't support most of the "standard" metrics in the leaf code so it won't be all of them.<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">Is anyone working on the v2 server support code to send the S and D messages?<br class=""></blockquote><br class="">Nope. Not at the moment. I’ve stubbed it.<br class=""></blockquote><br class="">I've implemented an S message using the TPMS as an example and the few metrics that we already have. I found the android client can't cope with an empty value, so I had to modify the if undefined return the empty string behavior in the AsString implementations in subclasses of OvmsMetric. I'm currently "learning" how C++ inheritance works and am in a twisty maze of complier errors. I'll explain what I'm doing tomorrow and hopefully there is an obvious answer. Once I've sorted that out I'll send a pull request (I hacked it by hard coding values that work for a v2 android client which presumably breaks other things. What I want to do is replace the existing methods with ones that takes an argument to return as a default value, and re-implement the existing no-argument methods in terms of the new method).<br class=""><br class="">I'm at the point where I can take it for a drive on my phone's wifi hotspot.<br class="">_______________________________________________<br class="">OvmsDev mailing list<br class=""><a href="mailto:OvmsDev@lists.teslaclub.hk" class="">OvmsDev@lists.teslaclub.hk</a><br class="">http://lists.teslaclub.hk/mailman/listinfo/ovmsdev<br class=""></div></div></blockquote></div><br class=""></div></body></html>