[Ovmsdev] V3 progress

Tom Parker tom at carrott.org
Sun Oct 22 18:40:06 HKT 2017

On 15/10/17 02:47, Mark Webb-Johnson wrote:
>  1. The #define in vehicle_nissanleaf.h

Should that go in the .h? Is the preprocessor namespace global in cpp, 
or if I stick it in the private section of the class, will it be a class 
private define? I'm thinking the former and I should prefix the names 
with NL or something?

>  1. Put back the ovmswriter puts on server startup (as Steve has fixed
>     that)
>  2. Put in a 60/600 second timer, for transmission of status messages

Thanks for fixing these up for me.

I've sent another pull request with expanded support for the v2 server 
messages, including a silly bug fix due to an errant semicolon.

I've also ported over some more of the v2 Leaf can bus decoding support, 
which led me to try to implement "car off" detection, which in v2 on the 
leaf was done by waiting for the can bus to go quiet. I bodged something 
together using a ticker and the staleness indicator on the car_on 
metric, but I think something better could be done in the core framework.

I've noticed that the wifi does not reconnect if it goes out of range. I 
made a terrible network manager to reconnect. It signals some events and 
I wrote some scripts to execute the relevant commands, mostly because I 
don't know how to directly execute a command.

The network.down event doesn't seem to be generated when the wifi goes 
down, but system.wifi.sta.disconnected is.

I found a very odd bug, if you make a script which calls a command that 
doesn't log anything, you get a crash in ovms_console.cpp. It took me 
quite some time to trace this to commands that don't log, because start 
and stop do log if they're called in the right order, but my terrible 
network manager would call start whenever the network came up which 
would die the second time because the v2 client is already running and 
doesn't log anything if you try to start it again.

In my terrible network manager branch I have worked around this by 
making the v2 server log even if it's already running or stopped but 
that obviously doesn't fix the underlying bug. It can be reproduced with 
the ticker event:

OVMS > vfs mkdir /store/events/ticker.10
OVMS > vfs append "server v2 stop" /store/events/ticker.10/tick
I (23885) script: Running script /store/events/ticker.10/tick
Guru Meditation Error of type LoadProhibited occurred on core  1. 
Exception was unhandled.
Register dump:
PC      : 0x400efb54  PS      : 0x00060f30  A0      : 0x800efc07 A1      
: 0x3ffe5220
0x400efb54: _ZN11OvmsConsole7ServiceEv at 

A2      : 0x3ffe200c  A3      : 0x00000000  A4      : 0x00010002 A5      
: 0x00000014
A6      : 0x00000008  A7      : 0x00000000  A8      : 0x800efb35 A9      
: 0x3ffe5200
A10     : 0x00000001  A11     : 0x3ffc13cc  A12     : 0x00000001 A13     
: 0x00000000
A14     : 0x3ffe2c2c  A15     : 0xff000000  SAR     : 0x0000001e 
EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000004  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6 LCOUNT  
: 0xffffffff

Backtrace: 0x400efb54:0x3ffe5220 0x400efc04:0x3ffe5250 0x400ef8b4:0x3ffe5270
0x400efb54: _ZN11OvmsConsole7ServiceEv at 

0x400efc04: _ZThn304_N11OvmsConsole7ServiceEv at ??:?

0x400ef8b4: _ZN8TaskBase4TaskEPv at 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20171022/b1775ec2/attachment.htm>

More information about the OvmsDev mailing list