CraftBeerPi - Raspberry Pi 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.
I spent a few minutes tonight experimenting. The MP1584 board doesn't seem to want to deliver 5v out if it is only fed 5v in. It seems to need at least 6v in to get 5v out when turned up all the way. It sort of ran this way, but the Pi had a flashing lightning bolt on screen. I assume it didn't like being supplied that way.

I wonder if the answer would be to remove the MP1584 and just jumper across those terminals? Then I would have 5v on the whole board.
 
This has been posted a few times in the Facebook group.
Seeing a few Pi crash issues floating around again. Have a look at the following.

One wire probes:
Read my previous reiability post. Long story short, vcc to 5V and a 3.3k resistor from Data to 3.3V. If a sensor gets hot, it’s wired wrong.

Power:
Pi 3 needs 2.5A @ 5V just for itself. Don’t use a standard phone USB charger, a 2A charger is absolute minimum for any Pi used this way, even better, spend some dollars on a brand name 5V supply

Outputs:
The Pi has a maximum draw of 50mA from its IO pins (3.3 and 5V pins are seperate)

If you have 2-3 SSR’s and a couple of relays on at the same time you will be on this limit.
If you have more than 2-3 Pi pins connected, use a ULN2803, NPN transistors, or some other interface board.

AC supply
Run the Pi on a seperate feed, preferably with a battery bank as a UPS, Pis really don’t like being force restarted all the time and the seperate feed will insulate the pi from some of the switching noise.

And clean up your wiring. Many people with issues have a spaghetti mess mix of AC/DC, low and high voltage that is hard to fault find, causes noise related failures and becomes a potential hazard.

Happy brewing!

https://www.facebook.com/groups/craftbeerpi/permalink/1773360516300424/
 
just feed 5v to the pi or the 5v pin on the extension board... leave the MP1584 in place for possible future use.. I have both of mine running that way until I get the 12v supply I want...

How do you get power to the "12v" GPIO connections? When I just power the PI from the USB, the 5v terminals work, but the 12v terminals do not seem to.


Thank you for that. I'm not a Facebooker so I miss out on some of the good stuff there.

OneWire Probes: These are working fine on mine.
Power: I'm using various things as I diagnose, but the 12v supply is an LED light power source that has plenty of power. Should I be worried about this power source?
Outputs: I have 1 relay and 1 SSR on my setup.
AC Supply: This may be an issue for me. I'm not sure I have the equipment to determine if I have noise. I am running the LED light power supply off of the same AC that is connected to the AC side of my SSR. They are connected with wire nuts on the high voltage side of my setup. While not super neat looking, it is a pretty simple setup. This is also the part of my setup that has been working for a couple years on my arduino based controller. I cannibalized that setup directly to use for the new one.
 
This is a partial schematic of my build. Hopefully it will shed some light on what you're asking
CBPi-Partial-Schematic.jpg

As long as your PSU is at least 3a, it should be enough. I'm running my build with a 12V5A PSU. Make sure that you try to separate your high voltage and low voltage as much as possible. If the wire most cross, try to have them cross at a 90* angle. Also, make sure that all of your connections are nice and snug.
 
This is a partial schematic of my build. Hopefully it will shed some light on what you're asking

Clearly you mistake me for someone who knows what the hell is going on! lol

My AC and DC wires are separated. The AC stuff is off to the right and the DC stuff is organized on the left. I'm still in the prototyping stage, so it is all just fastened onto a piece of plywood at this point.

I am using the terragady board, but the equivalent on your board would be the row of GPIO terminals on the right side. When I did my test by not providing 12v to the 12v input (and powering from the pi's usb port) the 12v GPIO pins did not work. My board has two 5v outputs, and that did work off the pi power.

I also tried the experiment by putting 5v into the 12v input terminals. In that case the 12v GPIO pins didn't seem to work either, although the pi seemed to run off of that 5v power.
 
Just a thought - do you have the CraftbeerPi software GPIO outputs to INVERTED? I thought I once saw a checkbox for inverted outputs, but after looking at my CraftbeerPi v.3.0 GUI, I don't see where that was (if I really even saw it).
They're inverted in 3.0. SSRs are fine, but relay boards must use the relayboard plugin which inverts the high-low pull. In 2.2, there was an invert checkbox which has been removed.
 
How do you get power to the "12v" GPIO connections? When I just power the PI from the USB, the 5v terminals work, but the 12v terminals do not seem to.

yes, I was wrong, the 12v gpio terminals don't work at 5v, I just verified on mine... the transistor biasing must be wrong on the transistors... Anyone have an actual schematic of these boards? (not the PCB picture, but the schematic?) I would think you could get a transistor to saturate and cut on both 5v and 12v supply without changing biasing resistors...

edit: when I say 'biasing must be wrong', I mean wrong for 5v operation, not wrong in general.
 
Last edited:
OK, good news... the transistors do work with the 12V regulator bypassed to the 5V, it is just that their operation is not 'intuitive'.

Here is how I believe they are wired:
GPIO transistor.png


You see the +12 marked pin is tied directly to the voltage supply... this does not change no matter what you do with the CBP3/pi or it's programming.

The GND terminal, that is what changes..., when the GPIO pin is turned on and goes to 3.3v, it turns *on* the transistor, which connects the GPIO pin on the terragady board to GND...

Now, you might be saying.. "but hey dummy, the GND terminal measures 0v all the time, even when the output is not on!"... well, you need to have a 'load' on it... if you connect a load, the internal resistance of the load allows the board 'GND' pin to float up to 5V... when you activate the gpio, there is full working 5v between the terminals...

*this* is why there is a 'relay board' selection as an alternative to 'GPIOsimple' in CBP3

What is funny is on the shelf for 7+ years I had a 8-relay board I could not use with my old BCS because it was a 'active low' relay board that I had bought by mistake... it now works perfectly with my CBP/terragady setup... (now, doubling up on the transistor drivers is kind of a waste, and so is bypassing the 5V regulator, you or I could eliminate the whole terragady board and just use a 'relay board' as an option if I built a custom wiring harness)

Here is a pic of the setup I did just now:
The little orange loop is the bypassing of the MP1584 to have everything run on 5V
yellow is GPIO22 and bottom relay
orange is GPIO13 and the 2nd relay up
I have GPIO22 activated on in cbp3
IMG_20180124_071555.jpg
edit: you can't see it clearly, but the bottom relay is on and the red LED is on
 
Last edited:
I have it working on 5V, although the board is doing very little now except maybe bufferring or level shifting the SSR signals...

I think I might go without a CBP board, wire direct:
  • Temp sensors
    • Use a 3-pin splitter cable with integrated 4.7k resistor
    • from pins 4,6,7 on pi
    • connect to 8 panel mount QDs
    • SP13 or QX12 version on eBay
    • mount the panel wall
  • 8-channel relay board wired with a ribbon jumper
    • 10 wire ribbon bundle to Pi
    • use 18,23,24,25,12,16,20,21 so if needed, can stack a CBP board and not lose GPIOs
    • Remove 3 relays from board
    • Jumper the holes where relay was so board transistors now drive drive SSR's at 5v
    • result is 6 10a relays for pumps, alarm, and main contactor and 2 SSR drivers, with much cleaner looking install..
 
OK, good news... the transistors do work with the 12V regulator bypassed to the 5V, it is just that their operation is not 'intuitive'.

Here is how I believe they are wired:
View attachment 554933

You see the +12 marked pin is tied directly to the voltage supply... this does not change no matter what you do with the CBP3/pi or it's programming.

The GND terminal, that is what changes..., when the GPIO pin is turned on and goes to 3.3v, it turns *on* the transistor, which connects the GPIO pin on the terragady board to GND...

Now, you might be saying.. "but hey dummy, the GND terminal measures 0v all the time, even when the output is not on!"... well, you need to have a 'load' on it... if you connect a load, the internal resistance of the load allows the board 'GND' pin to float up to 5V... when you activate the gpio, there is full working 5v between the terminals...

*this* is why there is a 'relay board' selection as an alternative to 'GPIOsimple' in CBP3

What is funny is on the shelf for 7+ years I had a 8-relay board I could not use with my old BCS because it was a 'active low' relay board that I had bought by mistake... it now works perfectly with my CBP/terragady setup... (now, doubling up on the transistor drivers is kind of a waste, and so is bypassing the 5V regulator, you or I could eliminate the whole terragady board and just use a 'relay board' as an option if I built a custom wiring harness)

Here is a pic of the setup I did just now:
The little orange loop is the bypassing of the MP1584 to have everything run on 5V
yellow is GPIO22 and bottom relay
orange is GPIO13 and the 2nd relay up
I have GPIO22 activated on in cbp3
View attachment 554934
edit: you can't see it clearly, but the bottom relay is on and the red LED is on

That's fantastic to know. Thank you for doing all that leg work. I have a v5.0 version of the board, so my connections would be a little different.

I was actually thinking of just removing the MP1584 and jumping across the terminals. I would supply the board with 5v and then jump across the MP1584 to deliver that same 5v to the 12v side.

I don't have time to play with that tonight, but I should be able to try it in the next couple days.
 
don't need to remove the MP1584, just jumper the +5v to the +12v, this basically negates the 1584.. I have a v5 also..., you can run a wire from the 1-wire connector +5v to the power connector +12v terminal or just solder header pins into the 5v and 12v holes next to the 1584 and connect a jumper between them... if you ever decide to use 12v, or sell the board, you are still good...
 
Success of a sort tonight. I was able to remove the MP1584 and jumper across the terminals. The board now successfully runs on 5v to the 12v GPIO pins. For some reason GPIO05 is not working correctly. This may be related to my earlier snafu.

I tried to run a water filled test of my RIMS/Mash Tun setup tonight. I have run into a problem where the RIMS probe sometimes updates to 185F. I know from past Arduino experience that this is the temp that shows when something goes wrong with the temperature sensing. It doesn't appear to be a loose wire or connection. Wiggling wires and tightening connections seems to have no affect. The temp generally starts out accurate, and then after one or two updates will show 185F. It sometimes returns to the correct temp after a few more cycles. It seems to be somewhat random. The RIMS heater SSR is working normally. It will activate when the reported temp is below setpoint and then turn off when it jumps to 185F. It will turn back on when the temp returns to a normal reading.

I have another temp probe running on CraftBeerPi that just reads the Tun temp. This sensor doesn't fluctuate and reports an accurate temp.

Anybody have some suggestions?
 
Swap the probes?
185°F is indeed indicative of a missed reading (I used to know why that particular temperature shows up).
I hardly ever see one of those but when they happen it's always power related (eg: first readings after household power comes back and the RPi's and Unos all over the house restart).

Cheers!
 
Success of a sort tonight. I was able to remove the MP1584 and jumper across the terminals. The board now successfully runs on 5v to the 12v GPIO pins. For some reason GPIO05 is not working correctly. This may be related to my earlier snafu.

I tried to run a water filled test of my RIMS/Mash Tun setup tonight. I have run into a problem where the RIMS probe sometimes updates to 185F. I know from past Arduino experience that this is the temp that shows when something goes wrong with the temperature sensing. It doesn't appear to be a loose wire or connection. Wiggling wires and tightening connections seems to have no affect. The temp generally starts out accurate, and then after one or two updates will show 185F. It sometimes returns to the correct temp after a few more cycles. It seems to be somewhat random. The RIMS heater SSR is working normally. It will activate when the reported temp is below setpoint and then turn off when it jumps to 185F. It will turn back on when the temp returns to a normal reading.

I have another temp probe running on CraftBeerPi that just reads the Tun temp. This sensor doesn't fluctuate and reports an accurate temp.

Anybody have some suggestions?

I had all kinds of 185F and also 32F on my system. Sometimes it would would hold out for the brew day other times it would crap out during mash. For me after it saw 185F the system become unstable and would have to be rebooted. Then it may work again for a while or crap right out. Come to find out it was because of the ds18b20 sensors I had shipped from China for about a buck a piece.

Before coming to the bad sensor conclusion... I checked all wiring for noise, solder connections, changed resistor and OHM rating, added a optoisolator on the SSR control side, changed from CAT6 connectors to M12 etc..

Not until I bought good rated sensors (still pretty cheap) did all my 185F problems end. If I was you, recheck all connections and solder points, wire routing, use only one sensor at time and switch sensors for the rims until figured out. I now use seven sensors at a time no problem.

Good Luck!

Found online..

" If the measurement sequence fails due to noise or insufficient power, the subsequent measurement data will be +85°C (185°F) which is the power-on reset value of the temperature register. Be aware that a defective sensor can corrupt the measurement sequence and spoil the measurement for all of the sensors on the bus."
 
I'm not sure how your temp probes are wired, but after a lot of experimentation and discussion on the FB page with EEs, we've found that this is a much more stable way to wire them.

cbpi-5v-1-wire.jpg


Notice how the Data pin is still jumpered to 3.3 via a 4.7k (or 3.3k) resistor while the positive power lead is now sent to 5v. Also, try to keep all low voltage as far away from the high voltage as possible. If you need to cross wires, try to cross them at a 90* angle.
 
Last edited:
I had all kinds of 185F and also 32F on my system. Sometimes it would would hold out for the brew day other times it would crap out during mash. For me after it saw 185F the system become unstable and would have to be rebooted. Then it may work again for a while or crap right out. Come to find out it was because of the ds18b20 sensors I had shipped from China for about a buck a piece.

Before coming to the bad sensor conclusion... I checked all wiring for noise, solder connections, changed resistor and OHM rating, added a optoisolator on the SSR control side, changed from CAT6 connectors to M12 etc..

Not until I bought good rated sensors (still pretty cheap) did all my 185F problems end. If I was you, recheck all connections and solder points, wire routing, use only one sensor at time and switch sensors for the rims until figured out. I now use seven sensors at a time no problem.

Good Luck!

Found online..

" If the measurement sequence fails due to noise or insufficient power, the subsequent measurement data will be +85°C (185°F) which is the power-on reset value of the temperature register. Be aware that a defective sensor can corrupt the measurement sequence and spoil the measurement for all of the sensors on the bus."

Thanks for the tips. I'll start trouble shooting along these lines. Unfortunately my temp probe is a custom made one that has an extra long stainless tube to fit into my RIMS. I will have to totally take it apart to replace the sensor. I might also just try cutting the wires shorter. I had made them extra long. I have been using them without issue on my Arduino for over a year now, but perhaps something has gone wrong or the Pi is just more fussy than the Arduino was.
 
Before you disassemble your setup, use a VOM and check the sensor. You can use the settings that Auberins supplies.

https://www.auberins.com/index.php?main_page=product_info&cPath=20_39&products_id=322

2) The Datasheet for DS18B20 can be found here. It can measure temperature range from -55°C to +125°C (-67°F to +257°F). To check the DS18B20 with a multimeter, choose the "diode testing" mode, and put the positive testing lead to the white wire (GND) of the sensor. The voltage between white wire (GND) and the red wire (VDD) should be around 0.59V ~ 0.63V; the voltage between white wire (GND) and the yellow wire (DQ) should slightly lower, around 0.49V ~ 0.55V.
 
That's kinda only useful to identify the sensor wiring (like, when an asian supplier goes off and uses their own wire color scheme).
In this case the probe works...usually...and a diode tester isn't going to identify the cause...

Cheers!
 
Sorry, I assumed it would also assist in figuring out if a sensor was bad. From what I've read, it sounds more like interference, but I hate to see someone disassemble a build unless it's a last resort.

Posted via my mobile tracking device
 
I was just merely sharing my personal experiences please dont take anything apart on my account! At the time my sensors were easily changed out with compression fittings.
If you had used the same sensor for a year with your Arduino then one could "assume" that the sensor itself is fine.
BGHSmt7 may have hit it on the head, interference could be the culprit.
Make sure you only use one sensor at a time until you get the ghost.
Its never fun spending extra money but maybe if you found a need for an other sensor in your brew system maybe pick up a cheap but descent sensor for some testing?
Maybe zip-tie it to your rims tube and run some tests on hot water...

Good Luck!
 
Thanks again for all the suggestions. Each one gives me something new to explore.

I’ve not had a lot of time to troubleshoot yet. I did run it last night for a while. It’s hard to see a clear pattern. My best guess is that it it some sort of interference. I’ve taken the sensor cable and routed it away from as much other equipment, motors, and wires as I can. That doesn’t seem to lessen the occurrence of the problem.

It seems like getting the water warmer makes the problem more pronounced, but I can’t say that definitively yet. I need to do some more testing to see if that is true. If so, it would seem to support a problem with the sensor or its attachment. I will likely pull that apart. I have several extra sensors I could swap out. It will only take a few minutes to try.
 
Install craftbeerpi again with the autostart option, i would even remove it completly an pull it again from github. This should take much less time since the basic updates have already been made and all requirements (almost) have been installed.

Code:
Traceback (most recent call last):
File 'runserver.py", line 3, in <module>
from flask import Flask
ImportError: No module named flask
This actually means you are missing flask, I don't know why since it should be installed during the setup process. What is the output if you try to install it manually with:
Code:
sudo apt-get install python-flask

If this installs successfully try to run craftbeerpi again with manually an post the output:
I'm trying to get this up and running but I'm getting the same problem. CBPi doesn't start automatically. When I try to start manually using
Code:
sudo python runserver.py
I get,
Traceback (most recent call last):
File "runserver.py", line 4, in <module>
from brewapp import app, socketio
File "/home/pi/craftbeerpi/brewapp/__init__.py", line 2, in <module>
from flask_sqlalchemy import SQLAlchemy
ImportError: No module named flask_sqlalchemy

Trying this,
Code:
sudo apt-get install python-flask
the next error is,
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-flask is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I've tried removing/recloning/reinstalling CBPi a few times and always the same results. Any ideas?

[edit]NVM I wasn't far enough through the thread reading yet and found out there was v3.0 available, so I installed that.... Seemed to go fine just trying to figure out how to get it running. Apparently I should be able to access it with http://ip-address:5000 but no go. Anyway to tell if it's even running?[/edit]
 
Last edited:
Accordingh to your error, you need to
Code:
sudo pip install flask_sqlalchemy

For version 3.0, the requirements.txt file has these listed as the dependencies

Flask
Flask-SocketIO
eventlet
greenlet
python-dateutil
python-engineio
python-mimeparse
python-socketio
PyYAML
requests
Werkzeug
httplib2
flask-classy
GitPython
 
Last edited:
Thanks for the help! I took a stab atinstalling flask_aqlalchemy manually but I missed including "pip" in the command... I'm totally green with Linux.

The link you gave hit the the nail on the head to with my problems trying to get 3.0 started. I was missing flask_socketio when I tried starting it manually. I'll try these solutions when I get home. Thanks again.
 
Tried you suggestions and didn't get very far... But! I realized I was running the Jessie version of Raspian as recommended for v2.2. I started fresh and used the latest version of Raspian and CBPi 3.0 and all went well without a single hitch. Up and running so problem solved.

Now to get some hardware and start playing around but so far it looks great! One question, I was thinking of using an old tablet I have laying around as a touch screen control panel which would have to operate through WiFi. Is there any reason this is less desirable than using a touchscreen panel run off the I2C bus? (aside from the reliability of being hardwired)

Thanks,
Ryan
 
I actually prefer using a tablet or laptop instead. I've tried touch screen and keyboard/mouse/monitor combos and found that the response was better from a separate device.
 
Awesome. I have a 10" tablet that I was thinking of mounting in the control panel. In the little testing I've done tonight in my garage I had my computer, the pi (through chromium), my phone and the tablet accessing the pi and changes I was making were apparently seamlessly updating through all devices. So it appears I can keep the tablet going as a control interface and still access from a laptop or my phone without disrupting anything.
 
Hello, I have gotten craft beer pi u p and running but wanted to use platinum RTDs instead of the 1 wire sensors. I found a get repo with some SW that should facilitate this here:

https://github.com/thegreathoe/cbpi-pt100-sensor

But I am not sure how to integrate the files on this repo with craft beer pi. Has anyone else had experience integrating such files? I believe it uses CBPI's REST API but I am not sure and I can't find any documentation.
 
@Ph03n1X1:

Try switching your relays to GPIOs 9 thru 26 on the Pi and see if the relays start in their 'on' state. GPIOs 2 thru 8 default to a high pull up at power-on reset of the Pi. When the GPIOs are activated as outputs by software, they drop low until commanded high. This could explain the 'off' state on power up (Pi high connected to Sainsmart input high = relay off) and then 'on' when the software starts (Pi low connected to Sainsmart input high = relay on). Simply inverting the GPIO active level through Wiring Pi won't change the default power-on state. You should also connect Vcc on the relay board to 3V3 on the Pi and JD-Vcc to 5V on the Pi as Ame does or you risk damaging the GPIO on your Pi.

I know the comment is a year old, but thank you!!! I was wondering why GPIO 5 and 6 on my relay board were active at power on until boot-up was complete ...

I cannot off hand think of anything I want with this behavior, any idea why the boards are even using these GPIOs???
 
So, I've been banging my head against the wall on this one for a few days. I'm trying to wire up my brewery controller, which will manage my electrical heating elements during the brewing process, and the issue is I am getting ~240V flowing through both my HLT and Boil receptacles. I have an SSR in between both, which a Raspberry Pi 3 is supposed to control. Regardless whether the SSRs are enabled or disabled, ~240V continues to flow from Power In through the HLT and Boil receptacles. Can't figure this one out, but I'm sure someone out there will point me in the right direction.

Thanks,

David
 
I'm back for another installment of CraftbeerPI for dummies! lol

I took the Terragady board off and used a simple Pi breakout board. Thank you to @golfindia for the suggestion.

As indicated earlier, skip the add on board and try to get stuff working from the PI directly, one thing at a time. Adding a layer of complexity will just add room for errors. Once you get a handle on How It all works, put the add on board on.

So...in my magical merry go round of things not working...The DS18B20 temp sensors are working fine now. (it seems) The Sainsmart relay is working and controlling my pump as expected. But now I cannot get my SSR to fire. I have tried it on several of the GPIO outputs, but I cannot seem to get it to power up. The SSR seems to be fine because if I pull the lead and touch it to the 5V side of my breadboard the relay activates and my heating element warms. For some reason I cannot get the GPIO pins to activate. They don't seem to have any voltage on them if I test them with a multi-meter.

It seems very odd to me that the pump relay works just fine, but I can't get anything to activate for the heater SSR. I've tried it in both CBP 2.2 and 3.0.

This must be something obvious that I'm not seeing. I have tried it with setups for GPIO and GPIOSYS. Is there some configuration that I should be looking at?

So close yet so far! I'm hoping to brew this weekend. Hopefully I can get this figured out by then.
 
'240 is flowing' as in the elements are "actually getting hot", or you are "measuring 240V at the receptacle with the element unplugged"? The latter is normal operation for an SSR, that is why contactors are also used by some people.
 
I'm back for another installment of CraftbeerPI for dummies! lol

But now I cannot get my SSR to fire. I have tried it on several of the GPIO outputs, but I cannot seem to get it to power up. The SSR seems to be fine because if I pull the lead and touch it to the 5V side of my breadboard the relay activates and my heating element warms. For some reason I cannot get the GPIO pins to activate. They don't seem to have any voltage on them if I test them with a multi-meter.

I would post your exact model of SSR, and/or a picture... (1)The SSR may not fire on 3.3V that the GPIO puts out, you may need an SSR that triggers on the lower voltage more reliably, or (2)You may need a transistor to level shift the signal to 5v from 3.3v(this is what the teragaddy boards do.)

My plan if this is needed with my SSR's is to disconnect a relay from the relay board, and put header pins where the relay coil terminals were, this lets me rob a single relay channel of an 8 channel board to drive the SSR...
 
Back
Top