openv / vcontrold

:fire: vcontrold Daemon for control and logging of Viessmann® type heating devices
https://github.com/openv/openv/wiki
GNU General Public License v3.0
101 stars 54 forks source link

Use an iterative method for expanding commands now #90

Open dirkbaechle opened 2 years ago

dirkbaechle commented 2 years ago

This merge request switches the methods "expand, buildByteCode and compileCommand" to using an iterative approach. I understand that the recursive approach used so far, looks more elegant at first glance. But it can give problems in the form of segfaults (see background story below) when trying to parse and process a large number of commands from a config file. Switching to an iterative method introduces the "*All" wrapper methods to the source base (not so nice), but makes the overall process of parsing commands more robust (very nice).

Background: I'm currently starting to use vcontrold/vclient for monitoring and controlling my Vitodens200 (WBC2). Since I still don't know a few of the memory addresses, I wrote a Python script that can generate a "special" vito.xml. In this vito.xml I will define a single command "getVitoXXXX" for each address in a configurable range (see create_shell.py and create_vito.py in "scripts" folder of https://github.com/dirkbaechle/pyvctrl ). By checking all memory addresses before and after I changed the wanted values at the Vitodens200 directly, I can then do a simple diff to find the memory addresses by brute-force. When starting the vcontrold daemon with a vito.xml file for the addresses 0x2000-0x4000 (yes, that's a lot) the process crashes on my mini laptop (Samsung EE PC, 32bit, 2GB RAM, Linux Mint 19.3). With the code from this branch vcontrold is running fine...

speters commented 1 year ago

Thx, Dirk! Please excuse the late reply. I hope to find some time to have a look at this in the next few days.

speters commented 1 year ago

I would like to get this merged, but still had no feedback from other testers, as this does quite some alterations under the hood.

To whom it might concern: Please give this a try and provide some feedback.