• Please visit and share your knowledge at our sister communities:
  • If you have not, please join our official Homebrewing Facebook Group!

    Homebrewing Facebook Group

BrewPi Remix – What’s Old is New Again

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Thank you. That "Argument must be a string" error may be the one that's plagued me (and probably @Thorrak) the most consistently. I'm going to have to find a few parts and pieces and see if I can reproduce things here.

If you use the Tilt straight to your Pi, does it behave?

ETA: Tiltbridge does see that Tilt, right?
 
Thank you. That "Argument must be a string" error may be the one that's plagued me (and probably @Thorrak) the most consistently. I'm going to have to find a few parts and pieces and see if I can reproduce things here.

If you use the Tilt straight to your Pi, does it behave?

ETA: Tiltbridge does see that Tilt, right?
Tiltbridge does see the tilt with no issues.

While fermenting Pi only occasionally sees the tilt and only when "sudo hcitool lescan" is scanning.
I believe there is too much chamber in the way of the pi, hence Tiltbridge.
I have put the tilt unit next to the pi and it does work as expected at that piont.
 
Interesting, this is tickling some dendrites. I'm going to bet a dollar this is related to something I thought I fixed already but didn't. :)
 
advice is greatly appreciated.
Would you please edit your /home/brewpi/settings/config.cfg and use/edit the following line?
Code:
logJson = True
It won't change the behavior, but it will log the json it receives in the logs and we might be able to see something else.
 
Would you please edit your /home/brewpi/settings/config.cfg and use/edit the following line?
Code:
logJson = True
It won't change the behavior, but it will log the json it receives in the logs and we might be able to see something else.
Done
1650667697802.png
 
If it helps locate the issue, the lines with the bug are the ones below; I think it’s the way that the code is trying to pull the hardware version (which is now fwVersion). I hit the same problem and just commented out the problem lines as I assumed it was because I haven’t upgraded TiltBridge in forever...

Python:
diff --git a/brewpi.py b/brewpi.py
index c2ed372..767ea89 100755
--- a/brewpi.py
+++ b/brewpi.py
@@ -1342,9 +1342,9 @@ def loop():  # Main program loop
                                                     prevTempJson[config['tiltColor'] + 'Temp'] = round(_temp)
 
                                                 # Get battery value from anything >= Tilt v2
-                                                if int(prevTempJson[config['tiltColor'] + 'HWVer']) >= 2:
-                                                    if (checkKey(api['tilts'][config['tiltColor']], 'weeks_on_battery')):
-                                                        prevTempJson[config["tiltColor"] + 'Batt'] = int(api['tilts'][config['tiltColor']]['weeks_on_battery'])
+                                                #if int(prevTempJson[config['tiltColor'] + 'HWVer']) >= 2:
+                                                #    if (checkKey(api['tilts'][config['tiltColor']], 'weeks_on_battery')):
+                                                #        prevTempJson[config["tiltColor"] + 'Batt'] = int(api['tilts'][config['tiltColor']]['weeks_on_battery'])
 
                                                 # Set time of last update
                                                 lastTiltbridge = timestamp = time.time()
 
I hit the same problem and just commented out the problem lines as I assumed it was because I haven’t upgraded TiltBridge in forever...
What are we gonna do with you? ;)

That is likely where the issue lies, but I'm confused. I use TiltBridge, I'm a contributor as you know, and obviously, I use BPR. I've not seen this issue but I should have. I checked and fwVersion goes back to at least 0.2.3. Right now all of my "debug" is via github since all of my stuff is still in boxes.

Today I am pulling a new power feed to the barn and then replacing the breaker box. After that, I might be able to find my box of stuff and see what's going on here. @athistle could likely comment those same lines, but I'm scratching my head for the reason right now.
 
What are we gonna do with you?

When I first started programing in college, I wanted to install twm as my window manager rather than the HPUX window manager. Unfortunately, they taught us FORTRAN and not C, so I didn't fully understand the source code. I got twm to compile by just deleting the lines of source code that threw a compiler error until it compiled successfully. It all worked great. There were just a couple of things you couldn't do without it hitting the missing code and killing all your processes with a hard log out...

I uncommented the lines that are throwing the error and dropped my tilts in a beaker of water last night. So far, so good. Not seeing the problem yet. Something is occasionally putting a None into the variable hwVersion, but it's hard to reproduce. I think a workaround is to change line 962 of Tilt.py to
Python:
if (tiltValue.hwVersion):
  hwVersion = tiltValue.hwVersion
else:
  hwVersion = 0
but that's not a real fix...
 
I got twm to compile by just deleting the lines of source code that threw a compiler error until it compiled successfully.
I wish I could laugh at that. All I can do is not my head and sigh. :)

Something is occasionally putting a None into the variable hwVersion, but it's hard to reproduce.
Interesting - and that was with just the Tilt, not TB? That means I can’t blame @Thorrak which is a bummer.

I remember something the Tilt devs told me about that version. I think there are intervals where that part of the beacon does something else. That would explain it being a timing issue.

What I should really do is just keep that and anything else unlikely to change in the Tilt object. No reason to check it every time.

As you know there are a LOT of areas in that code which could be written better. Adding to it is always baling wire and bubblegum, so here we are.

I appreciate you testing that!
 
Yeah, can't find any issue with the JSON that tiltbridge is sending. I think that something can cause the tilt to be picked up directly and it messes with the contents of prevTempJSON, but I can't figure out what causes it. If you go for the patch, then I think the same if/else logic is needed around line 1545 in brewpy.py. Complete belt and braces would be
Python:
if (prevTempJson[config['tiltColor'] + 'HWVer']) and ( int(prevTempJson[config['tiltColor'] + 'HWVer']) >= 2):
on line 1346 to catch the None if it sneaks in from somewhere else.
 
When I first started programing in college, I wanted to install twm as my window manager rather than the HPUX window manager. Unfortunately, they taught us FORTRAN and not C, so I didn't fully understand the source code. I got twm to compile by just deleting the lines of source code that threw a compiler error until it compiled successfully. It all worked great. There were just a couple of things you couldn't do without it hitting the missing code and killing all your processes with a hard log out...

I uncommented the lines that are throwing the error and dropped my tilts in a beaker of water last night. So far, so good. Not seeing the problem yet. Something is occasionally putting a None into the variable hwVersion, but it's hard to reproduce. I think a workaround is to change line 962 of Tilt.py to
Python:
if (tiltValue.hwVersion):
  hwVersion = tiltValue.hwVersion
else:
  hwVersion = 0
but that's not a real fix...
Finally getting back to this, I edited Tilt.py as suggested and now my BPR script will not start.
Any idea where I went wrong?
 
Hmmm... that's not the error I was expecting. Can you log into the Pi, cd into the directory containing brewpy.py and type
Bash:
git diff brewpi.py
and paste in the output?
 
I feel like I'm being judged here. :)

I really need to have a closer look. I was traveling last week and when I got back I discovered my BIL helped my wife "organize" all the stored boxes. Yeah ... NO idea where my rig is now.

For the above, I don't see what could be spawning an error which is very strange. Maybe @duncan.brown will pass this eye test.
 
I don't see anything obviously bad with that code. Can you run
Git:
git status
and see if anything else has changed? You can ignore files in the data directory and the settings. I'm wondering if another piece of python code has been changed somehow.
 
I don't see anything obviously bad with that code. Can you run
Git:
git status
and see if anything else has changed? You can ignore files in the data directory and the settings. I'm wondering if another piece of python code has been changed somehow.
1651430485782.png
 
I feel like I'm being judged here. :)

I really need to have a closer look. I was traveling last week and when I got back I discovered my BIL helped my wife "organize" all the stored boxes. Yeah ... NO idea where my rig is now.

For the above, I don't see what could be spawning an error which is very strange. Maybe @duncan.brown will pass this eye test.
No judging from me. This is absolutely a first world problem.
 
There's your issue. What led you to edit that?

You should be able to issue the command: sudo git restore /home/brewpi/Tilt.py
 
Probably my blathering above. The if/else statement isn't indented properly, so python is choking on it. If you comment out the lines in br
Probably my blathering above. The if/else statement isn't indented properly, so python is choking on it. If you comment out the lines in brew.py that trigger the bug, you don't need to change any other files
w.py that trigger the bug, you don't need to change any other files.
 

Latest posts

Back
Top