[Ovmsdev] Nissan Leaf Support Request

Tom Parker tom at carrott.org
Thu Jul 12 00:26:46 HKT 2018

On 11/07/18 23:25, Robin O'Leary wrote:
> On Thu, Jul 05, 2018 at 08:34:34PM +1200, Tom Parker wrote:
>> You want to use the play store version. I'm running 3.12.4 from the Play
>> store and when connected to a Leaf, I see the AC button.
> I updated the app to 3.12.4.(20180428), but it looks the same as before;
> I don't see an AC button.  What am I missing?

The AC button is controlled by the capabilities message which, it turns 
out, isn't implemented in OVMS v3. I think the server is sending _my_ 
clients a capabilities message because, I guess, at one stage I sent one 
to the server (probably by connecting an OVMS v2 module).

In OVMS v2 the Nissan Leaf module has:

// Nissan Leaf capabilities:
// - CMD_StartCharge (11)
// - CMD_Homelink (24)
// - CMD_ClimateControl (26)
rom char nissanleaf_capabilities[] = "C11,C24,C26";

and reading the code in net_msg.c, it looks like the capabilities 
message for a Leaf would be

MP-0 VC11,C24,C26,C1-6,C40-41,C49

which is what the server sends me when I connect a client to my vehicles.

The following untested patch should make it work, but is obviously 
inappropriate because the capabilities depend on the vehicle.

diff --git 
index faa2e6c..6e9d28f 100644
--- a/vehicle/OVMS.V3/components/ovms_server_v2/src/ovms_server_v2.cpp
+++ b/vehicle/OVMS.V3/components/ovms_server_v2/src/ovms_server_v2.cpp
@@ -1272,6 +1272,7 @@ void OvmsServerV2::TransmitMsgEnvironment(bool always)
  void OvmsServerV2::TransmitMsgCapabilities(bool always)
    m_now_capabilities = false;
+  Transmit("MP-0 VC11,C24,C26,C1-6,C40-41,C49");

  void OvmsServerV2::TransmitMsgGroup(bool always)

More information about the OvmsDev mailing list