Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDM 72D reboots if Modbus reads are too fast #50

Closed
DGrebe opened this issue Dec 14, 2020 · 3 comments
Closed

SDM 72D reboots if Modbus reads are too fast #50

DGrebe opened this issue Dec 14, 2020 · 3 comments

Comments

@DGrebe
Copy link

DGrebe commented Dec 14, 2020

Hi reaper7

Thanks for this great library and the examples.

I am working with SDM 120C & SDM72D. With the SDM 120C requests can be done without any delay. When I try the same with SDM72D the energy meter reboots after 1 or 2 requests, so that the transmission of more than 1 measure in the read intervall does not work stable. I got it stabilized by putting a delay of 500 ms after the sdm.readVal request.

I am using the example "sdm_live_page_esp8266_hwserial.ino" with a swapped hwSerial on pins 13/15. I had made the same experiences with ESPeasy using the SDM plugin (testing)

Has anybody else made similar experiences or is something wrong with the energy meter SDM72D.
In my experimental setup I have just connected L1 and N to 230V. I have not tried it with 3 phases.

I want to bring ESPeasy to work with the SDM 72D and are willing to port the new SDM library to the ESPeasy framework.
So far it is still using the old SDM lib with the separate constants for the different energy meters.

Regards

Dirk

sdm_live_page_esp8266_hwserial.ino.txt

@reaper7
Copy link
Owner

reaper7 commented Dec 16, 2020

this is very strange behavior in a professional device...even if the next query comes too early, it should answer with an error or not answer at all but not reboot itself ...
Generally your observations are correct....
Modern devices have no problem with faster reading of subsequent parameters,
but in the assumptions of the modbus protocol there are time requirements for subsequent readings.

readVal procedure is assumed to read one value,
so i won't add any delay there (I need to think about it)
however, I can improve the examples to add a delay even in the loop reading.
but what delay value? 500ms? 1000ms :)
my SDM220 is read in a loop without any delay and it doesn't even cause errors and reboots...

Please read this:
https://ctlsys.com/support/modbus_message_timing/
or this: https://www.modbus.org/docs/Modbus_over_serial_line_V1.pdf (side 10)

one thing is for sure - this library does not contain the correct modbus protocol implementation
was designed to read my meter and it does it properly :D

EDIT: I'll probably use the flush routine to reading garbage responses and use this time as the interval time for the next reading

reaper7 added a commit that referenced this issue Dec 16, 2020
and rename MAX_MILLIS_TO_WAIT to WAITING_TURNAROUND_DELAY
potential bug fix for #50
@reaper7
Copy link
Owner

reaper7 commented Dec 16, 2020

Try current master,
a definable parameter RESPONSE_TIMEOUT has been added (default 500ms)
This value can be changed by the user in the SDM_Config_User.h file

Not tested by me yet!

@DGrebe
Copy link
Author

DGrebe commented Jan 13, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants