[Ovmsdev] chatty v2 server comms

Mark Webb-Johnson mark at webb-johnson.net
Sun Dec 24 16:02:05 HKT 2017


We should be able to cope with this without having to go back to CRC checksums. The modifier support was supposed to avoid that.

Using checksums isn’t going to help the metric-based protocols like MQTT and bluetooth GATT.

Can we extend OvmsMetric / OvmsMetricFloat to store a default precision (defined when the metric is created)? That is then used when accessing the metric as a string.

Regards, Mark

> On 19 Dec 2017, at 4:00 PM, Michael Balzer <dexter at expeedo.de> wrote:
> 
> Tom,
> 
> you're right, the unnecessary updates result from the high internal value resolution and it's reduction on the msg protocol.
> 
> If the SOC changes from 51.00 to 51.01 %, an "S" msg will be sent, although it (currently) only transports "51". Even if it would transport two decimal digits,
> there still could be fractional parts or float jitter, unless we restrict precision in the metrics itself and use that precision throughout all communications.
> 
> I think the best way to solve this is to use msg level CRC checking as V2 did.
> 
> Regards,
> Michael
> 
> 
> Am 19.12.2017 um 07:40 schrieb Tom Parker:
>> At least during charging this appears to be working better, 2 messages per minute for the  most part. I always have a client connected as my python client is
>> always connected waiting for messages.
>> 
>> These logs are with 63b87c3f46d5af9eaf49739aa3179c4d026aa3de + a hack to ignore changes in the ms_v_bat_12v_voltage metric (and also nissan leaf remote
>> control changes but they don't affect the telemetry). I'm ignoring the 12v because it appears to have only 3 decimal significant figures of signal and we're
>> monitoring changes on 3 additional significant figures of noise. The following are the values every minute while the car is charging the traction battery and
>> the 12v system is powered by the on board DC-DC.
>> 
>> 13.1374
>> 13.1923
>> 13.1813
>> 13.1264
>> 13.1209
>> 13.1978
>> 13.1044
>> 13.1154
>> 13.1538
>> 13.2418
>> 13.1593
>> 13.1813
>> 13.1484
>> 13.1813
>> 13.1374
>> 13.1813
>> 13.1813
>> 
>> It's probably worth storing and even transmitting 4 significant figures, as you can see trends in the noise much more clearly than the v2's 100mV steps, but
>> we shouldn't trigger notifications on the noise. We could also look at averaging or taking the median to increase the signal to noise ratio.
>> 
>> The full log below shows the few minutes as I arrived home and it connected to the wifi (gsm is too unstable to use) and then I plugged in and started charging.
>> 
>> 2017-12-19 05:09:33,21226,'#79 A got login'
>> 2017-12-19 05:10:01,21292,'#37 C got login'
>> 2017-12-19 05:10:01,21293,'#37 C rx msg S 50,K,0,0,stopped,standard,42,0,0,0,0,0,13,21,0,0,0,0,63.22,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,378.50,96'
>> 2017-12-19 05:10:01,21294,'#37 C rx msg D 128,0,5,0,0,27,0,70,0,460,21,1,1,1,12.5934,0,0,0,0,0'
>> 2017-12-19 05:10:02,21295,'#37 C rx msg L 0,0,0,0,0,0,0,0,0,0,0'
>> 2017-12-19 05:10:02,21296,'#37 C rx msg W 0,0,0,0,0,0,0,0,0'
>> 2017-12-19 05:10:03,21297,'#37 C rx msg F 3.0.0/factory/main build (idf v2.1-20-g88ab5d4) Dec 18 2017 09:50:21,,0,1,NL,redacted'
>> 2017-12-19 05:10:03,21298,'#37 C rx msg S 50,K,0,0,stopped,standard,42,0,0,0,0,0,13,21,0,0,0,0,63.22,0,0,0,0,-1,0,0,0,0,0,0,0,0.00,378.50,96'
>> 2017-12-19 05:10:03,21299,'#37 C rx msg D 128,0,5,0,0,27,0,70,0,460,21,1,1,1,12.5934,0,0,0,0,0'
>> 2017-12-19 05:10:04,21300,'#37 C rx msg L 0,0,0,0,0,0,0,0,0,0,0'
>> 2017-12-19 05:10:04,21301,'#37 C rx msg W 0,0,0,0,0,0,0,0,0'
>> 2017-12-19 05:10:05,21302,'#37 C rx msg F 3.0.0/factory/main build (idf v2.1-20-g88ab5d4) Dec 18 2017 09:50:21,,0,1,NL,redacted'
>> 2017-12-19 05:10:22,21360,'#37 C rx msg S 50,K,511,0,charging,standard,42,0,17,0,0,0,3,1,0,0,0,0,63.22,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,511.50,96'
>> 2017-12-19 05:10:22,21361,'#37 C rx msg D 156,0,5,0,0,27,0,70,0,477,22,1,1,1,12.6758,0,0,0,0,0'
>> 2017-12-19 05:10:23,21362,'#37 C rx msg S 50,K,378,0,charging,standard,42,0,10,0,0,0,3,1,0,0,0,0,63.22,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,378.50,96'
>> 2017-12-19 05:10:23,21363,'#37 C rx msg S 50,K,378,0,charging,standard,42,0,10,0,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,378.50,96'
>> 2017-12-19 05:10:24,21364,'#37 C rx msg S 50,K,378,0,charging,standard,42,0,10,0,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,378.50,96'
>> 2017-12-19 05:10:27,21372,'#37 C rx msg S 50,K,378,0,charging,standard,42,0,10,0,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,378.50,96'
>> 2017-12-19 05:11:19,21481,'#37 C rx msg S 50,K,379,5,charging,standard,42,0,10,0,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,379.50,96'
>> 2017-12-19 05:11:19,21482,'#37 C rx msg D 156,0,5,0,0,27,0,80,0,521,22,1,1,1,13.1044,0,0,0,0,0'
>> 2017-12-19 05:11:39,21537,'#37 C rx msg D 92,0,5,0,0,27,0,90,0,558,22,0,1,1,13.1374,0,0,0,0,0'
>> 2017-12-19 05:12:03,21599,'#37 C rx msg S 50,K,379,4,charging,standard,42,0,10,1,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,379.50,96'
>> 2017-12-19 05:12:03,21602,'#37 C rx msg D 92,0,5,0,0,27,0,90,0,582,22,0,1,1,13.1813,0,0,0,0,0'
>> 2017-12-19 05:13:04,21745,'#37 C rx msg S 50,K,380,4,charging,standard,42,0,10,2,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,380.00,96'
>> 2017-12-19 05:13:04,21746,'#37 C rx msg D 92,0,5,0,0,27,0,100,0,643,22,0,1,1,13.1648,0,0,0,0,0'
>> 2017-12-19 05:14:05,21870,'#37 C rx msg S 50,K,380,4,charging,standard,42,0,10,3,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,380.00,96'
>> 2017-12-19 05:14:07,21879,'#37 C rx msg D 92,0,5,0,0,27,0,110,0,704,22,0,1,1,13.1813,0,0,0,0,0'
>> 2017-12-19 05:15:13,22039,'#37 C rx msg S 50,K,380,3,charging,standard,42,0,10,4,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,380.50,96'
>> 2017-12-19 05:15:13,22040,'#37 C rx msg D 92,0,5,0,0,27,0,120,0,765,23,0,1,1,13.1593,0,0,0,0,0'
>> 2017-12-19 05:15:51,22142,'#15 A timeout due app due to inactivity'
>> 2017-12-19 05:15:54,22146,'#15 A got login'
>> 2017-12-19 05:16:07,22183,'#37 C rx msg S 51,K,380,5,charging,standard,42,0,10,5,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,380.50,96'
>> 2017-12-19 05:16:07,22184,'#37 C rx msg D 92,0,5,0,0,27,0,130,0,826,23,0,1,1,13.1813,0,0,0,0,0'
>> 2017-12-19 05:17:08,22324,'#37 C rx msg S 51,K,380,4,charging,standard,42,0,10,6,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,380.50,96'
>> 2017-12-19 05:17:08,22325,'#37 C rx msg D 92,0,5,0,0,27,0,140,0,887,23,0,1,1,13.1813,0,0,0,0,0'
>> 2017-12-19 05:18:09,22450,'#37 C rx msg S 51,K,380,4,charging,standard,43,0,10,7,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,380.50,96'
>> 2017-12-19 05:18:12,22457,'#37 C rx msg D 92,0,5,0,0,27,0,150,0,948,23,0,1,1,13.1923,0,0,0,0,0'
>> 2017-12-19 05:19:10,22589,'#37 C rx msg S 51,K,380,4,charging,standard,43,0,10,8,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,380.50,96'
>> 2017-12-19 05:19:10,22590,'#37 C rx msg D 92,0,5,0,0,27,0,160,0,1009,23,0,1,1,13.1593,0,0,0,0,0'
>> 2017-12-19 05:20:11,22725,'#37 C rx msg S 51,K,381,4,charging,standard,43,0,10,9,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,381.00,96'
>> 2017-12-19 05:20:11,22726,'#37 C rx msg D 92,0,5,0,0,27,0,170,0,1070,23,0,1,1,13.1703,0,0,0,0,0'
>> 2017-12-19 05:21:12,22870,'#37 C rx msg S 51,K,381,4,charging,standard,43,0,10,10,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,381.00,96'
>> 2017-12-19 05:21:12,22871,'#37 C rx msg D 92,0,5,0,0,27,0,180,0,1131,24,0,1,1,13.1813,0,0,0,0,0'
>> 2017-12-19 05:22:13,22999,'#37 C rx msg S 51,K,381,4,charging,standard,43,0,10,11,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,381.00,96'
>> 2017-12-19 05:22:13,23001,'#37 C rx msg D 92,0,5,0,0,27,0,190,0,1192,24,0,1,1,13.1319,0,0,0,0,0'
>> 2017-12-19 05:23:14,23114,'#37 C rx msg S 52,K,381,4,charging,standard,43,0,10,12,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,381.00,96'
>> 2017-12-19 05:23:14,23115,'#37 C rx msg D 92,0,5,0,0,27,0,200,0,1253,24,0,1,1,13.1813,0,0,0,0,0'
>> 2017-12-19 05:24:15,23235,'#37 C rx msg S 52,K,381,4,charging,standard,43,0,10,13,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,381.00,96'
>> 2017-12-19 05:24:15,23236,'#37 C rx msg D 92,0,5,0,0,27,0,210,0,1314,25,0,1,1,13.2033,0,0,0,0,0'
>> 2017-12-19 05:25:16,23394,'#37 C rx msg S 52,K,381,4,charging,standard,43,0,10,14,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,381.00,96'
>> 2017-12-19 05:25:16,23395,'#37 C rx msg D 92,0,5,0,0,27,0,220,0,1375,25,0,1,1,13.1978,0,0,0,0,0'
>> 2017-12-19 05:26:17,23536,'#37 C rx msg S 52,K,381,5,charging,standard,44,0,10,15,0,0,3,1,0,0,0,0,63.13,0,0,0,0,-1,0,0,0,0,0,0,0,-0.00,381.50,96'
>> 2017-12-19 05:26:17,23538,'#37 C rx msg D 92,0,5,0,0,27,0,230,0,1436,25,0,1,1,13.2143,0,0,0,0,0'
>> 
>> _______________________________________________
>> OvmsDev mailing list
>> OvmsDev at lists.teslaclub.hk
>> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev
> 
> -- 
> Michael Balzer * Helkenberger Weg 9 * D-58256 Ennepetal
> Fon 02333 / 833 5735 * Handy 0176 / 206 989 26
> 
> 
> _______________________________________________
> OvmsDev mailing list
> OvmsDev at lists.teslaclub.hk
> http://lists.teslaclub.hk/mailman/listinfo/ovmsdev




More information about the OvmsDev mailing list