Location of C vs F Defaults?


#1

I did some searches and I don’t think this has been covered. My sincere apologies if it has. Searching for “C” and “F” is somewhat non-filtering.

First let me take my lumps - I have practiced unsafe modifications, poor code management practices, and overall done bad things. Now that that is out of the way …

I have endeavored to change the default BrewPi configuration from C to F within the application. I have NOT kept track of what I’ve changed (I know … I know … ). All I know for sure that I have changed is the following lines in brewpi.py:

# Control Settings
cs = dict(mode='b', beerSet=70.0, fridgeSet=70.0, heatEstimator=0.2, coolEstimator=5)

# Control Constants
cc = dict(tempFormat="F", tempSetMin=33.0, tempSetMax=80.0, pidMax=10.0, Kp=20.000, Ki=0.600, Kd=-3.000, iMaxErr=0.500,
          idleRangeH=1.000, idleRangeL=-1.000, heatTargetH=0.301, heatTargetL=-0.199, coolTargetH=0.199,
          coolTargetL=-0.301, maxHeatTimeForEst="600", maxCoolTimeForEst="1200", fridgeFastFilt="1", fridgeSlowFilt="4",
          fridgeSlopeFilt="3", beerFastFilt="3", beerSlowFilt="5", beerSlopeFilt="4", lah=0, hs=0)

Is this the only place I’d need to change? I ask because I strongly suspect that this is not. For instance, when I view the maintenance panel the various temp set mode tabs, they still read C.

Is this critical? Obviously not. It does smack of American imperialism - thinking everyone should adopt American practices. :slight_smile: However I have a half-realized change that I did not fully document and failed to track my changes specific to this so I’d prefer not to roll back to a state that would make me lose other, unrelated changes. So, if anyone knows where else I need to look, that help would be appreciated greatly.


#2

Okay I got a little further. I think a lot keys off the defaultSettings.json:

{"beerName": "Sample Data", "tempFormat": "F", "profileName": "Sample Profile", "dateTimeFormat": "yy-mm-dd", "dateTimeFormatDisplay": "mm/dd/yy" }

The only issue I see right now is that the “Fridge Constant” and “Beer Constant” values default to 20 (carrying over Centigrade). They only place I can see any ‘20’ that might be it is in pinList.py (and I don’t think this is it):

{'val': 20, 'text': 'A2', 'type': 'free'},

I did change the tempProfile.csv settings to be realistic based on this but I still think I’m missing something.


#3

sorry if this is an obvious question, but why are you trying to change the defaults rather than just changing the setting that exists? And have you tried looking at the code-path for that setting?


#4

And for what it’s worth :wink:


#5

I did previously own up to both American Imperialism and having a half-realized attempt to change this. So, no matter what, I need to figure out where all it lives so I can either complete the change or revert it.

And yes I have attempted to trace the code path. I’ve listed what I found. I have to admit to both being now a leader in IT and not a contributor so this is a significant change from my day to day - and that the context switching between php, py and js is really messing with my head.

Anyway, like I said I seem to have more fully realized the change but I’m just wondering where that “20” comes from, because it doesn’t seem to be associated with anything (that I’ve found) indicating a default setting. I’m obviously wrong in that, but I’m having trouble finding it.


#6

Having chewed on this a while I’m beginning to suspect that (obviously) nobody ever considered making this change and testing the impact of actually changing the defaults. I’d hoped that someone had done it previously and/or was familiar with it, I’m still hoping that happens. Right now I’m playing whak-a-mole with the bugs I’ve created, which is fun (for a while.)


#7

Any reason you cannot do a git diff or reset?
I am not proud of the design and in quite a lot of places it shows that I was unexperienced when I designed it.

It you have a BrewPi Spark, I wouldn’t even bother and upgrade to our new brewblox stack next week. I am proud of that architecture :slight_smile:

Because we were working on something new all that time, we didn’t bother getting the existing stack up to our new standards.


#8

Elco, going back and looking at old code is like looking at store specials after you buy a new laptop. Just don’t do it. :slight_smile:

I’ve changed quite a lot about the scripts at this point so digging through the changes I made looking for the ones I screwed up would be more time consuming that pushing forward - or so I think at this point. I wonder though: I saw a note about “internals” doing temp calculations in C and then converting. Is it possible there’s a controller setting that I need to set to F as default before my crazy scheme will work?

This WHOLE thing came out of trying to help a (non-computer literate) friend recover after his Pi ate his SD card. It started simply as making it a little easier for him to install and then it just snowballed from there. There is NO good reason, no payback, for all the hours I have in this. It just makes me happy to tinker. I’ve not been an individual contributor for along time so whenever I get a chance to dip my toe in DOING technology, I jump at it. It keeps me relevant I think.

To tell a secret: I don’t even get a chance to brew anymore things are so busy at work. :pleading_face:


#9

Calculations are in Celsius on the controller and are converted when serialized.
The setting changes the toString and fromString handlers (on the controller).


#10

Gotcha. Thanks Elco.

It’s passable now. The beer and fridge constants are still defaulting to 20.0 despite being in F mode. One of these days I’l debug a little more.