Glitching again. #23736
Unanswered
kk02067
asked this question in
scripter / SML
Glitching again.
#23736
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello.
In april this year I hade problems with glithing values being sent from my tasmota based smart meter reader. That time I got a tip of changing the script from using pattern match to only using the pattern itself. That seemed to work but now the glitching is back. I see glitching values in homeassistant. And it's not only in total power, it's in the voltage and current also. I looked at my design and adjusted a resistor value. I checked the edges of the serial stream with a oscillocope and they are crisp and clear. Checked the supplyvoltage of the esp and that is stable as well. I changed my meter definition in the script to decode a lot more bytes in the buffer before reading the actual values. The definition now looks like this,
1,7ex60xx4d41333034483406xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx090cxxxxxxxxxxxxxxxxxxxxxxxx06UUuuUUuu@1,Total Effekt,Wh,Wh,0
1,7ex60xx4d41333034483406UUuuUUuu@1,Aktuell Effekt,W,W,0
1,7ex60xx4d41333034483406xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06UUuuUUuu@1000,Ström L1,Ampere,L1A,3
1,7ex60xx4d41333034483406xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06UUuuUUuu@1000,Ström L2,Ampere,L2A,3
1,7ex60xx4d41333034483406xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06UUuuUUuu@1000,Ström L3,Ampere,L3A,3
1,7ex60xx4d41333034483406xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06UUuuUUuu@10,Spänning L1,Volt,L1V,1
1,7ex60xx4d41333034483406xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06UUuuUUuu@10,Spänning L2,Volt,L2V,1
1,7ex60xx4d41333034483406xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06UUuuUUuu@10,Spänning L3,Volt,L3V,1
1,7ex60xx4d41333034483406xxxxxxxx06xxxxxxxx06xxxxxxxx06UUuuUUuu@1,Aktuell reaktiv effekt,VA,VAr,0
1,7ex60xx4d41333034483406xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx06xxxxxxxx090cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx06xxxxxxxx06xxxxxxxx06UUuuUUuu@1,Total reaktiv effekt,VAh,VArh,0
Still I get glitching values. An example is reading the voltage from phase 1 "L1V" should be around 232.2 V at the time of the glitch. But in Homeassistant there is a recording of 1 624 177 72.2 volts. If it was dependent of a single bit being read wrong from the serial stream it should not be that big of a difference. In this case the data should fit in the lower two bytes but the glitch uses the full four bytes. And the odds of getting the compare match correct for the voltage but the value wrong with som many bits seems a bit odd to me.
Below is a complete frame of data. It comes from the meter every 10 seconds . This data is correct as I have checked it against the CRC that are the 88 b0 at the end. The starting and ending 7e are not part of the crc calculation.
09:59:00.439 : 7e a0 9a 01 00 01 10 12 10 e6 e7 00 0f 40 00 00 00 09 0c 07 e9 04 01 02 0a 3b 00 ff ff c4 00 02
09:59:00.586 : 12 09 07 4b 46 4d 5f 30 30 31 09 10 37 33 34 30 31 35 37 30 33 30 35 31 38 34 36 34 09 07 4d 41
09:59:00.733 : 33 30 34 48 34 06 00 00 02 d0 06 00 00 00 00 06 00 00 00 00 06 00 00 00 86 06 00 00 07 71 06 00
09:59:00.880 : 00 05 92 06 00 00 02 02 06 00 00 09 35 06 00 00 09 38 06 00 00 09 35 09 0c 07 e9 04 01 02 0a 3b
09:59:01.044 : 00 ff ff c4 00 06 01 ff 65 68 06 00 00 00 00 06 00 01 fd 12 06 00 6b 58 29 88 b0 7e
I am starting to think there is a problem of cpu time. The decoding of the data takes to long and the buffer starts to shift when the value is still being read? Or is it the the value being corrupted before being sent at teleperiod?
Beta Was this translation helpful? Give feedback.
All reactions