<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I think the approach you propose sounds like a nice solution.<div class=""><br class=""></div><div class="">BTW: I’ve sent a pull request with the latest version of Kia Soul module. <div class=""><br class=""></div><div class="">Geir<div class=""><div class=""> <br class=""><div><br class=""><blockquote type="cite" class=""><div class="">12. des. 2017 kl. 02:29 skrev Mark Webb-Johnson <<a href="mailto:mark@webb-johnson.net" class="">mark@webb-johnson.net</a>>:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">I’ve had lwip pppos (via SIMCOM) running on my desk overnight, and it seems stable. Of course, we’ll need to do some fine tuning based on feedback in the field, but at least PPP connections can be brought up and down cleanly, and that is the base capability needed for more sophistication to be built on top.</div><div class=""><br class=""></div><div class="">The OVMS v2 client code also seems good. With DEMO car, it is not producing too much data, and seems roughly comparable to v2 usage.</div><div class=""><br class=""></div><div class="">For example, here is the start of one of my recent sessions (log level info):</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (17600) simcom: State: Enter PoweringOn state</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (17600) simcom: Power Cycle</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (23660) simcom: State: Enter PoweredOn state</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (42770) simcom: State: Enter MuxStart state</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (42770) gsm-mux: Start MUX</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (42780) gsm-mux: Channel #0 is open</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (42780) gsm-mux: Channel #1 is open</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (42790) gsm-mux: Channel #2 is open</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (42800) gsm-mux: Channel #3 is open</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (42810) gsm-mux: Channel #4 is open</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (43750) simcom: State: Enter NetWait state</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (53830) simcom: CREG Network Registration: RegisteredRoaming</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (54750) simcom: State: Enter NetStart state</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (55890) simcom: PPP Connection is ready to start</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (56750) simcom: State: Enter NetMode state</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (56750) gsm-ppp: Initialising...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (59770) gsm-ppp: StatusCallBack: None</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (59770) gsm-ppp: status_cb: Connected</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (59770) gsm-ppp: our_ipaddr = 10.52.223.8</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (59770) gsm-ppp: his_ipaddr = 10.64.64.64</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (59770) gsm-ppp: netmask = 255.255.255.255</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (59770) gsm-ppp: our6_ipaddr = ::</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (62570) ovms-server-v2: Status: Network connectivity established</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (62570) ovms-server-v2: Connection is <a href="http://api.openvehicles.com:6867/" class="">api.openvehicles.com:6867</a> TESTCAR/...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (63430) ovms-server-v2: Connected to OVMS Server V2 at <a href="http://api.openvehicles.com/" class="">api.openvehicles.com</a></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (63430) ovms-server-v2: Status: Connected to server</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (63440) ovms-server-v2: Status: Logging in...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (63440) ovms-server-v2: Sending server login: MP-C 0 ... ... TESTCAR</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (64030) ovms-server-v2: Received welcome response MP-S 0 ... ...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (64030) ovms-server-v2: Got server response: MP-S 0 ... ...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (64040) ovms-server-v2: Server token is ... and digest is ...</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (64040) ovms-server-v2: Status: Server auth ok. Now priming crypto.</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (64040) ovms-server-v2: Shared secret key is .../... (44 bytes)</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (64040) ovms-server-v2: Status: OVMS V2 login successful, and crypto channel established</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (64040) ovms-server-v2: Status: Connected and logged in</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (64050) ovms-server-v2: Send MP-0 S50,K,0,0,done,standard,200,160,0,0,0,0,13,4,0,0,0,0,160.00,0,0,0,0,-1,0,0,0,0,0,400,0,0.00,400.00,100</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (64050) ovms-server-v2: Send MP-0 D0,0,5,22,30,25,0,1000000,0,61,22,0,0,0,0,0,0,0,22,0</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (64060) ovms-server-v2: Send MP-0 L22.280869,114.160599,10,30,1,0,0,0,0.0,0,0</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (64070) ovms-server-v2: Send MP-0 W30,33,40,34,30,33,40,34,0</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (64080) ovms-server-v2: Send MP-0 F3.0.0/factory/main build (idf v2.1.1-8-g5ae2c0d0) Dec 12 2017 07:55:27,DEMODEMODEMO,9,1,DEMO,CMHK Jsy Tel</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (64100) ovms-server-v2: Incoming Msg: MP-0 Z0</span></font></div><div class=""><span style="font-size: 18px; font-family: "Andale Mono";" class="">I (665100) ovms-server-v2: Send MP-0 S50,K,0,0,done,standard,200,160,0,0,0,0,13,4,0,0,0,0,160.00,0,0,0,0,-1,0,0,0,0,0,400,0,0.00,400.00,100</span></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (665110) ovms-server-v2: Send MP-0 D0,0,5,22,30,25,0,1000000,0,662,22,0,0,0,0,0,0,0,22,0</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (665120) ovms-server-v2: Send MP-0 F3.0.0/factory/main build (idf v2.1.1-8-g5ae2c0d0) Dec 12 2017 07:55:27,DEMODEMODEMO,7,1,DEMO,CMHK Jsy Tel</span></font></div><div class=""><span style="font-size: 18px; font-family: "Andale Mono";" class=""><br class=""></span></div><div class=""><span style="font-size: 18px; font-family: "Andale Mono";" class="">OVMS > server v2 status</span></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">Connected and logged in</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class=""><br class=""></span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (1266130) ovms-server-v2: Send MP-0 S50,K,0,0,done,standard,200,160,0,0,0,0,13,4,0,0,0,0,160.00,0,0,0,0,-1,0,0,0,0,0,400,0,0.00,400.00,100</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (1266140) ovms-server-v2: Send MP-0 D0,0,5,22,30,25,0,1000000,0,1263,22,0,0,0,0,0,0,0,22,0</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (1266150) ovms-server-v2: Send MP-0 F3.0.0/factory/main build (idf v2.1.1-8-g5ae2c0d0) Dec 12 2017 07:55:27,DEMODEMODEMO,8,1,DEMO,CMHK Jsy Tel</span></font></div><div class=""><span style="font-size: 18px; font-family: "Andale Mono";" class=""><br class=""></span></div><div class=""><span style="font-size: 18px; font-family: "Andale Mono";" class="">OVMS > charge start</span></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">Charge has been started</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (1744160) ovms-server-v2: Send MP-0 S50,K,220,32,charging,standard,200,160,0,0,0,0,3,1,0,0,0,0,160.00,0,0,0,0,-1,0,0,0,0,0,400,0,-0.00,400.00,100</span></font></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (1744170) ovms-server-v2: Send MP-0 D28,0,5,22,30,25,0,1000000,0,1741,22,0,0,0,0,0,0,0,22,0</span></font></div><div class=""><span style="font-size: 18px; font-family: "Andale Mono";" class="">I (1867180) ovms-server-v2: Send MP-0 S51,K,220,32,charging,standard,200,160,0,2,0,0,3,1,0,0,0,0,160.00,0,0,0,0,-1,0,0,0,0,0,400,0,-0.00,400.00,100</span></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (1867190) ovms-server-v2: Send MP-0 D28,0,5,22,30,25,0,1000000,0,1864,22,0,0,0,0,0,0,0,22,0</span></font></div><div class=""><span style="font-size: 18px; font-family: "Andale Mono";" class="">I (2468200) ovms-server-v2: Send MP-0 S57,K,220,32,charging,standard,200,160,0,12,0,0,3,1,0,0,0,0,160.00,0,0,0,0,-1,0,0,0,0,0,400,0,-0.00,400.00,100</span></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (2468210) ovms-server-v2: Send MP-0 D28,0,5,22,30,25,0,1000000,0,2465,22,0,0,0,0,0,0,0,22,0</span></font></div><div class=""><span style="font-size: 18px; font-family: "Andale Mono";" class="">I (3069220) ovms-server-v2: Send MP-0 S63,K,220,32,charging,standard,200,160,0,22,0,0,3,1,0,0,0,0,160.00,0,0,0,0,-1,0,0,0,0,0,400,0,-0.00,400.00,100</span></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (3069230) ovms-server-v2: Send MP-0 D28,0,5,22,30,25,0,1000000,0,3066,22,0,0,0,0,0,0,0,22,0</span></font></div><div class=""><span style="font-size: 18px; font-family: "Andale Mono";" class="">I (3670240) ovms-server-v2: Send MP-0 S69,K,220,32,charging,standard,200,160,0,32,0,0,3,1,0,0,0,0,160.00,0,0,0,0,-1,0,0,0,0,0,400,0,-0.00,400.00,100</span></div><div class=""><font face="Andale Mono" class=""><span style="font-size: 18px;" class="">I (3670250) ovms-server-v2: Send MP-0 D28,0,5,22,30,25,0,1000000,0,3667,22,0,0,0,0,0,0,0,22,0</span></font></div></blockquote><div class=""><br class=""></div><div class="">That is one set of messages every 10 minutes (the numbers in brackets after the “I” seem to be millisecond timestamps).</div><div class=""><br class=""></div><div class="">So, now to think about how to manage this in general. To make it easier for the end user. Here are some notes/thoughts:</div><div class=""><br class=""></div><div class=""><ol class="MailOutline"><li class="">We continue to use events and scripting for fine-tuned control.<br class=""><br class=""></li><li class="">For configuration, we offer options to set values and have those automatically actioned at startup. Examples:</li><ul class=""><li class="">If a vehicle type is configured, then automatically start a vehicle module of that type.</li><li class="">If a v2 configuration is present, then automatically start a ovms server v2 connection.<br class=""><br class=""></li></ul><li class="">For networking, we have the network manager component. The idea here is to extend that to provide network link logic. Examples:<br class=""></li><ul class=""><li class="">If wifi comes up, then sleep the simcom modem</li><li class="">If wifi goes down, then wake up the simcom modem<br class=""><br class=""></li></ul><li class="">The above configuration settings can be simply mapped to v2 protocol features/parameters.<br class=""><br class=""></li><li class="">While Config parameters are currently registered and visible (MyConfig.RegisterParam), instances are not. That makes it tricky to see what config instances are available. In some of the code, we document the instances as comments after the parameter is registered. My suggestion here is to add a MyConfig.RegisterInstance to allow for instance registration (with a default value). If the instance does not exist, then it would be created with the value set as per the default. That would then make it visible to the user. The only downside to this is that the default value can’t later be changed.</li></ol></div><div class=""><br class=""></div><div class="">What do people think? Does that make sense as an approach? Implementation should not be difficult.</div><div class=""><br class=""></div><div class="">Regards, Mark.</div><div class=""><br class=""></div></div>_______________________________________________<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></blockquote></div><br class=""></div></div></div></div></body></html>