Bluetooth HC05
Bluetooth HC05
Hi everyone,
i'm looking for some information for the hc05 bluetooth module. How to connect? How to access? But i can't find any information. Can anyone help me?
i'm looking for some information for the hc05 bluetooth module. How to connect? How to access? But i can't find any information. Can anyone help me?
Re: Bluetooth HC05
Some datasheet and you can start trying (like via http://www.micro4you.com/store/bluetoot ... hc-05.html ). In general if you connect master to pyboard and connect TX with RX on slave then when their are paired anything sent to slave should return
Re: Bluetooth HC05
Is there a driver for this module?
Re: Bluetooth HC05
There are no drivers "needed", it's just a serial device you can talk to. And I didn't saw any code already written for it.
-
- Posts: 288
- Joined: Sun May 04, 2014 8:54 am
Re: Bluetooth HC05
Connect as they labels on the PCBs tell you.
The physical pins of the UART busses are:
3V3 | VCC
GND | GND
RX | TX
TX | RX
Use the UART module as described here: http://micropython.org/doc/module/pyb/UART
i.e.
Use to send the REPL to the UART you created above.
On Ubuntu do:
Bluetooth - Set up new device - chose the device - Pin options '1234' - Next
Get the modules MAC address:
Add the serial port:
add:
Connect:
Watch with:
The physical pins of the UART busses are:
- UART(4) is on XA: (TX, RX) = (X1, X2) = (PA0, PA1)
UART(1) is on XB: (TX, RX) = (X9, X10) = (PB6, PB7)
UART(6) is on YA: (TX, RX) = (Y1, Y2) = (PC6, PC7)
UART(3) is on YB: (TX, RX) = (Y9, Y10) = (PB10, PB11)
UART(2) is on: (TX, RX) = (X3, X4) = (PA2, PA3)
3V3 | VCC
GND | GND
RX | TX
TX | RX
Use the UART module as described here: http://micropython.org/doc/module/pyb/UART
i.e.
Code: Select all
from pyb import UART
uart = UART(1, 9600) # init with given baudrate
uart.init(9600, bits=8, stop=1, parity=None) # init with given parameters
Code: Select all
pyb.repl_uart(uart)
On Ubuntu do:
Bluetooth - Set up new device - chose the device - Pin options '1234' - Next
Get the modules MAC address:
Code: Select all
hcitool scan
Code: Select all
sudo nano /etc/bluetooth/rfcomm.conf
Code: Select all
rfcomm0 {
bind no;
device MAC address of your module;
channel 1;
comment "Serial Port";
}
Code: Select all
sudo rfcomm connect 0
Code: Select all
screen /dev/rfcomm0
Last edited by Turbinenreiter on Mon Nov 03, 2014 3:51 pm, edited 1 time in total.
Re: Bluetooth HC05
That looks easy. Thanks for help
Re: Bluetooth HC05
I didn't see this mentioned, so I figured its worth being explicit.
You'll want to connect the TX pin from the HC05 to the RX pin on the pyboard, and the RX pin from the HC05 to the TX pin on the pyboard.
You'll also need to connect GND from the HC05 to ground on the pyboard. And if you're plugged into USB, then VIN will be just under 5V (around 4.75v) and can be used to power the HC05.
You'll want to connect the TX pin from the HC05 to the RX pin on the pyboard, and the RX pin from the HC05 to the TX pin on the pyboard.
You'll also need to connect GND from the HC05 to ground on the pyboard. And if you're plugged into USB, then VIN will be just under 5V (around 4.75v) and can be used to power the HC05.
-
- Posts: 5
- Joined: Thu Nov 06, 2014 10:33 pm
Re: Bluetooth HC05
I found the info in Turbinenreiter's post really useful so I've added it to the wiki: http://wiki.micropython.org/official-ac ... odule-HC05
I think the wiki should be the source of reference material for new starters rather than trawling through the forum so I've added a section to the wiki to gather information about the official accessories: http://wiki.micropython.org/pages/official-accessories/
I think the wiki should be the source of reference material for new starters rather than trawling through the forum so I've added a section to the wiki to gather information about the official accessories: http://wiki.micropython.org/pages/official-accessories/
Re: Bluetooth HC05
I did:
from pyb import UART
uart=UART(3,9600) # Using Y9,Y10.
What do I do once I have the:
pyb.repl_uart(uart)
I tried to send:
AT+PINxxxx like this: uart.send("AT+PIN3478") but when I tried to pair it was still the old password.
I also tried to change the name with no luck.
The module is blinking red. Do I need to use the state or key pin to modify it?
since uart.send does not give you a response it is hard to debug...
from pyb import UART
uart=UART(3,9600) # Using Y9,Y10.
What do I do once I have the:
pyb.repl_uart(uart)
I tried to send:
AT+PINxxxx like this: uart.send("AT+PIN3478") but when I tried to pair it was still the old password.
I also tried to change the name with no luck.
The module is blinking red. Do I need to use the state or key pin to modify it?
since uart.send does not give you a response it is hard to debug...
Re: Bluetooth HC05
>>> uart.send('AT+PIN2345')
>>> pyb.repl_uart(uart)
>>> uart.send('AT+PIN2345')
>>> ERO:0
File "<stdin>", line 1, column 4
SyntaxError: invalid syntax
>>> EERO:0
File "<stdin>", line 1, column 5
SyntaxError: invalid syntax
>>> ERO:()ERO:()
>>> pyb.repl_uart(uart)
>>> uart.send('AT+PIN2345')
>>> ERO:0
File "<stdin>", line 1, column 4
SyntaxError: invalid syntax
>>> EERO:0
File "<stdin>", line 1, column 5
SyntaxError: invalid syntax
>>> ERO:()ERO:()