Scripter smart meter interface addresses limit of 511 chars. #22034
-
PROBLEM DESCRIPTIONI'm trying to read more than 70 adresses using modbus in the smart meter interface (sensor53). Still, after around 54 variables read the dump(sensor53 d1) in the console, the behavior of the script is to skip to the first address again, i've noted that measuring the lenght of the line to the last address that work before the skip sums to 511 chars. I've found a post that said that rules were implemented in 511 chunks, so i think this is a limitation in the implementation of the scripter code in xdrv_10_scripter.ino. Still, i couldn't find a variable that define a memory allocation of this size. Coud @gemu2015 , @ascillato2 , and @Jason2866 help me with this? i think it's just a case of resizing a buffer and recompiling my code. REQUESTED INFORMATIONMake sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Configuration output here:
{"NAME":"ESP32-DevKit","GPIO":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,1,1,0,0,1],"FLAG":0,"BASE":1}
STATUS 0 output here:
Console output here:
after applying the command sensor53 d1 the folloing happens
23:58:01.634 > 02 03 07 dc 00 02 04 b6
23:58:01.736 > 02 03 0f a6 00 02 27 0f
23:58:01.836 > 02 03 0f ae 00 02 a6 cd
23:58:01.938 > 02 03 0f be 00 02 a7 08
23:58:02.037 > 02 03 0f c6 00 02 27 11
23:58:02.136 > 03 03 03 e8 00 02 45 99
23:58:02.236 > 03 03 03 ea 00 02 e4 59 <--- this one is the last requested address that works. after this
23:58:02.336 > 00 02 80 71 <--- After that, this happens like it was accessing an illegal address
23:58:02.436 > 01 03 03 e8 00 02 44 7b <---And it restart to the first address requested.
TO REPRODUCEuse more than 511 chars in the line of the meter definition and the address after the 512 char will not be sent. EXPECTED BEHAVIOURthe buffer of addresses should work with an unlimited number of addresses of course maintaining within the limitations of memory. SCREENSHOTSIf applicable, add screenshots to help explain your problem. ADDITIONAL CONTEXTAdd any other context about the problem here. (Please, remember to close the issue when the problem has been addressed) |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 8 replies
-
Download |
Beta Was this translation helpful? Give feedback.
-
simply spread addresses over more lines (is supported) |
Beta Was this translation helpful? Give feedback.
-
Hi @gemu2015 thanks for your reply, i sorry but when i try to spread the addresses over the other lines bellow the first one, the interpreter simply ignores the adresses after the new line. 07:38:20.657 > 01 03 07 da 00 02 e4 84 This is the dump when trying to spread the addresses after the 02 03 03 e8 request , the only diference that i noted is that when i leave the comma in the end of the first line, it create the artifact 00 02 80 71, and when i dont leave the comma in the end the artifact dont apear. If this feature is supported what could be happening? i will leave the part of the code with the addresses bellow.
|
Beta Was this translation helpful? Give feedback.
-
hi @gemu2015 i tried without the comma, in the first line, with comma in the begining second line, and by last without comma in the begining of the second line all resulted in the same output. I've looked in the sensor53 file, and found the part of the code where you store the addresses to be sent. while (*txp) { using comma in the end of the line should end in the first case, that causes a break and without the , in the end it also breaks , Shouldn't one of the options pass and continue the loop in the next line? |
Beta Was this translation helpful? Give feedback.
-
@gemu2015 just to let you know. it worked perfectly with more than 511 chars and spread over multiple lines. all address were correctly decoded. @arendst thanks for the awesome work you, gemu and the rest of the tasmota team has been doing. I think this mod will be a great PR to the project. |
Beta Was this translation helpful? Give feedback.
-
Hey @gemu2015 and @arendst , just want to know, do you want me to do a PR of this file that gemu posted here? or you prefer to PR the file? is just that it would be my first time doing a PR in tasmota. |
Beta Was this translation helpful? Give feedback.
i completely recoded the TX fetch section and now it will collect up to 1024 (configurable) chars of TX code spread over several lines when ending with a comma.
try with this source and report if this works for you now.
xsns_53_sml.ino.zip