[Ovmsdev] V3 progress

Tom Parker tom at carrott.org
Wed Oct 11 13:52:17 HKT 2017

On 11/10/17 13:02, Mark Webb-Johnson wrote:
> Tom,
> I think your problem is sdkconfig. That has settings for partition table, fat filesystem, and timer task stack size; all three of your issues.
> Can you try to diff your sdkconfig against sdkconfig.default (which contains all the custom settings)? Or just copy sdkconfig.default over your sdkconfig, and then adjust appropriately for what you need custom? You’ll need to ‘make menuconfig’ to confirm things, then I suggest ‘make clean’ and ‘make flash’ to flash everything (partition table, bootloader, etc).

That worked! My sdkconfig was quite far from the default.

Your untested scripts recommendation didn't work as they need to be 
stored in the events directory, this works:

vfs mkdir /store/events
vfs mkdir /store/events/system.start
vfs append "wifi mode client <ssid>" /store/events/system.start/startmeup
vfs append "vehicle module NL" /store/events/system.start/startmeup
vfs mkdir /store/events/network.up
vfs append "server v2 start" /store/events/network.up/startmeup

With these in place I get a reboot loop:

I (5822) event: ip:, mask:, gw:
I (5822) ovms-mdns: Launching MDNS service
I (5832) script: Running script /store/events/network.up/startmeup
Launching OVMS Server V2 connection 
(vPortFreeTagged)- assert failed!
abort() was called at PC 0x40085f8f on core 1
0x40085f8f: vPortFreeTagged at 

Backtrace: 0x40088680:0x3ffebe80 0x4008877f:0x3ffebea0 
0x40085f8f:0x3ffebec0 0x40088cd1:0x3ffebee0 0x40081f89:0x3ffebf00 
0x4000bec7:0x3ffebf20 0x400eff2a:0x3ffebf40 0x400eff54:0x3ffebf70 
0x40088680: invoke_abort at 
0x4008877f: abort at /home/ubuntu/esp/esp-idf/components/esp32/./panic.c:519
0x40085f8f: vPortFreeTagged at 
0x40088cd1: vPortFree at 
0x40081f89: _free_r at 
0x400eff2a: _ZN11OvmsConsole7ServiceEv at 
0x400eff54: _ZThn296_N11OvmsConsole7ServiceEv at ??:?
0x400efcc0: _ZN8TaskBase4TaskEPv at 


If I remove the network.up/startmeup file (the file that starts the v2 
server client) then it starts up ok and when I start the v2 client 
manually, it connects to the v2 server and everything works. I tried 
using the ticker.60 event and got the same crash so it's not a race 
condition with the wifi startup.

The cause is a double free by the looks of it, and if I comment out the 
writer->puts called in the v2 server start function, things work:

diff --git 
index 106269e..d1ee797 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
@@ -515,7 +515,7 @@ void ovmsv2_start(int verbosity, OvmsWriter* writer, 
OvmsCommand* cmd, int argc,
    if (MyOvmsServerV2 == NULL)
-    writer->puts("Launching OVMS Server V2 connection (oscv2)");
+    // writer->puts("Launching OVMS Server V2 connection (oscv2)");
      MyOvmsServerV2 = new OvmsServerV2("oscv2");

The ESP_LOGI in OvmsServerV2::OvmsServerV2 also gets called, in this 
code path but doesn't need to be commented out.


More information about the OvmsDev mailing list