Wednesday 15 June 2011

Connecting Arduino to Python via Bluetooth -



Connecting Arduino to Python via Bluetooth -

i'm creating project i'm attempting send analog info recorded fsr computer generate real-time graph. understand basics of arduino, python, bluetooth, , serial communication, want found connection possible, means don't want select serial port via arduino ide.

is possible found serial port outside of ide? serial communication established after pairing bluetooth dongle bluetooth shield.

i using arduino uno bluefruit ez-link shield: http://www.adafruit.com/product/1628

thank you!

we've written 2 tutorials time ago certainly help you:

how configure bluetooth module communication between scratch , arduino

mobile robotics scratch: preparing linux pc, arduino , scratch communicate wireless via bluetooth

the communication server utilize in python, think apply problem.

tip: bluetooth serial device (/dev/rfcomm0 or /dev/rfcomm1) appear after you've chosen connect arduino dev-b (see tutorial) using blueman-manager.

tip 2: not utilize serial.tools.list_ports.comports() function serial.tools. not observe rf devices (it's problem basenames uses collect devices: rf* not in list imagined, won't debugging standard python libraries). if want automatically if right device created, utilize next code:

import glob rfports = list(glob.glob("/dev/rfcomm*"))

important: remember following:

you can connect bluetooth module straight arduino connecting rxd/txd ports of bluetooth tx/rx ports (rxd<->tx & txd<->rx !) of arduino or

you can connect bluetooth module digital ports of arduino using softwareserial lib.

if utilize first option, of import arduino is not connected computer via usb, because usb connection uses same rx/tx ports of arduino , bluetooth communication won't work. powerfulness arduino using batteries or cellphone charger.

python bluetooth serial-port arduino

No comments:

Post a Comment