Fix: Do not resend fetch limit request if the last one failed

Due to side effects it is possible that the inverter receives the request but the DTU does not receive the answer. In this case the DTU would resend the request but the inverter would generate a event log entry (DTU command failed) because it received the message twice.
This commit is contained in:
Thomas Basler 2023-09-05 22:09:16 +02:00
parent ec9af886d5
commit 1acefd8b8c

View File

@ -64,8 +64,7 @@ void HoymilesClass::loop()
iv->sendAlarmLogRequest(force); iv->sendAlarmLogRequest(force);
// Fetch limit // Fetch limit
if ((iv->SystemConfigPara()->getLastLimitRequestSuccess() == CMD_NOK) if (((millis() - iv->SystemConfigPara()->getLastUpdateRequest() > HOY_SYSTEM_CONFIG_PARA_POLL_INTERVAL)
|| ((millis() - iv->SystemConfigPara()->getLastUpdateRequest() > HOY_SYSTEM_CONFIG_PARA_POLL_INTERVAL)
&& (millis() - iv->SystemConfigPara()->getLastUpdateCommand() > HOY_SYSTEM_CONFIG_PARA_POLL_MIN_DURATION))) { && (millis() - iv->SystemConfigPara()->getLastUpdateCommand() > HOY_SYSTEM_CONFIG_PARA_POLL_MIN_DURATION))) {
_messageOutput->println("Request SystemConfigPara"); _messageOutput->println("Request SystemConfigPara");
iv->sendSystemConfigParaRequest(); iv->sendSystemConfigParaRequest();