External control of BruControl settings
I am working on an application to read the BruControl log files and submit target and temperature readings to my website brewerschronicle.com. I have a rough prototype working and this part is working well.
I was poking around the BruControl brucfg files and found the Target setting for the Hysteresis element. Updating this does not pass the value through to BruControl. Closing BruControl overwrites the file value with BruControl's value.
If I change the setting value in the file with BruControl closed down, then it reads the new value from the file on starting up.
Can you suggest a way for my application to modify the target value for the hysteresis element? 😀
So I've done some more work on extracting information from BruControl log files in the Data directory.
It seems that BruControl only writes content out to the csv files when file read/write access is attempted.
My FileSystemWatcher.OnChanged events are never fired until I try to open one of the files in Excel, Notepad, etc.
So I've now written a Timer event which runs every 30 seconds which tries to open the files in read/write mode and swallows the expected "file is locked" exception. This forces a write of log entries to the csv files and my FileSystemWatcher.OnChanged event handler is triggered.
Is this expected behaviour, or am I using FileSystemWatcher incorrectly? I haven't used it before.
This is not a complaint, or a request to change the behaviour. It's more just a note for anybody else that is trying to analyse the data files
So as a further update: the latest entries in the log file were from 4:12PM.
The file was not actually updated until 4:26PM, but it did contain all the entries between 4:12 and 4:26
Given that BruControl is controlling the temperatures and this is only for logging purposes, it's probably not a big deal for me.
But if at some stage I wanted to run real-time processes based on logged values, that delay wouldn't be ideal.
yeh, I see this as an interim measure until querying data or http post and gets are available in BruControl scripting.
Like I said before, I'm not too bothered about the logs and certainly don't see it as a problem that needs fixing. This is more an FYI in case other people try to use logs for analysis.
So more as a record to myself, but maybe there are others who want to inspect the log files.
I noticed the "Date Modified" date on the log file for my "target temp" inspector (which is set from hysteris element target in script) was regularly updated with every reading, but the "Date Modified" value for the DS18B20 device's log file was not being regularly updated.
So I created a new variable "Ferm1Temp" which reads value from DB18B20 device in script. This log file is regularly updated (like my target variable).
Now the HTTP posts from my intermediate application are working correctly and regularly.
I have a nice grid listing relevant script elements which are read from the selected BruControl config file. A list of active ferments is drawn from my website via API, and displayed as a list of choices to select from.
Peter, this is some cool software you are developing. it's been a pleasure tearing the config file apart, and working out how to log readings.