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.
I think I might have got an hc-06. I can't tell though. There is no "key" pin just "state" and "en"
 
If you have a Windows box with a BT dongle installed you can put power on your HC-0? and use the BT management gui to scan for devices. As I recall the HC-05 and HC-06 clearly identified themselves. Or - as long as the HC hasn't been renamed - the BT management gui on the RPi will identify the HC-05 or HC-06 (the default names are typically the module types).

fwiw, I've been running an HC-06 on my debug/proto minion just fine.
I added instructions on how I got it configured a few months back...

Cheers!
 
Yeah I see that I just don't know which one I have since it doesn't have the same pinout
 
Does the wattage on the resistors matter? And does it matter that I only have 2.2 k ohm resistors instead of 2k
 
You mean for the level-shifting dividers?
1/8w would be fine, I doubt the input impedance is low enough to pull an entire milliamp.

The 1:2 dividers shift 5V down to 3.3V. 1:2.2 would bring that level up to 3.44V - a wee bit above what we're looking for, but all of this assumes a solid 5V output from the AVR - and ignores resistor tolerance (which for blister-packed resistors tends to be 5 to 10%).

So I wouldn't worry about the slight potential for Vih violation...

Cheers!
 
Ok all my resistors are 1/4 watt or 1/2 watt. I would have to find a source for 1/8 watt resistors since radioshack doesn't carry them
 
No worries, you can always go larger. I tend to use 1/8W where I can to save real estate, and I have bags of random value axials from "back in the day"...

Cheers!
 
Now I just need to find a system I can do all this on. Or should I say I need to wait for the bluetooth dongle to come in. I figured my android would at least show the BT device. My windows machine won't load up the ino files for some reason and my rpi is busy. Got an rpi2 coming so I'll have that to fiddle with soon.
 
actually. could you check that hc-06 ino file. its throwing up java errors when i try to load it up
 
Java errors? When loading the sketch into the Arduino IDE?

I just did a binary compare to what's in the rar file and what's on my RPi and they're identical...

Cheers!
 
oh how i wish i could tell the difference between 05 and 06. i cant get either to work. i dont even know if the pinout is right. and i figured out whars wrong with the file in the rar. its named HC-06.ino when it should be labeled HC_06.ino IDE dont like hyphens
 
Been there. As I think I said at the beginning of this, it took a few tries before I got an actual HC-05.
I think I put pictures of what I've gotten to work somewhere near the beginning of this thread - if only in the wiring diagrams.

But you should still be able to ID what you have via a BT host. Both HC-05 and HC-06 will advertise as client devices to a receptive host, even if their serial ports aren't connected to anything...

Cheers!
 
Yeah I already got another on the way from the seller you recommended. And Amazon is refunding the one I have. It would be nice if there was at least a little piece of paper that comes with them saying what each pin is for. I assumed the state pin was an led pin. I don't know what en means though, maybe enumerator, possible meaning key. I'll have to wait for the dongle to come in. I can't believe that my android tablet can't see it either, maybe it is defective.
 
How many minions do you think the single bt dongle can handle. I've had an idea floating around in my head since I got this nano. Thinking of maybe building a large fermentation closet in the future and maybe I'd be able to make these little guys into roaming ferm jackets. Self contained units that just Velcro around a vessel and carry the heater, controller and probes all in one.
 
I've had three of my BT minions running for weeks on one host dongle without issue.

When you think about it there's so little traffic between the host and minion there's no telling how many could be supported. I'd be more concerned that the host Bluetooth support package (bluetooth bluez-utils blueman) might top out of rfcomm ports first...

Cheers!

[edit] If you could post a decent close-up of the back side of the carrier card for your HC-whatever I may be able to ID it.
I saw a lot of those darned things in my quest...
 
All of these BT/serial modules I've seen so far expect to be run from a 5V source, and have an on-board linear 3.3V regulator that the chip we're talking to uses. Technically, driving the RX (and KEY for the HC-05) input pin(s) directly from a 5V AVR is a significant violation of the VihMax spec.

Come to think of it, I answered this question already ;)

I'll see what I can come up with on your module.
I can already say that's the first one I've seen with a five pin header.

[edit] So that's Yet Another HC-05 Variation.
Check out this page.

The important part is this:

"Once everything is connected, still with the Arduino off, do the following:
– Remove the 5V connection to BT VCC
– Connect the Arduino to the host computer (turn it on)
– Press and hold the button switch on the BT module
– Connect BT VCC to 5V (while still pressing the button), the LED should come on.
– Release the button switch and the LED will flash on/off every second. This indicates AT mode.
You can now remove the 3.3V to BT EN header. The BT module will remain in AT mode."

So you can use the same wiring as I've documented, and the same sketch, you just need to go through the above contortion to get into AT Mode...

Cheers!
 
Looking further online it seems that do have an hc-05 at least all the listings for this board are hc-05's. The en should be key as far as I can tell. But every time I hook it up that way, the BT board stops blinking all together. I need to do some more troubleshooting. Maybe I'm missing something. Maybe it's got something to do with the ftdi chip on this nano. I'll try later to do all this programming on an uno. Maybe that's my issues. From what I've seen a couple others doing online, they just hook the rx/tx lines in directly to the UNOs rx/tx and their off. But obviously they are using different code and for different purposes.
 
Ran the same setup on a licensed uno and I'm having the same problems. Either my board is too different or I'm just missing something.
 
Have you gotten to where the LED on the module is flashing roughly once per two seconds?

If you can get that far, the rest is baud rate matching the sketch to the board...

Cheers!
 
No it just keeps blinking fast. Now if I try to pair with my tablet, it pairs but doesn't connect. Then the BT module will blink at around the speed you're talking about. But even then I still cannot get a command through
 
Don't bother trying to get into AT mode while the module is linked to a BT agent, I'm pretty sure I never got that to work. That would make sense as a random text string could accidentally put the device into AT Command Mode.

I'd try the instructions from that site I linked, with different baud rates, particularly 9600, 38400 and 57600...

Cheers!
 
ok everything as far as the programming goes has worked so far. except for the command AT+NAME doesnt returm anything. now im onto getting it up and running with the brewpi code
 
Thanks for all the help day_tripper. Now I've got this one to start to talk back I'm kinda sorry I got Amazon to refund the money for it, well not too sorry. Now I'll have 2 and I got them for half off with free shipping :)
 
I know for this to work I cannot use usb for serial, but could I still use usb just for power? Could I use a mini usb wall wart or do I specifically need to power it using the vin connection.
 
Yeah you can use the wall wart. Serial, as you mentioned, is the reason you don't want to plug the usb into the computer, the usb dongle and the computer trying to talk to the arduino over the same TxRx pins would be confusing, but since the wall probably doesn't want to talk with the arduino your lines should be clear.

I don't know what the power requirements of the nano or its voltage regulators are but you might be limiting your self with a typical 5v/1a usb wall wart. Plug it in and see if it works, if you have power issues then get your self a 7+v wall wart and plug into vin.
 
Thanks for all the help day_tripper. Now I've got this one to start to talk back I'm kinda sorry I got Amazon to refund the money for it, well not too sorry. Now I'll have 2 and I got them for half off with free shipping :)

Excellent! What did you finally do to get it to listen to AT commands?
It'd be helpful for the next person who gets one of that variant.

I know for this to work I cannot use usb for serial, but could I still use usb just for power? Could I use a mini usb wall wart or do I specifically need to power it using the vin connection.

If you have a 5V wall wart with an USB plug, give it a try. The worst thing that'll happen is BrewPi will notice it can't talk to the AVR anymore - because the ATMEGA16U2-MU USB-UART chip woke up and grabbed the serial connection.

I can't find anything that clearly indicates what happens in that configuration.
What you hope for is the fact that there's no actual USB dialog happening that the function that enables the UART macro outputs - doesn't....

Cheers!
 
I'm having the same AT problems right now. My Brewpi is running on a very old Dell Laptop, and I have the same HC-05 that you recommended at the beginning of this thread. Everything was going well until I tried to upload the sketch. I kept having issues with the computer finding the proper port '/dev/ttyacm0' to upload to (Even though I'm positive had it configured correctly) once I was able to successfully upload the sketch I was able to get the BT into command mode by unplugging and reattaching the VCC wire. Now it blinks the once every two seconds or so, but when I tried to enter an AT command the response I got was a bunch of wingding characters that don't make any sense. Rectangles, small letters that for certain aren't English. The worst part is that after just a few attempts to install AT commands, the laptop begins sending me error messages that it, once again, can't find the port. I've checked my wiring and it's solid but i'm really not sure what to do next
 
Try adjusting the baud rate for the serial to the bluetooth device in code, ie the software serial device.

The line "BTSerial.begin(38400);" is the line the line you want. Mine came set to 9600 baud.
 
I'm afraid I'm not going to be very handy with these non-standard implementations as I have zero experience running BrewPi on a pc.
So right off the bat I'm having trouble grasping what you're actually doing.

What's the pc doing in this picture?
Are you connecting the serial side of the HC-05 to an UNO as I've shown?
Then running the Arduino IDE to upload the sketch?

Or what?

Cheers!
 
Ok I've been at work today. I followed the link you gave me. I have a button on mine so I followed the option 1 for hc-05 with a button. It was the simplest and it worked. I had to use the sketch from the site and not the one from this forum. He even has a nano hooked up to his so the instructions were spot on for me. I had just overlooked the part where you posted the link the first time I think a new thread page populated or something. The nano has an ftdi chip so the brewpi implementation is a little different I'll post my symlink file with how I set up my device so I could flash revC hex to it. The only other changes were just changing the folder names and cron jobs to correspond to what I named the nano.
 
notice how the ftdi chip is listed under ttyusb

raspberry pi brewpi.png
 
Very good - and thanks very much for the follow-up, I appreciate it. With all these HC-0? variants out there - plus different Arduinos to boot - one can easily imagine folks (and not necessarily just HBTers) will eventually land here if they're heading down the same road - thanks to Google Fu :)

I'm surprised the Nano needs any special treatment wrt connecting a serial device. In theory it's just a shrunk-down Uno - it even has a USB/serial bridge chip like the Uno.

fwiw, here's my rules file for my keezer system. The only directly connected (USB) Uno is the top one, the rest are BT minions scattered around the shop. But they all use the AT16U2 serial numbers for the symlinks.

Code:
SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="85336303532351F0A031", SYMLINK+="brewpi1", GROUP="brewpi"
SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="754373038303510BF870", SYMLINK+="brewpi2", GROUP="brewpi"
SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="5543131323835130B160", SYMLINK+="brewpi3", GROUP="brewpi"
SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="55431313238351104021", SYMLINK+="brewpi4", GROUP="brewpi"


Strange. But I couldn't fill a virtual thimble with my Nano knowledge, anyway...

Cheers! :mug:
 
I'm afraid I'm not going to be very handy with these non-standard implementations as I have zero experience running BrewPi on a pc.
So right off the bat I'm having trouble grasping what you're actually doing.

What's the pc doing in this picture?
Are you connecting the serial side of the HC-05 to an UNO as I've shown?
Then running the Arduino IDE to upload the sketch?

Or what?

Cheers!

Yeah, that was the attempt, anyway. In this picture I had the UNO hooked to the pc with the USB, the HC-O5 hooked up in accordance with the first diagram you provided, and I had entered the Serial Monitor to try to change the baud rate. It was at this point that I starting having issues, beginning with the whole "No response to AT commands" thing

I then attempted to go with plan B: Instead of using my pc, I used my 'pi in the hopes of programming the HC-O5 there, then using the pc for actual Brewpi communication(the 'pi is quite a long ways away from my fermentation fridge, probably further than an acceptable bluetooth range). Anyway, after hooking up the Uno to the pi, changing settings and uploading the sketch, everything seemed good until it was time for AT commands. Still no response. Changing the baud rate in the dropdown menu caused the same issue as before; the issue of it "Forgetting" about the serial port and suddenly telling it it cannot be found.

I haven't tried the suggestion of changing the rate in code yet though. I see the 38400 line in the sketch, are you suggesting that I change that 38400 to 9600 before writing the sketch?
 
In this picture I had the UNO hooked to the pc with the USB, the HC-O5 hooked up in accordance with the first diagram you provided, and I had entered the Serial Monitor to try to change the baud rate. It was at this point that I starting having issues, beginning with the whole "No response to AT commands" thing

You cannot have the UNO hooked up via USB to an actual USB host port when you want to attach the Bluetooth/Serial module. If the Uno "hears" an actual USB device, the USB/Serial bridge chip will take over the same serial RX/TX pins that the BT module is wired to. I'm pretty sure I mention that in my write-up.

For the other question, one of the HC-05 modules I received had the operational baud rate already set to 57.6K (what we need to communicate with the Uno). So you never know what you're going to get. To cope you need to change the sketch setting as was mentioned by thekraken. The most likely settings would be 9600, the default 38400, or 57600...

Cheers!
 
Very good - and thanks very much for the follow-up, I appreciate it. With all these HC-0? variants out there - plus different Arduinos to boot - one can easily imagine folks (and not necessarily just HBTers) will eventually land here if they're heading down the same road - thanks to Google Fu :)



I'm surprised the Nano needs any special treatment wrt connecting a serial device. In theory it's just a shrunk-down Uno - it even has a USB/serial bridge chip like the Uno.



fwiw, here's my rules file for my keezer system. The only directly connected (USB) Uno is the top one, the rest are BT minions scattered around the shop. But they all use the AT16U2 serial numbers for the symlinks.



Code:
SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="85336303532351F0A031", SYMLINK+="brewpi1", GROUP="brewpi"

SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="754373038303510BF870", SYMLINK+="brewpi2", GROUP="brewpi"

SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="5543131323835130B160", SYMLINK+="brewpi3", GROUP="brewpi"

SUBSYSTEM=="tty", KERNEL=="ttyACM*", ATTRS{serial}=="55431313238351104021", SYMLINK+="brewpi4", GROUP="brewpi"





Strange. But I couldn't fill a virtual thimble with my Nano knowledge, anyway...



Cheers! :mug:


I have a sainsmart nano model, and for some stroke of luck I think I even got a legitimate ftdi chip on this one. It doesn't show up under acm but I am using a virtual machine, so who knows.
 
Back
Top