Monitor and control Daikin/Rotex (hybrid/Altherma) heat pumps via the 2-wire P1/P2 thermostat interface with an ATmega328P, ESP8266, and electronics. The P1P2Serial library and P1P2Monitor program perform low-level bus operation, the P1P2-bridge-esp8266 program interprets data from/to MQTT supporting Home Assistant MQTT discovery. P1P2Serial may also be used for other Japanese Home Bus System based standards: DIII-NET (F1/F2) bus, Mitsubishi M-Net bus, Toshiba TCC-Link, Hitachi H-link, Panasonic/Sanyo SIII-Net, Haier, York, and others.
Hi Arnold,
hope you are OK and healthy.
I changed serial read in P1P2Monitor.ino to make it non-blocking. Existing functionality retained. My changes:
split void loop () into separate functions
create new function void recvSerial() (as a substitute for int timedRead() and size_t readBytesUntilIncluding)
new non-blocking recvSerial() terminates either by SERIAL_TIMEOUT or by SERIAL_TERMINATOR \n, buffer includes SERIAL_TERMINATOR
The pull request is a bit mess, I have hit autoformat in Arduino IDE which added indentation. Let me know if it is a problem and I will make new pull request.
I also made few global variables, but I am not sure whether all of them have to be global.
Hi Arnold, hope you are OK and healthy. I changed serial read in P1P2Monitor.ino to make it non-blocking. Existing functionality retained. My changes:
The pull request is a bit mess, I have hit autoformat in Arduino IDE which added indentation. Let me know if it is a problem and I will make new pull request.
I also made few global variables, but I am not sure whether all of them have to be global.