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.
Also MAKE had an article about a bluetooth programming circuit... http://makezine.com/projects/diy-arduino-bluetooth-programming-shield/ Step 4 seems improtant as well for initial setup. In particular... AT+POLAR=1,0 which sets pin 32 to low on bluetooth connection.


bt_shield_circuit3.png
 
I've read this whole thread a few times now, and I'm slightly confused on which unit to purchase. Is the innogear HC-05 still the preferred bluetooth device? Or is the HC-06 now preferred?


I'd say for the sake of having all the features the hc-05 would be the way to go. But if you are incredibly cheap and want to shave 2 bucks off the cost the hc-06 would be sufficient.
 
Also MAKE had an article about a bluetooth programming circuit... http://makezine.com/projects/diy-arduino-bluetooth-programming-shield/ Step 4 seems improtant as well for initial setup. In particular... AT+POLAR=1,0 which sets pin 32 to low on bluetooth connection.


bt_shield_circuit3.png

I tried that one too. The trouble I had is that my pin 32 wouldn't stay low, it just kept blinking. Though, like I mentioned before, we might be talking about different pins on different breakout boards.
 
I tried that one too. The trouble I had is that my pin 32 wouldn't stay low, it just kept blinking. Though, like I mentioned before, we might be talking about different pins on different breakout boards.

http://www.martyncurrey.com/?p=1348

This link that day_trippr already posted actually has it going to pin 34, so I'm not sure how to tell which one you need, but that could be an issue depending on the board used.
 
It looks like avrdude is invoked from programarduino.py[...]

This shows just how weak MS Search is on their desktop OS: it won't search a &*%$#! python file? Seriously? Yup. Weak.

To reprogram with the bluetooth you will need a way to reset the arduino, if you push the reset button just after you click upload in the script you'll see it should work, but obviously you have to physically be at the arduino to push the reset button.

Have to have a reset button, too. None of my four HC-05 modules has one.

It's apparently possible to repurpose/reprogram the hc-05's state pin, wire it to the arduino's reset pin, thereby configuring the hc-05 to reset the arduino after a BT connection is established and making the arduino ready to accept a new sketch. http://forum.arduino.cc/index.php?topic=218049.0 I messed around with this a couple weeks ago and couldn't get it working.

I've googled around and found a couple examples of folks using the hc-05 to wirelessly reprogram arduinos, however none were using the breakout board we are using and I couldn't get working quite right. I could have spent more time on it, YMMV.

No doubt. Considering how much digging I did and the false-starts on finding the right HC-05 to get the first one working with BrewPi, I don't think I have a lot of cycles left to put into a problem that has a rather simple work-around...

Cheers!

[edit] btw/fwiw, there are different HC-05 firmware versions on top of all the different carriers. All that's going to get in the way of coming up with something that works, when you're talking about using specific pin/function features to do things like reset the Arduino...
 
I'm not sure that information applies, that looks to be in regards to putting the HC-05 in AT mode. Also, that is a different board than the one recommended in the OP, I'v only worked with the module day_trippr recommended.
 
Have to have a reset button, too. None of my four HC-05 modules has one.

I was referring to the reset button on the arduino. For about a second after pushing the reset button on the arduino it will look to accept a new sketch, so if you got comms going with the BT module, at the right baud rate, and you time it just right you can push the reset button on the arduino, click upload, and get it to upload a new sketch over bluetooth. - OR - a tinkerer can just come along and just show us how to get these d*** things to work like we want them to.

I don't think I have a lot of cycles left to put into a problem that has a rather simple work-around...
I hear ya on that one.
 
I was referring to the reset button on the arduino. For about a second after pushing the reset button on the arduino it will look to accept a new sketch, so if you got comms going with the BT module, at the right baud rate, and you time it just right you can push the reset button on the arduino, click upload, and get it to upload a new sketch over bluetooth. - OR - a tinkerer can just come along and just show us how to get these d*** things to work like we want them to.


I hear ya on that one.

Ordered an HC-05 so I can actually test all this. But doesnt connecting pin32 (state) pin to the reset do exactly that in sync?
 
Ordered an HC-05 so I can actually test all this. But doesnt connecting pin32 (state) pin to the reset do exactly that in sync?

It's supposed to be configurable that way, didn't work for my BT module. Let us know if you can get it to work.
 
Man I love this autoconnect feature! Tracking fermenters is gonna be awesome. List the instances lcd all on one screen and as they are connected to power they should just start right up.
 
Yup, that was a good find.

Not that reboots happen much here, but I'm a big fan of "intervention not required" functionality.

So I presume you figured out what was ailing the second minion instance?

Cheers!
 
Yeah it won't auto connect unless you have an instance setup for it. As soon as I found the missing "/" in the config file everything fired right up.
 
Did anyone else have a difficult time installing the bluetooth packages? I keep getting errors about bluez not being installed, then I can't get it installed. Im planning on just compiling it from source, but curious if anyone else had to do this.

Running raspbian
 
If you did not do

$ sudo apt-get update

before you tried installing the bluetooth suite, try that first, then run the package install again.

There is a metric crapload of components that get installed with the bluetooth suite - the vast majority are drivers and services for things you'll never use - and with that many (iirc the total package count was close to 100) stale pointers on your system will undoubtedly cause some installs to fail.

So do the update first, then do the package install again...

Cheers!
 
Let the fun begin!

Excellent. I can get those for $35 locally and almost scooted over yesterday to pick one up, but work got in the way.

So the basic question I have (and suspect I already know the answer) is: could you clone an SD card image to a uSD card and boot the Model 2 successfully?

It'd be great if someone else went first this time ;)

Cheers!
 
Excellent. I can get those for $35 locally and almost scooted over yesterday to pick one up, but work got in the way.



So the basic question I have (and suspect I already know the answer) is: could you clone an SD card image to a uSD card and boot the Model 2 successfully?



It'd be great if someone else went first this time ;)



Cheers!



dont quite know what you mean. all my pi's are b+ and the new pi2.



right now im having trouble with getting the second bt instance to auto connect. im running through all the install parameters and everything looks fine (not missing any characters this time, from what i can see) it just refuses to talk to rfcomm1. i can initiate the bt connection manually and still brewpi wont talk to rfcomm1. the only thing thats weird is that i cant echo into pincodes i have to build it manually it says permission denied. but if that were the case then the first one wouldnt connect either.

Edit: Nevermind. I forgot to put the full path to rfcomm1 in the config file
 
dont quite know what you mean. all my pi's are b+ and the new pi2.

The Model 2 uses a completely different SOC from the B and B+ (those two use identical SOCs). User programs aren't likely to be affected, but I expect there are lots of OS implications that could preclude simply cloning an SD card from a working B.

Is the second BT module the same as the first, or different?
Did you try setting the second module up on rfcomm0 in place of the first just to make sure it works ok and whatever's going on is likely something missed in the instancing?

Cheers!
 
Yeah that's how I narrowed it down. I've got this one setup per your instructions and I even used your naming structure. I also setup for eight instances if I ever get around to needing them. I'm about to clone this image for posterity before I start adding my 4 usb connections. I can send you a link to my freshly installed brewpi image of you want. All you'll have to do is copy over your profiles and of course your rpints stuff.

Or maybe not. Forgot I went with a 64gb card this go round. It's going to take like 3 hours just to backup.
 
lol! Ouch - did you spring for a backup card, too?

Anyway, I had read this article when the release was announced and missed the great news for those of us who have over a year into our current multiple Raspbian builds:

"New Raspbian operating system images will also be released today. “They'll be compatible with either the Raspberry Pi or the Raspberry Pi 2,” Richardson said. “People with SD cards that already have Raspbian on them will be able to update (only from their original Raspberry Pi) so that their Raspberry Pi 2 can boot them. They'll need to use apt-get upgrade.” The one catch is that people moving from the earliest Pi versions will have to get the image onto a MicroSD card instead of a standard-sized SD card."

Yeah, baby! So image the card for posterity, do the update/upgrade on the B or B+, then clone to the uSD card and boot the Model 2.

That's a thing of beauty right there... :ban:

Cheers! (I'm feeling drawn to pick one up tomorrow ;))
 
Not a backup card. I'm repurposing the other pi into a retro gaming system. Given my first impressions on the pi2 I see myself getting a few more instead of building the vm host I have slated for this summer. I can fit like 30 of these in the same space as a server big enough to run multiple systems in vm. And it's finally fast enough to run something useful on it.
 
I like to have a backup card at the ready anytime I started playing. I've croaked my RPI's so many times and prefer not to wait for the image restores.

I picked up the Model 2 for $35 along with a new card reader and a couple of 16GB uSD cards today, and have been busy backing up and cloning.

As my development RPi has the biggest SD card in the bunch I can't just use win32diskimager to clone it - the image is too big by a hundred blocks or so - so I'm using the card reader and following a script to build a new bootable drive. Almost done! btw, it's amazing how many stupid useless files the NOOBS image brings to the RPi.

Turns out I'm definitely going to have to rearrange the guts inside my BrewPints crates to fit the Model 2, partially because the additional pair of USB sockets would be blocked by the fan, the microUSB power receptacle moved from the end of the board to the same side as the HDMI socket which puts it in the midst of my patch board.

I do like that they moved the audio socket to the same side, as the HDMI, but otoh it doesn't actually make anything easier for my implementation.

Ah well, another project in the queue...

Cheers!

[edit] So that Noobs Raspbian cloning roadmap linked above worked a treat. My dev crate is up and running on the cloned uSD card (in an adapter) on my B.
Next is to update/upgrade the works then stick the clone in the Model 2 and see what happens next. Fun times! :D
 
Still unable to get bluez installed. Everytime I try to install the bluetooth package, it fails on bluez and i get some permission denied thing happening and then apt-get breaks, wget breaks, and a bunch of other stuff I have to keep removing and reinstalling.

So i downloaded the latest version and am compiling it now. fingers crossed.
 
Still unable to get bluez installed. Everytime I try to install the bluetooth package, it fails on bluez and i get some permission denied thing happening and then apt-get breaks, wget breaks, and a bunch of other stuff I have to keep removing and reinstalling.

So i downloaded the latest version and am compiling it now. fingers crossed.


Are you using a raspberry pi with rasbian? Or a pc with Debian wheezy?
 
Yeah it sounds more like you got a corrupted file somewhere on your sd card. If you have a backup it may be time to implement it.
 
Figured it out...

I have no idea why but some attr and permissions changed on my /lib/udev/ folder causing havoc


cd /lib/
lsattr

./udev had i and a attributes (immutable and appen)
[/code]
Code:
sudo chattr -i ./udev
sudo chattr -a ./udev

Then I forgot to test the install again before doing this, but i changed group permissions also.
Code:
sudo chmod g+w -R ./udev

And then it installed. I have NO IDEA why it was like this.

Not sure if i should change it back either.
 
That's pretty cool.
But you're not actually going to tempt the Fates by running your minion inside a fridge, are you?

Cheers!

(And buy a new phone. I've left my GS4 in the truck outside and made it all the way to my office a good 60 feet and at least four walls away and my el cheapo earpiece was still hooked up)
 
Help me understand How all of this ties together please
1.Arduino uno with lcd, hc05 and tempt. senors box mounted next to fermentation fridge sending info to box 2 over bluetooth
2. RPI box receiving info from box 1 over bluetooth that can be mounted anywhere convenient and send info to box 3 by Ethernet cable or bluetooth
3. Laptop,Desktop computer receiving info from box 2 over bluetooth/cable that displays the BrewPi graphs that are posted here and elsewhere.
Thanks
 
You were doing fine until the "Box 3" thing - unless you're referring to a browser looking into the complex.

For most of us, the RPi runs the show and would be "Box 1". It hosts the web gui for maintenance and display of stats, and runs the script(s) that direct(s) the Arduino(s).

The Arduino(s) would be "Box 2" (or 2A, 2B, 2C, etc, for multiple instances) as by most definitions it's subordinate to the RPi. The temperature probe(s) required by the BrewPi application are attached to Box 2, as are any actuators (opto-coupled relay boards or SCRs).

Box 3 could be any browser looking into the RPi's gui...

Cheers!
 
You were doing fine until the "Box 3" thing - unless you're referring to a browser looking into the complex.

For most of us, the RPi runs the show and would be "Box 1". It hosts the web gui for maintenance and display of stats, and runs the script(s) that direct(s) the Arduino(s).

The Arduino(s) would be "Box 2" (or 2A, 2B, 2C, etc, for multiple instances) as by most definitions it's subordinate to the RPi. The temperature probe(s) required by the BrewPi application are attached to Box 2, as are any actuators (opto-coupled relay boards or SCRs).

Box 3 could be any browser looking into the RPi's gui...

Cheers!
Ok I think I got it.So you just hook up a monitor,keyboard and mouse to the RPI and use it just like a desktop computer?
 
Ok I think I got it. So you just hook up a monitor,keyboard and mouse to the RPI and use it just like a desktop computer?

You can indeed. And I have to say, with the Model 2's performance that's no longer a stretch.

Some of us run more than just BrewPi on our wee machines (see Raspberry Pints to run a metered tap list for kegerator or keezer) which can mean a directly connected monitor is desirable (or even necessary). Keyboard/mouse can be a mini-wireless thing (that's what I use). Network connectivity can be via wire or wireless (I've used both but have my keezer wired now).

Also, the link between the Arduino and the host (RPi or otherwise) is usually over a USB connection. This whole Bluetooth link was something I came up with because I have three coolers that want to be managed by one RPi, but they're too far apart for USB (by a lot). Bluetooth fits the need perfectly, I just had to figure out how to get it to work ;)

fwiw, some folks are actually using laptops either running a Linux distro native or running Debian in a VM under Windows. So you don't necessarily need a RaspberryPi for BrewPi...

Cheers!
 
You can indeed. And I have to say, with the Model 2's performance that's no longer a stretch.

Some of us run more than just BrewPi on our wee machines (see Raspberry Pints to run a metered tap list for kegerator or keezer) which can mean a directly connected monitor is desirable (or even necessary). Keyboard/mouse can be a mini-wireless thing (that's what I use). Network connectivity can be via wire or wireless (I've used both but have my keezer wired now).

Also, the link between the Arduino and the host (RPi or otherwise) is usually over a USB connection. This whole Bluetooth link was something I came up with because I have three coolers that want to be managed by one RPi, but they're too far apart for USB (by a lot). Bluetooth fits the need perfectly, I just had to figure out how to get it to work ;)

fwiw, some folks are actually using laptops either running a Linux distro native or running Debian in a VM under Windows. So you don't necessarily need a RaspberryPi for BrewPi...

Cheers!
Thanks for the explanation.This is more interesting than I originally thought it was.
 
That's pretty cool.
But you're not actually going to tempt the Fates by running your minion inside a fridge, are you?

Cheers!

(And buy a new phone. I've left my GS4 in the truck outside and made it all the way to my office a good 60 feet and at least four walls away and my el cheapo earpiece was still hooked up)


Tempting fate is what I do. And yes my phone and BT have been known to work perfectly up to 220' but never underestimate the bodies ability to absorb radio waves.

On to my foray into smaller and smaller minions... I have to say I'm shying away from getting any minis. I'll stick with nanos I think. Been trying to do double sided layouts using the nano and it's hole layout is retarded when you're trying to route a4 around the board is becoming a pita. What's even more infuriating is trying to tie 2 surface mount 6p6c jacks together in fritzing. And don't even get me started on the fact that none of my hc-05 boards match any of the ones from contrib parts....
 
Tempting fate is what I do.

LOL! Classic!

And I'll watch from a safe distance :D

And don't even get me started on the fact that none of my hc-05 boards match any of the ones from contrib parts....

Did I ever mention what a &%$#@! pain in the @ss it was to find an hc-05 that I could get to work? ;)
I'm not surprised - you could likely have a half dozen different "hc-05" modules that don't match anything!

Do you have your RPi 2 up yet?

Cheers!
 
Hell yeah that thing is lightning fast. I was all like, "ok now for the apt-get upgrade...." Which took like 40 seconds. It's so much easier to remember what command you entered in last when running through docs because it's done already.
 
Back
Top