<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 implemented these standard commands in vehicle framework:<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: 18px;" class="">virtual vehicle_command_t CommandSetChargeMode(vehicle_mode_t mode);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">virtual vehicle_command_t CommandSetChargeCurrent(uint16_t limit);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">virtual vehicle_command_t CommandStartCharge();</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">virtual vehicle_command_t CommandStopCharge();</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">virtual vehicle_command_t CommandSetChargeTimer(bool timeron, uint16_t timerstart);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">virtual vehicle_command_t CommandCooldown(bool cooldownon);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">virtual vehicle_command_t CommandWakeup();</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">virtual vehicle_command_t CommandLock(const char* pin);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">virtual vehicle_command_t CommandUnlock(const char* pin);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">virtual vehicle_command_t CommandActivateValet(const char* pin);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">virtual vehicle_command_t CommandDeactivateValet(const char* pin);</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">virtual vehicle_command_t CommandHomelink(uint8_t button);</span></font></div></div></blockquote><div class=""><br class=""></div><div class="">Also implemented most of these for the Tesla Roadster, as an example implementation.</div><div class=""><br class=""></div><div class="">I haven’t changed ovms_server_v2 yet, to implement the standard command processor for these, but that should be trivial.</div><div class=""><br class=""></div><div class="">Vehicle modules are able to implement handlers for these standardised commands, as well as their own custom commands (if required).</div><div class=""><br class=""></div><div class="">Regards, Mark.</div><div class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">On 29 Oct 2017, at 8:58 PM, Mark Webb-Johnson <<a href="mailto:mark@webb-johnson.net" class="">mark@webb-johnson.net</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Looks good.<br class=""><br class="">I”ll look at the standardised commands tomorrow. My thinking is that OvmsVehicle implements standardised virtual functions for these with an enum (NotImplemented, Success, Fail) return value (and default implementations ’NotImplemented’). Then, if a vehicle implements the command, it does it and returns Success/Fail. OvmsVehicle can then implement OvmsCommands for all the standardised commands.<br class=""><br class="">That would replace the commandhandler(BOOL msgmode, int code, char* msg) from v2.<br class=""><br class="">If a vehicle wants to implement it’s own custom commands, it can do as normal (via it’s own command space, I guess, like “RT” for Renault Twizy).<br class=""><br class="">If anybody has got any ideas how this should be done better, let me know, otherwise I’ll continue along those lines.<br class=""><br class="">Regards, Mark<br class=""><br class=""><blockquote type="cite" class="">On 29 Oct 2017, at 6:37 PM, Michael Balzer <<a href="mailto:dexter@expeedo.de" class="">dexter@expeedo.de</a>> wrote:<br class=""><br class="">…just pushed.<br class=""><br class="">I've also made some minor changes & extensions to the framework,<br class="">hopefully helpful.<br class=""><br class="">This is very basic support (~10%). It covers CAN processing and battery<br class="">/ power monitoring. Just metrics output for now, no commands or<br class="">notifications.<br class=""><br class="">Free RAM is down to 36.6 K after loading the module.<br class=""><br class="">I've removed the "v." from the "x.rt.v." metrics names, as nearly all<br class="">"x.rt" metrics are (of course) vehicle metrics. "x.rt.m.version" does<br class="">not fit the scheme and breaks into the "motor" namespace, as "m." was in<br class="">use before, maybe we should better use "mot." for motor metrics.<br class=""><br class="">Regards,<br class="">Michael<br class=""><br class=""><br class="">OVMS > config list x.rt<br class="">x.rt<br class=""> autopower: yes<br class=""> autoreset: yes<br class=""> canwrite: no<br class=""> cap_act_prc: 87.4<br class=""> cap_nom_ah: 108.0<br class=""> chargelevel: 0<br class=""> chargemode: 0<br class=""> console: no<br class=""> kickdown: yes<br class=""> maxrange: 71<br class=""> suffrange: 65<br class=""> suffsoc: 85<br class=""><br class="">OVMS > metrics list<br class="">m.freeram                                36644<br class="">m.hardware                               OVMS WIFI BLE BT cores=2<br class="">rev=ESP32/1<br class="">m.monotonic                              541Sec<br class="">m.net.mdm.iccid                        <br class="">m.net.mdm.model                        <br class="">m.net.provider                           WLAN-214677<br class="">m.net.sq                               <br class="">m.net.type                               wifi<br class="">m.serial                                 30:ae:a4:37:25:88<br class="">m.tasks                                  17<br class="">m.time.utc                               546Sec<br class="">m.version                                3.0.0/factory/main build (idf<br class="">v2.1-20-g88ab5d48) Oct 29 2017 09:15:17<br class="">s.v2.connected                         <br class="">s.v2.peers                             <br class="">v.b.12v.current                          1.6A<br class="">v.b.12v.voltage                          0.527473V<br class="">v.b.cac                                  94.392Ah<br class="">v.b.current                              -36A<br class="">v.b.energy.recd                          0.000739342kWh<br class="">v.b.energy.used                          0kWh<br class="">v.b.power                                -2.0224kW<br class="">v.b.range.est                            50Km<br class="">v.b.range.full                           68.2571Km<br class="">v.b.range.ideal                          49Km<br class="">v.b.soc                                  71.92%<br class="">v.b.soh                                  100%<br class="">v.b.temp                                 15.4286°C<br class="">v.b.voltage                              56.2V<br class="">v.c.charging                             yes<br class="">v.c.climit                             <br class="">v.c.current                              36A<br class="">v.c.duration.full                        82Min<br class="">v.c.duration.range                       50Min<br class="">v.c.duration.soc                         25Min<br class="">v.c.kwh                                  0.000739342kWh<br class="">v.c.minutes                              6Min<br class="">v.c.mode                                 standard<br class="">v.c.pilot                                yes<br class="">v.c.state                                charging<br class="">v.c.substate                             go<br class="">v.c.temp                                 25°C<br class="">v.c.timermode                          <br class="">v.c.timerstart                         <br class="">v.c.type                               <br class="">v.c.voltage                              230V<br class="">v.d.cp                                   yes<br class="">v.d.fl                                 <br class=""><a href="http://v.d.fr" class="">v.d.fr</a>                                 <br class="">v.d.hood                               <br class="">v.d.rl                                 <br class="">v.d.rr                                 <br class="">v.d.trunk                              <br class="">v.e.alarm                              <br class="">v.e.awake                                no<br class="">v.e.c.config                             no<br class="">v.e.c.login                              no<br class="">v.e.charging12v                          yes<br class="">v.e.cooling                            <br class="">v.e.drivemode                          <br class="">v.e.handbrake                          <br class="">v.e.headlights                         <br class="">v.e.heating                            <br class="">v.e.hvac                               <br class="">v.e.locked                               no<br class="">v.e.on                                   no<br class="">v.e.parktime                           <br class="">v.e.temp                               <br class="">v.e.valet                                no<br class="">v.i.temp                               <br class="">v.m.temp                                 0°C<br class="">v.p.altitude                           <br class="">v.p.direction                          <br class="">v.p.gpslock                            <br class="">v.p.latitude                           <br class="">v.p.longitude                          <br class="">v.p.odometer                             3456.51Km<br class="">v.p.satcount                           <br class="">v.p.speed                                0Kph<br class="">v.p.trip                                 3456.51Km<br class="">v.tp.fl.p                              <br class="">v.tp.fl.t                              <br class="">v.tp.fr.p                              <br class="">v.tp.fr.t                              <br class="">v.tp.rl.p                              <br class="">v.tp.rl.t                              <br class="">v.tp.rr.p                              <br class="">v.tp.rr.t                              <br class="">v.type                                   RT<br class="">v.vin                                    7378280<br class="">x.rt.b.cell.01.voltage.act               4.025V<br class="">x.rt.b.cell.01.voltage.max               4.025V<br class="">x.rt.b.cell.01.voltage.maxdev            2.85712V<br class="">x.rt.b.cell.01.voltage.min               4.02V<br class="">x.rt.b.cell.02.voltage.act               4.015V<br class="">x.rt.b.cell.02.voltage.max               4.015V<br class="">x.rt.b.cell.02.voltage.maxdev            0.857117V<br class="">x.rt.b.cell.02.voltage.min               4.01V<br class="">x.rt.b.cell.03.voltage.act               4.015V<br class="">x.rt.b.cell.03.voltage.max               4.015V<br class="">x.rt.b.cell.03.voltage.maxdev            0.857117V<br class="">x.rt.b.cell.03.voltage.min               4.01V<br class="">x.rt.b.cell.04.voltage.act               4.01V<br class="">x.rt.b.cell.04.voltage.max               4.015V<br class="">x.rt.b.cell.04.voltage.maxdev            0.857117V<br class="">x.rt.b.cell.04.voltage.min               4.005V<br class="">x.rt.b.cell.05.voltage.act               4.015V<br class="">x.rt.b.cell.05.voltage.max               4.015V<br class="">x.rt.b.cell.05.voltage.maxdev            0.857117V<br class="">x.rt.b.cell.05.voltage.min               4.01V<br class="">x.rt.b.cell.06.voltage.act               4.015V<br class="">x.rt.b.cell.06.voltage.max               4.015V<br class="">x.rt.b.cell.06.voltage.maxdev            -1.14288V<br class="">x.rt.b.cell.06.voltage.min               4.005V<br class="">x.rt.b.cell.07.voltage.act               4.015V<br class="">x.rt.b.cell.07.voltage.max               4.015V<br class="">x.rt.b.cell.07.voltage.maxdev            0.285706V<br class="">x.rt.b.cell.07.voltage.min               4.01V<br class="">x.rt.b.cell.08.voltage.act               4.01V<br class="">x.rt.b.cell.08.voltage.max               4.01V<br class="">x.rt.b.cell.08.voltage.maxdev            -1.14288V<br class="">x.rt.b.cell.08.voltage.min               4.005V<br class="">x.rt.b.cell.09.voltage.act               4.01V<br class="">x.rt.b.cell.09.voltage.max               4.01V<br class="">x.rt.b.cell.09.voltage.maxdev            -1.14288V<br class="">x.rt.b.cell.09.voltage.min               4.005V<br class="">x.rt.b.cell.10.voltage.act               4.01V<br class="">x.rt.b.cell.10.voltage.max               4.01V<br class="">x.rt.b.cell.10.voltage.maxdev            -1.14288V<br class="">x.rt.b.cell.10.voltage.min               4.005V<br class="">x.rt.b.cell.11.voltage.act               4.015V<br class="">x.rt.b.cell.11.voltage.max               4.015V<br class="">x.rt.b.cell.11.voltage.maxdev            0.285706V<br class="">x.rt.b.cell.11.voltage.min               4.01V<br class="">x.rt.b.cell.12.voltage.act               4.01V<br class="">x.rt.b.cell.12.voltage.max               4.01V<br class="">x.rt.b.cell.12.voltage.maxdev            -1.14288V<br class="">x.rt.b.cell.12.voltage.min               4.005V<br class="">x.rt.b.cell.13.voltage.act               4.01V<br class="">x.rt.b.cell.13.voltage.max               4.01V<br class="">x.rt.b.cell.13.voltage.maxdev            -1.14288V<br class="">x.rt.b.cell.13.voltage.min               4.005V<br class="">x.rt.b.cell.14.voltage.act               4.025V<br class="">x.rt.b.cell.14.voltage.max               4.025V<br class="">x.rt.b.cell.14.voltage.maxdev            2.14288V<br class="">x.rt.b.cell.14.voltage.min               4.015V<br class="">x.rt.b.cell.15.voltage.act               0V<br class="">x.rt.b.cell.15.voltage.max               0V<br class="">x.rt.b.cell.15.voltage.maxdev            0V<br class="">x.rt.b.cell.15.voltage.min               0V<br class="">x.rt.b.cell.16.voltage.act               0V<br class="">x.rt.b.cell.16.voltage.max               0V<br class="">x.rt.b.cell.16.voltage.maxdev            0V<br class="">x.rt.b.cell.16.voltage.min               0V<br class="">x.rt.b.cell.cnt                          14<br class="">x.rt.b.cmod.01.temp.act                  16°C<br class="">x.rt.b.cmod.01.temp.max                  16°C<br class="">x.rt.b.cmod.01.temp.maxdev               0.57143°C<br class="">x.rt.b.cmod.01.temp.min                  16°C<br class="">x.rt.b.cmod.02.temp.act                  15°C<br class="">x.rt.b.cmod.02.temp.max                  15°C<br class="">x.rt.b.cmod.02.temp.maxdev               -0.42857°C<br class="">x.rt.b.cmod.02.temp.min                  15°C<br class="">x.rt.b.cmod.03.temp.act                  16°C<br class="">x.rt.b.cmod.03.temp.max                  16°C<br class="">x.rt.b.cmod.03.temp.maxdev               0.57143°C<br class="">x.rt.b.cmod.03.temp.min                  16°C<br class="">x.rt.b.cmod.04.temp.act                  15°C<br class="">x.rt.b.cmod.04.temp.max                  15°C<br class="">x.rt.b.cmod.04.temp.maxdev               -0.42857°C<br class="">x.rt.b.cmod.04.temp.min                  15°C<br class="">x.rt.b.cmod.05.temp.act                  16°C<br class="">x.rt.b.cmod.05.temp.max                  16°C<br class="">x.rt.b.cmod.05.temp.maxdev               0.57143°C<br class="">x.rt.b.cmod.05.temp.min                  16°C<br class="">x.rt.b.cmod.06.temp.act                  15°C<br class="">x.rt.b.cmod.06.temp.max                  15°C<br class="">x.rt.b.cmod.06.temp.maxdev               -0.42857°C<br class="">x.rt.b.cmod.06.temp.min                  15°C<br class="">x.rt.b.cmod.07.temp.act                  15°C<br class="">x.rt.b.cmod.07.temp.max                  15°C<br class="">x.rt.b.cmod.07.temp.maxdev               -0.42857°C<br class="">x.rt.b.cmod.07.temp.min                  15°C<br class="">x.rt.b.cmod.08.temp.act                  -40°C<br class="">x.rt.b.cmod.08.temp.max                  -40°C<br class="">x.rt.b.cmod.08.temp.maxdev               0°C<br class="">x.rt.b.cmod.08.temp.min                  -40°C<br class="">x.rt.b.cmod.cnt                          7<br class="">x.rt.b.pack.1.temp.stddev.max            0.495093°C<br class="">x.rt.b.pack.1.voltage.max                56.2V<br class="">x.rt.b.pack.1.voltage.min                56.1V<br class="">x.rt.b.pack.1.voltage.stddev.max         0.00586302V<br class="">x.rt.b.pack.cnt                          1<br class="">x.rt.m.version                           0.1.0 Oct 29 2017 10:44:20<br class="">x.rt.p.stats.acc.dist                    0Km<br class="">x.rt.p.stats.acc.recd                    0kWh<br class="">x.rt.p.stats.acc.spdavg                  0Kph/s<br class="">x.rt.p.stats.acc.used                    0kWh<br class="">x.rt.p.stats.cst.dist                    0Km<br class="">x.rt.p.stats.cst.recd                    0.000739342kWh<br class="">x.rt.p.stats.cst.spdavg                  0Kph<br class="">x.rt.p.stats.cst.used                    0kWh<br class="">x.rt.p.stats.dec.dist                    0Km<br class="">x.rt.p.stats.dec.recd                    0kWh<br class="">x.rt.p.stats.dec.spdavg                  0Kph/s<br class="">x.rt.p.stats.dec.used                    0kWh<br class="">x.rt.p.stats.ldn.dist                    0Km<br class="">x.rt.p.stats.ldn.hsum                    0m<br class="">x.rt.p.stats.ldn.recd                    0kWh<br class="">x.rt.p.stats.ldn.used                    0kWh<br class="">x.rt.p.stats.lup.dist                    0Km<br class="">x.rt.p.stats.lup.hsum                    0m<br class="">x.rt.p.stats.lup.recd                    0kWh<br class="">x.rt.p.stats.lup.used                    0kWh<br class=""><br class=""><br class=""><br class="">-- <br class="">Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal<br class="">Fon 02333 / 833 5735 * Handy 0176 / 206 989 26<br class=""><br class=""><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=""></blockquote><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></div></body></html>