From 4f108e05045d9a88685647cbdf2e3e56fcb58b51 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Sun, 14 Jun 2020 12:07:12 +0200 Subject: [PATCH] fix sml modbus raw mode --- tasmota/xsns_53_sml.ino | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasmota/xsns_53_sml.ino b/tasmota/xsns_53_sml.ino index cb51bcc82..18fd53bf5 100755 --- a/tasmota/xsns_53_sml.ino +++ b/tasmota/xsns_53_sml.ino @@ -2405,12 +2405,13 @@ void SML_Send_Seq(uint32_t meter,char *seq) { if (!rflg) { *ucp++=0; *ucp++=2; + slen+=2; } // append crc - uint16_t crc = MBUS_calculateCRC(sbuff,6); + uint16_t crc = MBUS_calculateCRC(sbuff,slen); *ucp++=lowByte(crc); *ucp++=highByte(crc); - slen+=4; + slen+=2; } if (script_meter_desc[meter].type=='o') { for (uint32_t cnt=0;cnt