I researched a bit on the ComfoAir binding to reduce the CPU consumption and added the known RXTX serial optimization. I also add smaller changes to prevent unlimit thread growth (theoretically) and remove the flush() function.
Add CPU workaround for RXTX event listener thread
Remove flush() function, not required and sometimes the binding hangs there
Use ScheduledExecutorService instead of creating new Threads with Thread.sleep(…)
I’m struggling for ages with this binding - don’t get it running
Are your changes already integrated into v1.8.2? If not can you pls send me a download link to your latest jar file?
Within the next days I can test a lot and give you feedback.
I’ve created a new version of this modified binding. The old version worked well with version 1.8.x, now I’ve ported the changes to the newest code base. So it works in openHAB 1.x and 2.x.
I’ve installed your improved binding yesterday on my openhab 1.x system. So far it’s running without any problems! Thank you very much. If I’ll come across something, I’ll let you know.
After running for about 3 days, I just noticed that the binding logged errors in openhab.log:
Error writing to serial port ...
(many log entries per second).
Please note that the comfoair unit is not connected directly to the machine running openhab. It is connected to a raspberry and I am accessing it via a virtual serial port from openhab (I use ser2net on the rpi and socat on the machine running openhab). Anyway, I do not think that this actually caused the problem, since another service using the same setup and connected to the same raspberry continued to work.
I tried to do reload the comfoair binding with
Mh, not good. Maybe the removed flush command is missing on your setup and maybe this flush command is depended on the used serial driver (ser2net vs. ftdi usb serial converter) on operating system level.
Hey there, short update…
I have installed the version with flush, added more logging and disabled automatic restarts from monit. Again I have seen the same error messages, but this time I have seen that the socat instance running on the openhab machine crashed (so actually there was no longer a virtual serial port to talk to). So it is obvious why the binding generated the error messages.
I have no idea why socat crashed (I am using the same setup for the DSMR binding and this has been running without problems for ages).
Anyway, I have installed your first binding again (without flush) and I am trying to troubleshoot the virtual serial port issue further. The binding itself is running perfectly.
Do you still need testers or is your version already the one available with openhab2 download? I got error messages with the current openhab2 binding - does it make sense to test your binding on a comfoair 550?