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

    Homebrewing Facebook Group

HOWTO - Make a BrewPi Fermentation Controller For Cheap

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
Status
Not open for further replies.
Well, after many late nights tearing my hair out, you guys have helped me get it running again. I rebuilt my breadboard with a fresh piece, systematically weeded out the dead B20s (I have 6x, and 2x were dead/reading 85), reinstalled BrewPi Remix, and reflashed the Arduino. Funnily enough I still am not able to flash my Arduino via avrdude on command line or via the BPR load hex file option - I had to use HEXtoArduino and manually load it. Oh well, got there in the end!

Thankyou so much for your help everyone.
 

Attachments

  • Screenshot_20200117-232623_Chrome.jpg
    Screenshot_20200117-232623_Chrome.jpg
    526.5 KB
LBussy,

Thank you for making this easy for a noob like me.

I just got a BrewPI Remix installation running in January. I am looking for a brief description on how to get the Tilt Sensor integrated into BrewPi Remix since the release of version 5.4.1. I opted to include the Tilt Integration during the installation of BrewPI on my Raspberry PI V3 B+. But it does not appear to be tracking and I don't see a way to configure it under the Device Configuration. I have tried looking for this information, but all the information appears to be prior to the newest release of Remix. I assume that I need to connect the PI to the Tilt, but I don't have a clue where to start.
 
Glad you got this far!

What errors are you getting flashing with avrdude?

With the BPR GUI, when I attempt to upload the .hex file it just hangs. No output occurs in the bottom window. With avrdude over command line, it gives a stk500 and communication error. Sometimes it says it times out. I will get you a proper output a bit later. The only way I was able to get the .hex file on was with HEXtoArduino.
 
I just got a BrewPI Remix installation running in January. I am looking for a brief description on how to get the Tilt Sensor integrated into BrewPi Remix since the release of version 5.4.1. I opted to include the Tilt Integration during the installation of BrewPI on my Raspberry PI V3 B+. But it does not appear to be tracking and I don't see a way to configure it under the Device Configuration. I have tried looking for this information, but all the information appears to be prior to the newest release of Remix. I assume that I need to connect the PI to the Tilt, but I don't have a clue where to start.
You're right - the documentation is lagging. Since I basically forked the project and the original docs were limited, I often find myself neglecting some because it's not "all."

Tilts are added by color. Even though there's not documentation for this specifically (yet) I did attempt to leave examples. Check your {brewpi app directory}/settings/config.cfg.example file and you will see (in part:)
Code:
# wwwPath = /var/www/html
# port = /dev/ttyACM0
# altport = /dev/ttyACM1
# boardType = arduino
# startupDelay = 1.0
# debug = true
# tiltColor = Purple
# logJson = True
# scriptPath = /home/brewpi/
There you see the tiltColor = {color} configuration line.

You'd have to be using a configuration file, in other words, there would have to be a "config.cfg" in that location. If there is not one, copy the example:
Code:
sudo cp config.cfg.example config.cfg
Then edit the file, uncomment the tiltColor line (remove the "#") and edit the color accordingly.

After that, you would stop and start the script and it should start picking up. If it does not, the first step would be to share the logs so we can see what's happening.
 
With the BPR GUI, when I attempt to upload the .hex file it just hangs. No output occurs in the bottom window. With avrdude over command line, it gives a stk500 and communication error. Sometimes it says it times out. I will get you a proper output a bit later. The only way I was able to get the .hex file on was with HEXtoArduino.
The GUI has always been iffy. I'll get back to that one of these days. If avrdude is not working, certainly the script will not. Seeing the output would help.
 
The GUI has always been iffy. I'll get back to that one of these days. If avrdude is not working, certainly the script will not. Seeing the output would help.

Here is the output I get when I try to run the avrdude command.

Code:
pi@raspberrypi:~ $ sudo avrdude -F -e -p atmega328p -c arduino -b 115200 -P /dev/ttyACM0 -U flash:w:"brewpi-arduino-uno-revc-0.2.12.hex"

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: erasing chip
avrdude: reading input file "brewpi-arduino-uno-revc-0.2.12.hex"
avrdude: can't determine file format for brewpi-arduino-uno-revc-0.2.12.hex, specify explicitly
avrdude: read from file 'brewpi-arduino-uno-revc-0.2.12.hex' failed

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done.  Thank you.
 
Here is the output I get when I try to run the avrdude command.
Do you get the same results when running updateFirmware.py?

You can try adding a ":i" after the filename to explicitly define it as an Intel Hex file:
Code:
sudo avrdude -F -e -p atmega328p -c arduino -b 115200 -P /dev/ttyACM0 -U flash:w:brewpi-arduino-uno-revc-0.2.12.hex:i
It should not be needed, but that's the answer to that error.
 
I haven't tried running updateFirmware.py yet, doing that next, but here is the new output adding the :i

Code:
pi@raspberrypi:~ $ sudo avrdude -F -e -p atmega328p -c arduino -b 115200 -P /dev/ttyACM0 -U flash:w:brewpi-arduino-uno-revc-0.2.12.hex:i
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x54
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x3a
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x7b
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x22
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x42
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x65
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x65
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x72
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x54
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x65

avrdude done.  Thank you.

Edit: Running updateFirmware.py seems to have run without an issue.
 
Last edited:
Do you get the same results when running updateFirmware.py?

You can try adding a ":i" after the filename to explicitly define it as an Intel Hex file:
Code:
sudo avrdude -F -e -p atmega328p -c arduino -b 115200 -P /dev/ttyACM0 -U flash:w:brewpi-arduino-uno-revc-0.2.12.hex:i
It should not be needed, but that's the answer to that error.

That suggests the BrewPi script was still running.

Excellent! That means when I fix the UI method, it will work. :)

Odd because I can't get the script to run, fooling around with it now but here is what the log says. Clean install on a new Pi.

Code:
pi@raspberrypi:/home/brewpi/logs $ cat stdout.txt
2020-01-18 22:04:14  Opening serial port.
2020-01-18 22:04:14  0.5.4.1 (master) [5824d24 Fix degree sign in web]
2020-01-18 22:04:14  Starting 'My BrewPi Remix Run.'
2020-01-18 22:04:14  Waiting 10 seconds for board to restart.
2020-01-18 22:04:24  Checking software version on controller.
2020-01-18 22:04:24  Found BrewPi v0.2.12 build 8d36524, running on an Arduino Uno with a revC shield on port /dev/ttyACM0.
2020-01-18 22:04:25  Caught an unhandled exception, exiting.
2020-01-18 22:04:25  Stopping background serial processing.
2020-01-18 22:04:25  Closing port.
2020-01-18 22:04:25  Closing open sockets.
2020-01-18 22:04:25  Exiting.
 
Yes, I've been working on fixing my BrewPi and have run into the same log contents. I've tried installing on 2019-04-08-rasbian-stretch (no logging, "Script not Running!") and now 2019-09-26-rasbian-buster-full ("Script not Running!") log:

Code:
2020-01-18 22:56:39 Opening serial port.
2020-01-18 22:56:39 0.5.4.1 (master) [5824d24 Fix degree sign in web]
2020-01-18 22:56:39 Starting 'My BrewPi Remix Run.'
2020-01-18 22:56:39 Waiting 10 seconds for board to restart.
2020-01-18 22:56:49 Checking software version on controller.
2020-01-18 22:56:49 Found BrewPi v0.2.12 build 8d36524, running on an Arduino Uno with a revC shield on port /dev/ttyACM0.
2020-01-18 22:56:50 Caught an unhandled exception, exiting.
2020-01-18 22:56:50 Stopping background serial processing.
2020-01-18 22:56:50 Closing port.
2020-01-18 22:56:50 Closing open sockets.
2020-01-18 22:56:50 Exiting.

When I check device configuration and device list I get:

Code:
Error while receiving device configuration: SyntaxError: Unexpected token C in JSON at position 0

Any thoughts?

Thank you-

Mark
 
Well .... sh*t. That certainly seems like a “me” problem. I eat my own dog food however and I have it running here as well though so no initial thoughts.

Gimme a few to wake up and smell the coffee and I’ll get to work on it.
 
Okay for @mwamsley and @thestraw0039:

Please do the following:
Code:
cd /home/brewpi
sudo systemctl stop brewpi
sudo git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
sudo git fetch --all
sudo git pull --all
sudo git checkout devel
sudo git pull
sudo systemctl start brewpi
At this point, the script will try to start up again. You can watch the logs with:
Code:
tail -f /home/brewpi/logs/std*.txt
Assuming it will still raise an exception, it should show in the stderr.log. That will give me more to go on.
 
You're right - the documentation is lagging. Since I basically forked the project and the original docs were limited, I often find myself neglecting some because it's not "all."

Sorry if I offended you by stating "all" documentation, that was not my intention.

I reviewed the config.cfg file and this is what I have:

scriptPath = /home/brewpi
wwwPath = /var/www/html
port = auto
chamber = ""
tiltColor = Orange

I have included the full log files for both the stderr.txt and stdout.txt files.

This was from the stderr.text file.
2020-01-19 13:38:23 Configured for Tilt but no Bluetooth radio available. // I am using a Raspberry Pi ver 3b+. I thought this had native bluetooth radio support.
2020-01-19 13:38:23 Starting BrewPi.
 

Attachments

  • config.cfg.txt
    97 bytes
  • stderr.txt
    113 bytes
  • stdout.txt
    6.5 KB
Sorry if I offended you by stating "all" documentation, that was not my intention.
Nah, my skin is thicker than that. :) The documentation does suck. I will accept pull requests to improve them. :p
I thought this had native bluetooth radio support.
It does, but something's not working for sure. Try running "Tilt" on its own:
Code:
/home/brewpi/Tilt.py
See if it detects the Tilt. If not ... well, we'll figure something out.
 
This is the response. I got to this by navigating to the file Located at: /home/brewpi/Tilt.py

Reporting Tilt values every 5 seconds. Ctrl-C to stop.
Color Purple report: No results returned.
Color Purple report: No results returned.
Color Purple report: No results returned.

I have the Orange Tilt.
 
This is the response. I got to this by navigating to the file Located at: /home/brewpi/Tilt.py

Reporting Tilt values every 5 seconds. Ctrl-C to stop.
Color Purple report: No results returned.
Color Purple report: No results returned.
Color Purple report: No results returned.

I have the Orange Tilt.
Oops. :rolleyes:

Line 516, change "Purple" to "Orange". I'll fix that so it will pick up the one from the config.
 
Okay for @mwamsley and @thestraw0039:

Please do the following:
Code:
cd /home/brewpi
sudo systemctl stop brewpi
sudo git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
sudo git fetch --all
sudo git pull --all
sudo git checkout devel
sudo git pull
sudo systemctl start brewpi
At this point, the script will try to start up again. You can watch the logs with:
Code:
tail -f /home/brewpi/logs/std*.txt
Assuming it will still raise an exception, it should show in the stderr.log. That will give me more to go on.

When I get to git pull --all I get the following output, and I think this is something you need to change on GitHub.

Code:
pi@raspberrypi:/home/brewpi $ sudo git pull --all
Fetching origin
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> devel
 
I must have a completely different issue. Same log result. I'm using defaults.cfg.

Code:
pi@brewpi:~ $ cd /home/brewpi
pi@brewpi:/home/brewpi $ sudo systemctl stop brewpi
pi@brewpi:/home/brewpi $ sudo git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
pi@brewpi:/home/brewpi $ sudo git fetch --all
Fetching origin
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 2), reused 3 (delta 2), pack-reused 0
Unpacking objects: 100% (6/6), done.
From https://github.com/brewpi-remix/brewpi-script-rmx
   3c25020..9bb9ffe  devel      -> origin/devel
pi@brewpi:/home/brewpi $ sudo git pull --all
Fetching origin
Already up to date.
pi@brewpi:/home/brewpi $ sudo git checkout devel
Branch 'devel' set up to track remote branch 'devel' from 'origin'.
Switched to a new branch 'devel'
pi@brewpi:/home/brewpi $ sudo git pull
Already up to date.
pi@brewpi:/home/brewpi $ sudo systemctl start brewpi
pi@brewpi:/home/brewpi $ tail -f /home/brewpi/logs/std*.txt
==> /home/brewpi/logs/stderr.txt <==
2020-01-19 18:05:14  Starting BrewPi.

==> /home/brewpi/logs/stdout.txt <==
2020-01-19 18:05:14  Opening serial port.
2020-01-19 18:05:14  0.5.4.1 (master) [5824d24 Fix degree sign in web]
2020-01-19 18:05:14  Starting 'My BrewPi Remix Run.'
2020-01-19 18:05:14  Waiting 10 seconds for board to restart.
2020-01-19 18:05:24  Checking software version on controller.
2020-01-19 18:05:24  Found BrewPi v0.2.12 build 8d36524, running on an Arduino Uno with a revC shield on port /dev/ttyACM0.
2020-01-19 18:05:24  Caught an unhandled exception, exiting.
2020-01-19 18:05:24  Stopping background serial processing.
2020-01-19 18:05:24  Closing port.
2020-01-19 18:05:24  Exiting.

Thank you for your work on this project. This is truly my most important 2020 resolution.

Mark
 
Alright, I think I got the devel up and running, here is the error. I'm curious if you have this written for wifi (I ask because this is a wired connection), I think I remember you reading this, the stdout.txt isn't showing anything, but this appears to be looping:

Code:
pi@raspberrypi:/home/brewpi $ tail -f /home/brewpi/logs/std*.txt
==> /home/brewpi/logs/stderr.txt <==
2020-01-19 20:46:10 DOWIFI WARN: 3 failure(s) to reach 192.168.1.1.
2020-01-19 20:46:10 DOWIFI ERROR: Gateway unreachable. Restarting wlan0.
2020-01-19 20:55:30 DOWIFI WARN: 1 failure(s) to reach 192.168.1.1.
2020-01-19 20:55:50 DOWIFI WARN: 2 failure(s) to reach 192.168.1.1.
2020-01-19 20:56:10 DOWIFI WARN: 3 failure(s) to reach 192.168.1.1.
2020-01-19 20:56:10 DOWIFI ERROR: Gateway unreachable. Restarting wlan0.
2020-01-19 21:05:31 DOWIFI WARN: 1 failure(s) to reach 192.168.1.1.
2020-01-19 21:05:51 DOWIFI WARN: 2 failure(s) to reach 192.168.1.1.
2020-01-19 21:06:11 DOWIFI WARN: 3 failure(s) to reach 192.168.1.1.
2020-01-19 21:06:11 DOWIFI ERROR: Gateway unreachable. Restarting wlan0.

Edit: After looking at this the daemon won't start:

Code:
pi@raspberrypi:/home/brewpi $ systemctl status brewpi
● brewpi.service - BrewPi Remix daemon for: brewpi
   Loaded: loaded (/etc/systemd/system/brewpi.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2020-01-19 21:26:43 EST; 1min 33s ago
     Docs: https://docs.brewpiremix.com/
  Process: 21527 ExecStart=/bin/bash /home/brewpi/utils/doBrewPi.sh -d (code=exited, status=1/FAILURE)
 Main PID: 21527 (code=exited, status=1/FAILURE)

Jan 19 21:26:43 raspberrypi systemd[1]: brewpi.service: Service RestartSec=1s expired, scheduling restart.
Jan 19 21:26:43 raspberrypi systemd[1]: brewpi.service: Scheduled restart job, restart counter is at 5.
Jan 19 21:26:43 raspberrypi systemd[1]: Stopped BrewPi Remix daemon for: brewpi.
Jan 19 21:26:43 raspberrypi systemd[1]: brewpi.service: Start request repeated too quickly.
Jan 19 21:26:43 raspberrypi systemd[1]: brewpi.service: Failed with result 'exit-code'.
Jan 19 21:26:43 raspberrypi systemd[1]: Failed to start BrewPi Remix daemon for: brewpi.

Second edit: turning on wifi and daemon still won't start.
 
Last edited:
Yeah sorry LBussy, I haven't got around to getting the exact output for you just yet - been focused on determing which of my DS18b20s are dead/alive, rearranging the setup and getting it working. I'm proud to report it now operates perfectly, running three probes (beer, fridge & room) and two relays for heating and cooling.

Re: the Arduino issue; I also had a few difficulties for a while uploading a sketch from my PC and other communication issues, but I'd say at this stage it's probably user error I have successfully flashed with avrdude via command line (same command as thestraw0039) previously, but not been able to since.
 

Attachments

  • USER_SCOPED_TEMP_DATA_MSGR_PHOTO_FOR_UPLOAD_1579528529829.jpeg
    USER_SCOPED_TEMP_DATA_MSGR_PHOTO_FOR_UPLOAD_1579528529829.jpeg
    689.3 KB
Alright, daemon appeared to not be running due to permission issues, a quick run of doPerms.py seemed to fix that. Here is the error I am getting:

Code:
pi@raspberrypi:/home/brewpi/logs $ cat stderr.txt
2020-01-20 22:06:07  Starting BrewPi.
2020-01-20 22:06:18  '_csv.reader' object has no attribute 'next'
 
Alright, daemon appeared to not be running due to permission issues, a quick run of doPerms.py seemed to fix that. Here is the error I am getting:

Code:
pi@raspberrypi:/home/brewpi/logs $ cat stderr.txt
2020-01-20 22:06:07  Starting BrewPi.
2020-01-20 22:06:18  '_csv.reader' object has no attribute 'next'

Found the issue,

in temperatureProfile.py line 44 and 45

Code:
temperatureReader = csv.reader(csvfile, dialect)
temperatureReader.next() # Discard the first row, which is the table header

temperatureReader.next() is a Python2 code, and this method needs to be changed for Python3. Changing the code to below gets my Brewpi up and running:

Code:
temperatureReader = csv.reader(csvfile, dialect)
next(temperatureReader)

Here is the link that helped me out.

https://memoryleak.in/2018/02/27/ho...o-attribute-next-python-3-6-csv-reader-error/
 
Alright, daemon appeared to not be running due to permission issues, a quick run of doPerms.py seemed to fix that. Here is the error I am getting:

Code:
pi@raspberrypi:/home/brewpi/logs $ cat stderr.txt
2020-01-20 22:06:07  Starting BrewPi.
2020-01-20 22:06:18  '_csv.reader' object has no attribute 'next'
Issue #105 closed, change merged into Master and Devel.
 
Oops. :rolleyes:

Line 516, change "Purple" to "Orange". I'll fix that so it will pick up the one from the config.

I ran into a few issues with a corrupt SD card, and a few other things. I have a fresh install of BrewPi remix up and running. I also found out I am running on a Raspberry PI 3 B not the PI 3 B +. I modified the Tilt.py Script to Orange and get the following responses.

Code:
pi@brewpi:~ $ sudo /home/brewpi/Tilt.py
Reporting Tilt values every 5 seconds. Ctrl-C to stop.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 0 weeks old.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 11 weeks old.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 11 weeks old.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 11 weeks old.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 11 weeks old.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 11 weeks old.
Orange: Temp = 37.0°F, Gravity = 0.998, Battery = 11 weeks old.

My Stderr.txt file is still displaying the following:
2020-01-29 17:28:08 Configured for Tilt but no Bluetooth radio available.
2020-01-29 17:28:08 Starting BrewPi.

I just got BrewPi Remix running and will watch it a for a few days to see if I start getting a Trace for the Gravity.

I do not see a value/color for gravity listed in the Date/Time column on the right. I am currently logging SG with an iPad using the Tilt Application at the same time and saving values to the cloud. Is this causing any issues?
 

Attachments

  • Screen Shot -- No Tilt Listed..jpg
    Screen Shot -- No Tilt Listed..jpg
    219.3 KB
Logging should not matter. Might be that the radio is not “0” but “1” but I forgot where that is offhand and right now I’m on a ship in the Caribbean. :)

I can look when I get back, or maybe someone else is feeling froggy and will try to crack it.

It certainly is strange though, that script you are running should access it the same way.
 
Thanks for your help everyone. Here's my setup running with a 10L batch.
 

Attachments

  • Screenshot_20200202-114859_Chrome.jpg
    Screenshot_20200202-114859_Chrome.jpg
    672.5 KB
  • 20200131_224038.jpg
    20200131_224038.jpg
    3.4 MB
I ran into a few issues with a corrupt SD card, and a few other things. I have a fresh install of BrewPi remix up and running. I also found out I am running on a Raspberry PI 3 B not the PI 3 B +. I modified the Tilt.py Script to Orange and get the following responses.
Well that's certainly strange. I am (at least I thought I was) using the same logic in both places. Let's try something simple. On line 444 insert the following:
Code:
    return True
So that block will look like:
Code:
def checkBluetooth(interface = 0):
    return True
    sock = None
That's just a hack to tell me where the issue may lie, but if I guessed right it should start working. You will of course have to restart the script to have the change take effect.
 
Status
Not open for further replies.
Back
Top