How To: BrewPi Over Bluetooth

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.
35 years after burning my fingers with a soldering iron, I have finally been tempted back into the world of electronics and after reading through this thread and the other ones and ordering bits and bobs, it's all working. A sincere THANK YOU! to everyone who has contributed to this project especially day_trippr.
I got such a buzz from doing this, now all i have to do is get it off the prototype board and onto a veroboard or pcb. I think I am hooked on the electronics thing and will continue to view this forum avidly for the next big thing. I must however get back to my neglected home brewing(I've ran out for the first time in ages).
THANKS AGAIN EVERYONE.
 
I'm going to read this thread tonight. I have really high hopes that I can make a stand alone with an SSR and single temp probe to run a heater wrap and run a variety of fermentation profiles in my garage this winter. I want to get a stock of beers aging.
 
Just purchased the parts I to make two of these with Relays and a third one to run the second outlet/other two channels in my current brew-pi box. That's relays, temp probes, Arduino Nanos, and the HC-05's. Had $15 in ebay gift cards and I purchased everything from 1 ebay seller to save on shipping.

Need to figure out what my heat blanket solution is going to be. I'm picturing some kind of keg-coozy (I ferment in 5 gallon kegs) with embedded reptile heat tap or something. I'd hate to integrate it permanently though. Going to have to think a bit more.

Also need more thermowells.

My current brewpi is great. Expect some stupid questions when I get around to setting this up!
 
I'm banging my head against the wall on this one. Trying to add the bluetooth functionality using an HC-06 module. I wire it up using the programming configuration and I get the fast blinking light. When I go to upload the HC-06.ino file, I get the following error:

/usr/share/arduino/hardware/tools/avrdude.conf:332: programmer type must be written as "id_type"

Any idea what I'm doing wrong?
 
It would be easier to use ide in Windows. and as far as the hc-06 is concerned I have never used one and while they are supposed to work the same way I would recommend an hc-05
 
It would be easier to use ide in Windows. and as far as the hc-06 is concerned I have never used one and while they are supposed to work the same way I would recommend an hc-05

Thanks, wbarber. I've stitched over to the Windows Arduino IDE and I've gotten past that issue. I'm now having trouble with the uploading and config using the serial monitor. I get the:

Starting Config




Done!

with no programming in between. I'm rereading the thread to see if I missed some help somewhere.
 
Like I said u might have better luck with the hc05 preferably one with a button. you hold down the button and plug in power at the same time and it's automatically in uart mode. day_tripper has more experience with the models that have no button
 
There are walkthroughs out there for what you are trying to do id suggest googling it and following someone's tutorial for the hc06
 
Just spent 3+hours tying to get the HC-06 working. I gave up and ordered an HC-05 from eBay. I hope it is the right one because the Bluetooth connection is the last thing I need to test on my custom pcb shield.
 
Sorry, been busy as hell all day, didn't get into HBT 'til now.

Anyway, I've had an HC-06 running since a few days after I got the HC-05 working.
The wiring is virtually identical (if offset by a pin), otherwise it just worked.
Here are my notes, followed by the ino file...

Cheers!

Code:
Configure HC-06 for use with BrewPi

Load sketch HC-06_setup.ino into Arduino IDE

- change ROBOT_NAME "HC-06_1" value to desired name for the HC-06

- If this is the first time setting up the HC-06, try the BLUETOOTH_SPEED setting of 9600 baud.
- If that doesn't work, try using the BLUETOOTH_SPEED setting of 57600.
- If that doesn't work, try using BLUETOOTH_SPEED setting of 38400.

- change the pairing pin value from "1234" to desired value

Upload the sketch

Launch the Arduino IDE serial monitor
- setting should be 9600 baud

You should see the following:

Starting config
OK
OKlinvorV1.8
OKsetPIN
OKsetname
OK57600
Done!

If you see this instead...

Starting config


Done!

...you have a wiring error or a baud rate mismatch


Below is HC-06_setup.ino

Code:
/*

This sketch is for configuring the hc-06 bluetooth chip to work with BrewPi.

Author Credit: Glen Arrowsmith (@garrows)

Minor edits made

*/

#define NODE_NAME "BP_SAT1"

// If you haven't configured your device before use this
#define BLUETOOTH_SPEED 9600
// If you are modifying your existing configuration, use this:
//#define BLUETOOTH_SPEED 57600

#include <SoftwareSerial.h>

// Swap RX/TX connections on bluetooth chip
//   Pin 10 --> Bluetooth TX
//   Pin 11 --> Bluetooth RX
SoftwareSerial mySerial(10, 11); // RX, TX


/*
  The posible baudrates are:
    AT+BAUD1-------1200
    AT+BAUD2-------2400
    AT+BAUD3-------4800
    AT+BAUD4-------9600 - Default for hc-06
    AT+BAUD5------19200
    AT+BAUD6------38400
    AT+BAUD7------57600 - BrewPi operating baud rate
    AT+BAUD8-----115200
    AT+BAUD9-----230400
    AT+BAUDA-----460800
    AT+BAUDB-----921600
    AT+BAUDC----1382400
*/


void setup()
{
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }
  Serial.println("Starting config");
  mySerial.begin(BLUETOOTH_SPEED);
  delay(1000);

  // Should respond with OK
  mySerial.print("AT");
  waitForResponse();

  // Should respond with its version
  mySerial.print("AT+VERSION");
  waitForResponse();

  // Set pin to 1234
  mySerial.print("AT+PIN1234");
  waitForResponse();

  // Set the name to NODE_NAME
  mySerial.print("AT+NAME");
  mySerial.print(NODE_NAME);
  waitForResponse();

  // Set baudrate to 57600
  mySerial.print("AT+BAUD7");
  waitForResponse();

  Serial.println("Done!");
}

void waitForResponse() {
    delay(1000);
    while (mySerial.available()) {
      Serial.write(mySerial.read());
    }
    Serial.write("\n");
}

void loop() {}
 
Sorry, been busy as hell all day, didn't get into HBT 'til now.

Anyway, I've had an HC-06 running since a few days after I got the HC-05 working.
The wiring is virtually identical (if offset by a pin), otherwise it just worked.
Here are my notes, followed by the ino file...

Cheers!

No need to apologize, you have helped me (everyone!) tremendously with all of your advice.

I've checked and re-checked the wiring. I'm going straight to the uno, not using my shield. I'm using Windows IDE on my laptop. I've tried all three baud rates. I get no love, only the Starting Config...done!

I'm wondering if I have a bad module. Can't think of anything else to try.:confused:
 
Yes it's in there somewhere. Also if you are using the kind with the button on it. You need to hold down the button when entering commands if you want them all to return a response.

wbarber - can you please explain this in more detail? I've got an hc-05 with the EN and State pins and a reset button. I get it to flash slowly, but when I enter a command, nothing shows up on screen, not even the command I enter.
 
Sort hung must have gotten mixed up. you hold down the button while plugging in the power and it will enter uart. then you should be able to enter commands. when you see it say starting programming done! that's the initialization script running on the uno. and "programming" the hc05 to accept commands
 
I couldn't make an HC-06 work, so I ordered what I thought was the same model HC-05 that day_trippr used in the first post. When it arrived, it was different than the picture on the Amazon.com ad, and had the EN pin instead of KEY, and it had a button.

I tried in vain for at least 4 hours to make it work with the resistor dividers and many different wiring combos and with pushing the button before powering up, after powering up, and any other way I could think of. I could get the slow blink, but I could never get the AT commands to do anything on the serial monitor.

What finally ended up working was eliminating the resistors and going straight through to the UNO using the pins and the script that day_trippr calls for in the how-to.

I then wired the bluetooth up in the operating mode and spent two hours trying to troubleshoot serial port issues. Then I realized that I am an idiot and if the resistor divider didn't work for the programming, it probably wouldn't work for the operating mode. So I went straight from TX to RX and RX to TX, and it worked the first time.

I've already ordered the same bluetooth module from the original seller, but it is on the slow boat from China and won't be here until May. Until then, I figure that I'll take a chance on screwing up the module that I have by not using the resistor divider. In total, more than 6 hours spent on a $7 piece of equipment. But somehow that made it that much sweeter when I finally got it working.

Any idea why the resistor dividers would cause a problem with the programming and operating modes?

Edit: On a lark, I switched the RX and TX wires and tried it again over the resistor divider and it worked! I now have it wired up exactly as called for in the OP and it seems to be doing what it is supposed to. It makes me wonder if the wires were swapped on the programming mode, too, and if it would have worked in that mode. I'm not going to take it apart just to find out.
 
Maybe you had thought that tx went to tx when it should go to rx and vice versa a simple easy to miss mistake. I was able to get mine to do the same with regards to not dividing the voltage, but it is not recommended. but in my experience most of the ones I got that are basically exactly like yours, with exception of one I think iirc, all came with the correct values already programmed in. I only ever reprogrammed so the device would show up with a different name. that's why I like that model so much. it's easy to program and in a regular case you wouldn't even need to.
 
Had mine off and powered down for a few months and it doesnt seem to want to work upon turning it on. WiFi won't connect, brewpi service won't fully launch, etc. Are these really that unstable?

I was having internet issues that day, so I scrapped my repair effort, but I'm wondering if I'll have to go through an entire software rebuild. I'll try starting with an update when I get back to it.
 
I'm stuck on step #9 I have no idea how to get to the LXDE screen. I'm doing all of this with PUTTY on my windows pc.
9. Pairing the BT/Serial module to the BT/USB dongle:

On the LXDE Desktop: launch Menu>Preferences>Bluetooth Manager (make a desktop shortcut while you're in the menu)

In Bluetooth Manager GUI:

Click Search: Find available BT devices

HC-05 will appear (listed as Unknown with its device address)

Select HC-05 (click once on the item)

Click the green Plus icon to add HC-05 to the Known Devices list

Click the Key icon to pair with HC-05
- pairing code is 1234

The HC-05 device should now have a Key (paired) and Star (trusted) icon
The BT/Serial module LED should now be blinking slowly (~once per two seconds)

Click Setup to view the local serial port associated with the HC-05 connnection - it should be /dev/rfcomm0
The BT/Serial module LED should now be double-blinking slowly (~two blinks per two seconds)
 
I'm stuck on step #9 I have no idea how to get to the LXDE screen. I'm doing all of this with PUTTY on my windows pc.

That's just the Raspberry Pi gui. In other words, just the desktop that boots when the Pi boots (assuming you have that set as the default boot).
 
The LXDE screen is not the default. I get a bunch of text that ask me to log in then it goes to my brewpi

You can run a VNC server on the Raspberry Pi to get the full graphical interface. Or try this through Xserver. I'm at work and can't run it from here, but give it a whirl:


If you want to see a complete dektop, you could either create a new Xserver or use Xephyr to nest a Xserver in the one you are currently using.

Well first create a new nested Xserver:

user@host $ Xephyr :1 -screen 800x600 &

A window called "Xephyr on :1" should spawn. Ssh into the remote host an forward the display to the created display:

user@host $ DISPLAY=:1 ssh -Y username@remotehost

Now start a session on the remotehost, in my case LXDE:

user@remotehost $ lxsession

You should now see the desktop in Xephyr. hf
 
Ok I was able to open up a vcn session using tightvcn service. All I get is a giant raspberry logo with a flashing wastebasket logo.

It might be a permission issue for the user you set up for the TightVNC service. Try this code to add permissions for that user for the audio and video permissions:

usermod -G users,audio,video <userid>
replacing <userid> with the username you created.
 
It might be a permission issue for the user you set up for the TightVNC service. Try this code to add permissions for that user for the audio and video permissions:

replacing <userid> with the username you created.
I ran out of gas tonight.I'll try again in the morning.Biggest hurdle is I don't know anything about unix.I'm going to search for instructions that I can go through PUTTY.Thanks for the help so far.
 
If you're going to run Bluetooth I suggest you get a screen and a keyboard and do the bt setup portions directly from the desktop on the pi. sshing or vncing in is going to give you issues. the gui bt manager is actually pretty decent on the pi and I don't even know the commands to do everything you need to do in terminal in order to get everything setup like the gui does. if you hook up a screen and it goes to a command prompt instead of desktop, then run raspi-config and set it up to boot into desktop at start. you may wanna also make sure you expanded the partition while you're there.
 
I'm pretty proud of my self of how bad I hosed my Brewpi.looks like I will be starting over from scratch.I did learn a lot so far.I can get a remote terminal screen and GUI with windows Remote desktop connection and Putty.
 
If you're going to run Bluetooth I suggest you get a screen and a keyboard and do the bt setup portions directly from the desktop on the pi. sshing or vncing in is going to give you issues. the gui bt manager is actually pretty decent on the pi and I don't even know the commands to do everything you need to do in terminal in order to get everything setup like the gui does. if you hook up a screen and it goes to a command prompt instead of desktop, then run raspi-config and set it up to boot into desktop at start. you may wanna also make sure you expanded the partition while you're there.
I don't know what I did but my GUI does not look or act like all the examples I have seen with GIS and YouTube videos.I'm going to do a
sudo apt-get update
sudo apt-get upgrade
and see what happens. If this doesn't work I will start over.
 
I got the Hco5 paired to the rpi. now i'm trying to get the brewpi software to work with my uno.
Sudo apt-get upgrade fixed the GUI on the rpi.
i had to turn off the bluetooth manager,then turn it back on to get it to work
all is good with the Hc05 and the rpi.
I'm having trouble with brewpi finding my uno board. same problem when it was connected with a usb cable.
 
You need to edit the BrewPi config file to point to the rfcomm port that the BT module is paired to.

Eg: assumes your BT module connected to rfcomm0

Code:
$ sudo nano /home/brewpi/settings/config.cfg

scriptPath = /home/brewpi/
wwwPath = /var/www/brewpi/
port = /dev/rfcomm0
altport = /dev/null
boardType = uno

Save, exit, and restart the BrewPi script to see if it'll find the Uno via the rfcomm port...

Cheers!
 
Back
Top