bluelightvision
Posts: 3
Joined: Sat Jan 10, 2015 12:35 pm

serial bluetooth

Mon Jan 19, 2015 1:40 pm

hi, I have a serial bluetooth module (BlueTooth 2 Stick) that I need to connect to my raspberry pi. First, can I connect it directly to the TX-RX pins of the raspberry. Also, is there any python library for the interface.

User avatar
Douglas6
Posts: 4874
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: serial bluetooth

Mon Jan 19, 2015 5:39 pm

This looks like a nice little board. At twice the price of the Raspberry Pi, I guess it should be. It operates at 3v3, so yes you can connect directly to the Pi's TX, RX, and GND. Also disable the serial console with raspi-config, under 'advanced options'. Import the pyserial library for programming. I'd be interested in hearing if you get anywhere near the advertised 1000m range.

bluelightvision
Posts: 3
Joined: Sat Jan 10, 2015 12:35 pm

Re: serial bluetooth

Thu Jan 22, 2015 8:25 am

I installed the pyserial library but I don't know how to use it for bluetooth communication. I use to work with USB bluetooth modules using the PyBluez library but now I'm confused about the serial communication. Is there any tutorial that could help. Thank you!

User avatar
Douglas6
Posts: 4874
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: serial bluetooth

Thu Jan 22, 2015 2:29 pm

As far as the Pi knows, this device is a serial port. There is no Bluetooth involved. Once you get it configured and connected (you may have to read the manual), program for it like you would for any serial port device (open, readln, close, etc.)

Return to “Python”