BruControl: Brewery control & automation software

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
The decimal is for presentation. You need your script to evaluate a range, not an exact value.

You can do an else then another if:

if "This" Value == value2
//do something
else
if "that" Value3 == value4
//do another thing
endif
endif
 
The other day I had to redefine (or include across various sections) values as they were outside of the working section. I was under the impression I only needed to define a value at the beginning of the script. I was having issues with a loop and after including these values, it began to work again.

Can someone explain when the controller will hold these value as opposed to losing them?
 
The other day I had to redefine (or include across various sections) values as they were outside of the working section. I was under the impression I only needed to define a value at the beginning of the script. I was having issues with a loop and after including these values, it began to work again.

Can someone explain when the controller will hold these value as opposed to losing them?

A regular variable dies with the script or the program. It can only be used in its own script. You have to declare it with the "new" command . It will retain it's value until you change it as long as the script is running or you "delete" it. You can use it later in the same script. if in a looping script, I normally do my declarations once, prior to any looping. If the script stops, the variable dies.


I use global as they are static (until I change them) and they work across scripts. I only use the old variables for internal script math, I normally "store" the result in a Global . If you want to display the Global (variable), I use the Visibility property of the Global Element. They are "stored" even if you shut the computer down. It is my understanding they take no memory other than when you use them. You do not need any code that loops to display a Global,just a single line to display:

"MyGlobalElement" visibility = visible

The Global variables that I do not care to ever display are all on their own workspace that is simply a place holder for elements that I use but do not need to see. I have some timers that I use instead of a sleep command ( I am millisecond deficient). Some Alarms that sound once and then kill themselves, And quite a few of my Global Variables.

In fact I have a lot of globals on a recipe workspace with my Strike, Mash, and Hops etc. that I can quickly change before a brew and those are my "variables".
 
Can anyone provide any answer for my previous question? Does the esp8266 interface correctly implemented for pwm? Does it change the default 0-1023 value range to 0-255? Basically, if I use an esp8266 as an interface, does the pwm work as intended? In other words, is 255 = 100% on the esp8266 or is it 25%.
 
A regular variable dies with the script or the program. It can only be used in its own script. You have to declare it with the "new" command . It will retain it's value until you change it as long as the script is running or you "delete" it. You can use it later in the same script. if in a looping script, I normally do my declarations once, prior to any looping. If the script stops, the variable dies.


I use global as they are static (until I change them) and they work across scripts. I only use the old variables for internal script math, I normally "store" the result in a Global . If you want to display the Global (variable), I use the Visibility property of the Global Element. They are "stored" even if you shut the computer down. It is my understanding they take no memory other than when you use them. You do not need any code that loops to display a Global,just a single line to display:

"MyGlobalElement" visibility = visible

The Global variables that I do not care to ever display are all on their own workspace that is simply a place holder for elements that I use but do not need to see. I have some timers that I use instead of a sleep command ( I am millisecond deficient). Some Alarms that sound once and then kill themselves, And quite a few of my Global Variables.

In fact I have a lot of globals on a recipe workspace with my Strike, Mash, and Hops etc. that I can quickly change before a brew and those are my "variables".
Thankyou for the explanation but I'm having to continually "call" a portion of my script (which contains the new values) within each respective section. If I keep the new values outside of these sections it no longer works. Not sure why.
 
I have an inspector element setup to tell what type of alarm is activated. Is it possible to send this information along with the email?
 
Can anyone provide any answer for my previous question? Does the esp8266 interface correctly implemented for pwm? Does it change the default 0-1023 value range to 0-255? Basically, if I use an esp8266 as an interface, does the pwm work as intended? In other words, is 255 = 100% on the esp8266 or is it 25%.

Sorry... will need to test and report back.
 
ESP8266 pwm function is 10 bits wide (as opposed to 8-bit Arduino) so some conversion is likely necessary if the original code was Arduino-centric...

Cheers!
 
I would like to bump the request for the option to hard code 1-wire sensor hardware addresses into BruControl once detected... I think i had a sensor fail, and not sure which one, but one of the lower numbered ones... if I could hard code them it would show instantly, even after a power reset, and I could replace it or perform a quick workaround in the script on a single device... Now would have to go in and change 6 or 7 of the index offsets.... Even to determine which is defective is difficult, as many or them are in liquid or hard to reach places, so pulling it out and using a lighter or ice cube are not possible without a lot of work...
 
I would request that any new "graphic" element be able to go down to 1 pixel size. I created some "flowing" pipes using Globals and backgrounds, but they are to high to be useful. Also a transparent property would be nice.
 
spending the entire morning remotely trying to explain to the operator how musical chairs works with 1-wire temp probes... I have RTD's and ESP32's ready to replace most of them once working RTD software is available for the ESP32.
 
Thankyou for the explanation but I'm having to continually "call" a portion of my script (which contains the new values) within each respective section. If I keep the new values outside of these sections it no longer works. Not sure why.

I rarely use an old variable as I generally like to see my variables. I thought the inspector was sort of clunky as it required the loop. If you switch your variables to Global Elements, you can use them in any section in any script. It may be how and when you are declaring the variables that they are "section" only. I do not think that would be a "normal" attribute, and I have not run into that issue. However, I use the old variables for some internal script math (such as to figure an offset from a strike Global) only, so I am not calling them often.


Here is an example of a lot of Globals that I use in scripts for a particular brew. I am hoping to transfer most of these from a stored file as I know that you can do that, I just do not know how yet. I know there are threads about Beer Smith imports. Some are just names and amounts that I use in screen messages, but some are used to trigger an alarm or advance a script. We tend to do the same brews on a repetitive basis.
glabals.png


By having these as Globals, I can quickly change or review things I need to know for a brew, rather than going into and editing a script for a Mash Temp, for example.

I plan to create a separate Fermentation Configuration or Workspace in the near future with different Global Variables such as Fermentation Temps and Glycol Temp Values.
 
I would like to bump the request for the option to hard code 1-wire sensor hardware addresses into BruControl once detected... I think i had a sensor fail, and not sure which one, but one of the lower numbered ones... if I could hard code them it would show instantly, even after a power reset, and I could replace it or perform a quick workaround in the script on a single device... Now would have to go in and change 6 or 7 of the index offsets.... Even to determine which is defective is difficult, as many or them are in liquid or hard to reach places, so pulling it out and using a lighter or ice cube are not possible without a lot of work...
I saw this and read the user manual. So, if you add a new sensor to your system it renumbers all of the sensors, or it one fails it does the same? In not sure why they did not use the hardware address instead of their index system. Or just tie to index to the hardware address. They should also support an external 1wire master device like the 2482 so the timing related constraint is a non-issue.
 
if one fails, it goes blank, but once you power reset, that failed one just disappears and all the ones with a higher HW address just move down a notch. Great for beginners, but even CBP lets you use a HW address.. I like printing the HW address with a labelmaker and wrapping it around the wire near the probe....
 
I would request that any new "graphic" element be able to go down to 1 pixel size. I created some "flowing" pipes using Globals and backgrounds, but they are to high to be useful. Also a transparent property would be nice.

Images that have transparency work with backgroubd. Tho an image on top of an image loses its transparency.
 
Finally got to testing with fermentation fridge. One thing I noticed is intermittent input dips with SPI sensor (pt100) Is this a symptom of EMI? Since my fridge is across the house I can’t really compare the dip to when the AC kicks on. Not sure what else would cause this...

This is what I’m using to convert the DC output for fridge control.

View attachment 652355
 
I rarely use an old variable as I generally like to see my variables. I thought the inspector was sort of clunky as it required the loop. If you switch your variables to Global Elements, you can use them in any section in any script. It may be how and when you are declaring the variables that they are "section" only. I do not think that would be a "normal" attribute, and I have not run into that issue. However, I use the old variables for some internal script math (such as to figure an offset from a strike Global) only, so I am not calling them often.


Here is an example of a lot of Globals that I use in scripts for a particular brew. I am hoping to transfer most of these from a stored file as I know that you can do that, I just do not know how yet. I know there are threads about Beer Smith imports. Some are just names and amounts that I use in screen messages, but some are used to trigger an alarm or advance a script. We tend to do the same brews on a repetitive basis.
View attachment 652249

By having these as Globals, I can quickly change or review things I need to know for a brew, rather than going into and editing a script for a Mash Temp, for example.

I plan to create a separate Fermentation Configuration or Workspace in the near future with different Global Variables such as Fermentation Temps and Glycol Temp Values.

Good idea- I’ll be sure to use globals for user input
 
Finally got to testing with fermentation fridge. One thing I noticed is intermittent input dips with SPI sensor (pt100) Is this a symptom of EMI? Since my fridge is across the house I can’t really compare the dip to when the AC kicks on. Not sure what else would cause this...

This is what I’m using to convert the DC output for fridge control.

View attachment 652355

cannot see attachment.

Please show or describe your device configuration page. Is you average weight 25% like the default is? You can lower that to make spikes smaller.. We do want an algorithm to throw out bad values in Tilt and 1-wire readings, but would be useful for SPI inputs also.
 
Another request: Workspace Visibility Property that works just like an Element Visibility Property.

"MyWorkspace" visibility = hidden locked

I do not want its tab to show

It would also be nice if the "current" workspace tab could hold at least 30 chars. I have so many workspaces now that I am limited to what the tab displays, but it would be nice to see the "whole workspace Tab name" when it is the "current" selected workspace.
 
cannot see attachment.

Please show or describe your device configuration page. Is you average weight 25% like the default is? You can lower that to make spikes smaller.. We do want an algorithm to throw out bad values in Tilt and 1-wire readings, but would be useful for SPI inputs also.
I have left my SPI device at default. Average weight is 25%, Poll Rate 500. The dips I'm seeing are very large and take the reading down into the negative numbers. Very similar to when a sensor is disconnected and then reconnected.

Does this sound like EMI or an average weight issue? I dont have any flyback diodes installed yet. I'm curious if I have another issue.

RenderedImage.JPG
 
I have left my SPI device at default. Average weight is 25%, Poll Rate 500. The dips I'm seeing are very large and take the reading down into the negative numbers. Very similar to when a sensor is disconnected and then reconnected.

Does this sound like EMI or an average weight issue? I dont have any flyback diodes installed yet. I'm curious if I have another issue.

View attachment 652397
How are you powering the RTD amplifier board(s)? You can get these types of spikes if the 5V power is not stable.
 
Amplifier board is powered with a 24v to 5v step down converter. This is the only 5v component- what would cause unstable power?

I'm seeing the low spike when the hysteresis device target is set higher than the SPI value. No issues when setting target below the SPI value. Active low for hysteresis is off, so this is de-energizing the Salon Board relay in the panel. Simply put, if I disable and enable the hysteresis device, I observe the low spike.

I am seeing the same result regardless if the output is plugged into fermentation fridge or not. This is tested in manual operation with no scripts running.
 
Last edited:
could be ground issue? I get this on RTD's connected to a Mega that is only otherwise connected to a laptop via USB cable, and the laptop is plugged into the same outlet as a SonOff dual that has a tiny MKII pump on it and they go negative when the pump is turned off...

I guess the first question is regarding the source, is the interface just not getting a reading on the SPI bus, or is it getting a reading that is actually that negative value...

upload_2019-11-13_14-47-32.png
 
could be ground issue? I get this on RTD's connected to a Mega that is only otherwise connected to a laptop via USB cable, and the laptop is plugged into the same outlet as a SonOff dual that has a tiny MKII pump on it and they go negative when the pump is turned off...

I guess the first question is regarding the source, is the interface just not getting a reading on the SPI bus, or is it getting a reading that is actually that negative value...

View attachment 652402

When i unplug the output from panel I no longer have the issue. I can’t say for certain which reading the interface is getting
 
When i unplug the output from panel I no longer have the issue. I can’t say for certain which reading the interface is getting
I've got it narrowed down to a certain PT100 sensor. What would cause this to happen to one and not the other? They are both wired the same, same model etc. I am careful to eliminate all other variables including port, socket etc...
 
have you swapped the amplifier board? other than that, I would say grounding...
I was mistaken with my previous posts, it seems to be an issue when I have the AC connected. Testing with a light and I dont have issues, its not till i plug in the AC I see the issue. Not sure how to fix this..
 
Has anyone run into the issue to where the output of a device works correctly but the device value appearance does not? I'm talking about the ON and OFF readout. I have both of these fields blank in the settings.
 
Last edited:
First I assume you are referring to a digital output. Then, I would ask if you have touched the 'appearance' tab in any way. Finally, I would suggest that you delete and re-add the device as a digital output and carefully document any and all changes you make to it, along with correct operation and appearance after each change. If there is a problem, this is the most efficient way to find it.
 
could be ground issue? I get this on RTD's connected to a Mega that is only otherwise connected to a laptop via USB cable, and the laptop is plugged into the same outlet as a SonOff dual that has a tiny MKII pump on it and they go negative when the pump is turned off...

I guess the first question is regarding the source, is the interface just not getting a reading on the SPI bus, or is it getting a reading that is actually that negative value...

View attachment 652402
Im not really sure what we are looking at here. I think you have a breaker, ac contactor, DC relay, physical switch, and a plug. What are these doing? Where is the DC power coming from and how is it wired to your board? Is the plug for an AC unit or a fridge? And is the power supply for the RTD from the same power circuit? If your 5v power supply is on the same circuit then it will be affected by the inductive load. You could also try a capacitor across the + and - on the 5v to smooth it out.
 

Latest posts

Back
Top