not logged in | [Login]

The Bluetooth module HC05 is available in the Micro Python Store.

Most of the content on this page is derived from Turbinenreiter's forum post

Resources

Pins

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)

Connections

Connect the module to the pyboard as follows:

pyb | hc05
3V3 | VCC
GND | GND
RX  | TX
TX  | RX

Modules

No custom modules are required, use the UART module:

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

Then use the following to send the REPL to the UART you created above

pyb.repl_uart(uart)

Connecting to your PC

Windows

TODO

Ubuntu

Bluetooth - Set up new device - choose the device - Pin options '1234' - Next. Get the modules MAC address:

hcitool scan

Add the serial port by editing the file: /etc/bluetooth/rfcomm.conf

rfcomm0 {
    bind no;
    device MAC address of your module;
    channel 1;
    comment "Serial Port";
}

Then connect it with:

sudo rfcomm connect 0

Watch it with:

screen /dev/rfcomm0