[Unit]
Description=RFCOMM service
After=bluetooth.service
Requires=bluetooth.service
[Service]
ExecStart=/usr/bin/rfcomm connect hci0 xx:xx:xx:xx:xx:xx 1
[Install]
WantedBy=multi-user.target
pi@brewpi:~ $ sudo systemctl status rfcomm1
● rfcomm1.service - RFCOMM service
Loaded: loaded (/etc/systemd/system/rfcomm1.service; enabled)
Active: active (running) since Thu 2017-03-30 15:30:49 CEST; 37min ago
Main PID: 606 (rfcomm)
CGroup: /system.slice/rfcomm1.service
└─606 /usr/bin/rfcomm connect hci0 20:16:07:25:12:63 1
Mar 30 15:30:49 brewpi systemd[1]: Started RFCOMM service.
pi@brewpi:~ $ sudo systemctl status rfcomm2 -l
● rfcomm2.service - RFCOMM service
Loaded: loaded (/etc/systemd/system/rfcomm2.service; enabled)
Active: inactive (dead) since Thu 2017-03-30 15:30:53 CEST; 37min ago
Process: 604 ExecStart=/usr/bin/rfcomm connect hci0 20:16:07:25:09:80 1 (code=exited, status=0/SUCCESS)
Main PID: 604 (code=exited, status=0/SUCCESS)
Mar 30 15:30:49 brewpi systemd[1]: Started RFCOMM service.
Mar 30 15:30:53 brewpi rfcomm[604]: Can't create RFCOMM TTY: Address already in use
If you had it all running without a problem on the pi b then why don't you just use the same sd card and put it in the zw. then all you should need to do is update the firmware
sudo rfcomm bind xx:xx:xx:xx:xx:xx 1
pi@raspberrypi ~ $ ls /dev/rf*
/dev/rfcomm0 /dev/rfcomm1 /dev/rfkill
[Errno 113] could not open port /dev/rfcomm0: [Errno 113] No route to host: '/dev/rfcomm0'
Could not configure port: (25, 'Inappropriate ioctl for device')
pi@raspberrypi ~ $ dmesg | grep Blue
[ 38.956871] Bluetooth: Core ver 2.21
[ 38.957085] Bluetooth: HCI device and connection manager initialized
[ 38.959091] Bluetooth: HCI socket layer initialized
[ 38.959131] Bluetooth: L2CAP socket layer initialized
[ 38.959227] Bluetooth: SCO socket layer initialized
[ 38.998342] Bluetooth: RFCOMM TTY layer initialized
[ 38.998392] Bluetooth: RFCOMM socket layer initialized
[ 38.998429] Bluetooth: RFCOMM ver 1.11
[ 39.016018] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[ 39.016044] Bluetooth: BNEP filters: protocol multicast
[ 39.016086] Bluetooth: BNEP socket layer initialized
pi@raspberrypi ~ $ /etc/init.d/bluetooth status
[ ok ] bluetooth is running.
pi@raspberrypi ~ $ hciconfig -a
pi@raspberrypi ~ $
pi@raspberrypi ~ $ hciconfig -a
hci0: Type: BR/EDR Bus: USB
BD Address: 00:1A:7D:DA:71:0B ACL MTU: 310:10 SCO MTU: 64:8
UP RUNNING
RX bytes:15380 acl:309 sco:0 events:388 errors:0
TX bytes:3111 acl:98 sco:0 commands:151 errors:0
Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: SLAVE ACCEPT
Name: 'raspberrypi-0'
Class: 0x420100
Service Classes: Networking, Telephony
Device Class: Computer, Uncategorized
HCI Version: 4.0 (0x6) Revision: 0x22bb
LMP Version: 4.0 (0x6) Subversion: 0x22bb
Manufacturer: Cambridge Silicon Radio (10)
pi@brewpi:~ $ hciconfig -a
hci0: Type: BR/EDR Bus: UART
BD Address: B8:27:EB:9E:57:D7 ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING PSCAN
RX bytes:30262 acl:657 sco:0 events:574 errors:0
TX bytes:5467 acl:184 sco:0 commands:171 errors:0
Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH SNIFF
Link mode: SLAVE ACCEPT
Name: 'brewpi'
Class: 0x0c0000
Service Classes: Rendering, Capturing
Device Class: Miscellaneous,
HCI Version: 4.1 (0x7) Revision: 0xb6
LMP Version: 4.1 (0x7) Subversion: 0x2209
Manufacturer: Broadcom Corporation (15)
pi@brewpi:~ $ ls -al /dev/rfc*
ls: cannot access '/dev/rfc*': No such file or directory
pi@brewpi:~ $ sudo bluetoothctl
[NEW] Controller XX:XX:XX:XX:XX:XX brewpi [default]
[bluetooth]# agent on
Agent registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# scan on
Discovery started
[CHG] Controller XX:XX:XX:XX:XX:XX Discovering: yes
[NEW] Device XX:XX:XX:XX:XX:XX XX-XX-XX-XX-XX-XX
[NEW] Device XX:XX:XX:XX:XX:XX [TV] Living room
[NEW] Device XX:XX:XX:XX:XX:XX Chamber 1
[...]
[bluetooth]# scan off
[...]
Discovery stopped
[CHG] Controller XX:XX:XX:XX:XX:XX Discovering: no
[bluetooth]# pair XX:XX:XX:XX:XX:XX
Attempting to pair with XX:XX:XX:XX:XX:XX
[CHG] Device XX:XX:XX:XX:XX:XX Connected: yes
Request PIN code
[agent] Enter PIN code: 1234
[CHG] Device XX:XX:XX:XX:XX:XX UUIDs: 00001101-0000-1000-8000-00805f9b34fb
[CHG] Device XX:XX:XX:XX:XX:XX ServicesResolved: yes
[CHG] Device XX:XX:XX:XX:XX:XX Paired: yes
Pairing successful
[CHG] Device XX:XX:XX:XX:XX:XX ServicesResolved: no
[CHG] Device XX:XX:XX:XX:XX:XX Connected: no
[bluetooth]# trust XX:XX:XX:XX:XX:XX
[CHG] Device XX:XX:XX:XX:XX:XX Trusted: yes
Changing XX:XX:XX:XX:XX:XX trust succeeded
[bluetooth]# info XX:XX:XX:XX:XX:XX
Device XX:XX:XX:XX:XX:XX
Name: Chamber 1
Alias: Chamber 1
Class: 0x001f00
Paired: yes
Trusted: yes
Blocked: no
Connected: no
LegacyPairing: yes
UUID: Serial Port (00001101-0000-1000-8000-00805f9b34fb)
[bluetooth]# exit
Agent unregistered
[DEL] Controller XX:XX:XX:XX:XX:XX brewpi [default]
pi@brewpi:~ $
pi@brewpi:~ $ ls -al /dev/rfc*
ls: cannot access '/dev/rfc*': No such file or directory
pi@brewpi:~ $ sudo rfcomm bind 0 XX:XX:XX:XX:XX:XX 1 > /dev/null 2>&1 &
[1] 3345
pi@brewpi:~ $ ls -al /dev/rfc*
crw-rw---- 1 root dialout 216, 0 Mar 16 13:31 /dev/rfcomm0
[1]+ Done sudo rfcomm bind 0 XX:XX:XX:XX:XX:XX 1 > /dev/null 2>&1
pi@brewpi:~ $
[Unit]
After=bluetooth.service
[Service]
ExecStart=/usr/bin/rfcomm bind 0 XX:XX:XX:XX:XX:XX 1 > /dev/null 2>&1 &
[Install]
WantedBy=default.target
pi@brewpi:~ $ sudo chown root:root /etc/systemd/system/rfcomm0.service
pi@brewpi:~ $ sudo chmod 664 /etc/systemd/system/rfcomm0.service
pi@brewpi:~ $ sudo systemctl daemon-reload
pi@brewpi:~ $ sudo systemctl enable rfcomm0
Created symlink /etc/systemd/system/default.target.wants/rfcomm0.service → /etc/systemd/system/rfcomm0.service.
pi@brewpi:~ $
pi@brewpi:~ $ sudo systemctl status rfcomm0
● rfcomm0.service
Loaded: loaded (/etc/systemd/system/rfcomm0.service; enabled; vendor preset:
Active: inactive (dead) since Sat 2019-03-16 13:43:59 CDT; 40s ago
Process: 290 ExecStart=/usr/bin/rfcomm bind 0 XX:XX:XX:XX:XX:XX 1 > /dev/null 2>&1 & (code=exited, status=0/SUCCESS)
Main PID: 290 (code=exited, status=0/SUCCESS)
Mar 16 13:43:59 brewpi systemd[1]: Started rfcomm0.service.
@LBussy Continuing the topic form the other thread. Im going to go ver your procedures you spelled out in these 2 posts. But at first glance i see it is for brewpi. Would it work the same with fermentrack, before i dig into this??[ETA: In order to "Future-Proof" this article, I have created a page for it on the BrewPi Remix website. You can read the most up to date version there.]
I wanted to share what I think is an easier way to initially setup the HC-05 for BrewPi use. What @day_trippr lined out in the beginning is still valid, however for some people (like me, I'm not ashamed to admit it) "whipping up" a voltage splitter is not necessarily straightforward. It also leverages an Arduino and special sketch to set up the BT device which intimidates some folks. I found a different way that's likely more straightforward for most Windows users.
On Amazon I found a package with an HC-05 Bluetooth Module, a case for that module, Dupont jumpers, and a CP2102 USB to TTL Converter for $12.99 on Prime. That seems like a pretty good deal and provides some pretty good value for a person new to it. When you get a drawer full of "crap", the Dupont wires certainly have less value, but I kinda like the case. So, I'm writing this with that USB to TTL Converter being used:
View attachment 617959
DSD TECH HC-05 Bluetooth Module Kit with CP2102 USB to TTL Converter for Arduino
Buy that ... come back ... now we're ready.
Without further adieu, download some software. You'll probably need the CP2102 drivers, and to follow this you will definitely need the DSD TECH Bluetooth Tools Software. Download and install both of these (actually the "Bluetooth Tools" doesn't install, just unzip to a handy directory):
Don't plug the converter into the USB on your computer yet. Connect the TTL converter and the BT module like so:
View attachment 617962
I actually used the 3.3v the first time, the module will run on 3.3-6v for VIN I believe, but the data channel needs to be 3.3 volts. No worries, the USB to TTL converter handles that for you. Here's the connections in text form:
Converter <-> BT Module
3v3 <-> VIN
TXD <-> RXD
RXD <-> TXD
GND <-> GND
Basically, remember to connect transmit to receive and vice versa. When you are ready and the jumpers are connected properly, connect the device and set programming mode (called "AT mode") by doing the following:
Input low level to PIN34, supply power to the module, input high level to PIN34, then the module will enter to AT mode. Just kidding, I have no idea what that means either. I promised this would be for mortals.
If you have done this correctly, the module should be flashing on and off slowly. Done incorrectly, the device will be flashing rapidly. If you don't get it the first time, unplug the converter and try again.
- Hold the button down on the Bluetooth Module (note about some of the modules sold elsewhere which are insulated with shrink-tube: You may have to cut the tube away from the button in order for it to function correctly)
- Plug in the USB to TTL Converter
- The light will come on for about a second, and then shut off
- Let go of the button on the Bluetooth Module
Now run the "DSD TECH Bluetooth Tools Software" you unzipped. You will be executing "SHTester.exe".
View attachment 617964
To test the device over BT:
- Select the last tab which is "HC-05".
- Drop down the UART box and select the port. On most systems there will be only one. If you have some other COM port device installed there may be more than one listed. If this is the case you will need to open Windows' "Device Manager", look under "Ports (COM & LPT)", and see what COM port is associated with the "Silicon Labs CP210x" device.
- Set Baud Rate to 38400, then click "Open".
- Click the "Test" button, and in the status windows you will see the "AT" command being sent and "OK" received. This will not work unless you are in AT mode (slow flashing). If you don't get anything back it's likely a Baud Rate mismatch. Click on "Close", select a different Baud Rate, "Open" and try testing again till you get an "OK" back.
- Now set "Bluetooth Name" to whatever you'd like it to be, Baud Rate to 57600, PIN (really no reason to change this but remember it), and set Role to "Slave". Click "Set" after each change.
- Now "Close" the UART up top again and you can close the app.
Congratulations! You can unplug the device now, it's ready to be connected to your Arduino.
- Unplug the USB dongle and unplug the two TX and RX wires.
- Plug it back in and now the Bluetooth Module will be flashing rapidly indicating it's ready to be paired.
- Open the Windows Bluetooth settings and click "Add a device."
- Select the name you gave the module above and enter the PIN you used.
- Click "Connect" and if successful, the device will flash briefly every two seconds or so.
So this is where you can go a couple different ways. In order to connect you do need to use a voltage splitter so that the voltage on the communications circuit does not burn out. If you are using @CadiBrewer's shield, this is handled for you. Connect as follows:
Shield <-> BT Module
TXD <-> RXD
RXD <-> TXD
GND <-> GND
VCC <-> VIN
If you are going all rogue and want to do it without a shield, at least you were able to skip the whole Arduino sketch setup thing. You will need:
Wire them according to this diagram which @day_trippr shared in the beginning so that the voltage into the RXD pin on the module is cut to 3.3v:
- 1 x 1K ohm resistor (1/8W axial)
- 1 x 2K ohm resistor (1/8W axial)
- Dupont jumpers
View attachment 617965
The rest of the configuration is in this post above.
@LBussy Continuing the topic form the other thread. Im going to go ver your procedures you spelled out in these 2 posts. But at first glance i see it is for brewpi. Would it work the same with fermentrack, before i dig into this??
Ok i have the box all hooked up and ready to install it. Im reading your manual right now. and from what i see, ill need to setup the HC-05 device first, then connect the controller to the pi and used the Manual workflow setup. I will guess i need to follow LBussy's instructions but use fermentrack's manual work flow. If you have any words of advice or anything, let me know. You have a "Todo" marker to rewrite the manual workflow section, so im shooting from the hip.Yep, you just might need the manual workflow to specify the serial port by hand.
I'm going from memory and it has been a couple of years, so cut me some slack if I remember this incorrectly, but...when I set one of my minions up via bluetooth, it was rather straightforward. Use the automated workflow and get your device working through the normal USB approach. Once it is connected and talking to the Fermentrack software, go through the steps to get the HC-05 programmed. Wire it to your board. Then go into the manage device/view logs tab for that device in Fermentrack and change the port from dev to whatever rfcomm port you assigned during the HC-05 setup when you bound it to the Pi. Should work as expected.Ok i have the box all hooked up and ready to install it. Im reading your manual right now. and from what i see, ill need to setup the HC-05 device first, then connect the controller to the pi and used the Manual workflow setup. I will guess i need to follow LBussy's instructions but use fermentrack's manual work flow. If you have any words of advice or anything, let me know. You have a "Todo" marker to rewrite the manual workflow section, so im shooting from the hip.
I forgot to take a pic last night but im using a project box like yours and damn..... i should have heeded your warning about it being a huge task to get everything to fit in there. I mean i did it, kinda, but is is PACKED! Im giving my self a win on this but it isnt too pretty in there. And i still havent wired the LEDs yea. Still trying to figure out how to mount them to the box. i have another one to build so im thinking of finding a bigger box to put this in.DAYAAAMMM!![]()
Man if it is that straight forward im going to be so happy!! i might build my 2nd one in this box.I'm going from memory and it has been a couple of years, so cut me some slack if I remember this incorrectly, but...when I set one of my minions up via bluetooth, it was rather straightforward. Use the automated workflow and get your device working through the normal USB approach. Once it is connected and talking to the Fermentrack software, go through the steps to get the HC-05 programmed. Wire it to your board. Then go into the manage device/view logs tab for that device in Fermentrack and change the port from dev to whatever rfcomm port you assigned during the HC-05 setup when you bound it to the Pi. Should work as expected.