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? 😀
Per our exchange, we are discussing ways to enable external communication with BC. This is a next stage development, and we are working on publishing 1.1, so it will take a bit of time. Stay tuned!
Cool, I'll just work on reading logs and submitting readings to my website as an interim step.
On a side note. I've got 1.1 installed and I'm using it. I haven't discovered any problems yet.
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.
We need to give you the ability to query data to and from BC. That will solve your problem!
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.
That's cool! I appreciate your efforts extending the software!
That said... maybe don't put too much more work in. I think we have something imminent to help you...
This is probably all I'm going to do.
My commercial install will be going in later this month, so I just wanted to be guaranteed I had some form of communication between BruControl and Brewers Chroncile from the start.