Replies: 4 comments 10 replies
-
|
Hi I don't understand what you mean with your second question. The "not talking to heater" part happens when there has been no recent room temperature received. WiFiVototrol then refuses to talk to the heater which causes an error on the heater and might revert it to another mode such as outside temperature lead control (depending on heater). So, if there are bytes available in loop it will loop through serialLoop. If a message valid message is read it will check if any datapoint is preventing communication with the heater and will not proceed if so. |
Beta Was this translation helpful? Give feedback.
-
|
Thx for your answed. if (preventCommunication()) { leaves me stuck with a down link state. Regards |
Beta Was this translation helpful? Give feedback.
-
|
I understand the reason to prevent communication during actual behaviour. But my issue is on the very first exchange when the heater sends a request to ESP32 to get ils serial number. |
Beta Was this translation helpful? Give feedback.
-
|
OK Chris But as my understanding the preventCommunication test is at the start of serialLoop. void serialLoop() { |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Chris,
Two questions are bothering me.
First
serialLoop() is invoked from loop() with while (ModbusSerial.available()) serialLoop().
So when we enter serialLoop there’s always at least one byte read from modbus.
This code section is never executed, right ?
if (!ModbusSerial.available() && (millis() - lastSerialLoop) < 1000) {
// only run serialLoop if there is new data or last run was 1 sec ago
return;
}
Second
Suppose now, as this is my case, that preventCommunication() returns true. As ModbusSerial.available() returns true wasAvail will be set to true leading to leave serialLoop and getting stuck to "not talking to heater" ?
Thx for your help
Beta Was this translation helpful? Give feedback.
All reactions