PDA

View Full Version : Issues with Bluetooth in Python


frethop
01-07-2008, 11:19 AM
I am running python 2.5.1 under OS2008 on an N810.

I have been trying to learn Python by writing an application to control a device through an Bluetooth connection. Under OS2007, I was making good progress. Now that I upgraded to OS2008, I can no longer discover devices. And when I attempt to connect directly to a BT address of a device I know is there, I get "Host is down" (i.e., not present) errors.

I can discover devices if I use the BT interface on the desktop.

I know there have benn changes to BT on OS2008. Can someone give me a clue how to do things different?

Thanks.

-- Mike

yabbas
01-07-2008, 03:38 PM
I had major issues trying to discover Bluetooth devices through HCI; same results as you - friendly name resolution and discovery couldn't be performed (though I could connect if I knew the address...) Sifting through the BlueZ documentation and many forum posts - the general consensus was that HCI had been deprecated in favour of DBUS methods.

Use D-BUS to communicate with BlueZ. It works!

frethop
01-07-2008, 05:03 PM
Use D-BUS to communicate with BlueZ. It works!

Is there a place I can find some examples? Or some documentation? (I'm good at programming, but a n00b with Python...)

Thanks.

fanoush
01-07-2008, 05:54 PM
http://wiki.bluez.org/ Almost every page there describing some funcionality has example in python

frethop
01-07-2008, 06:11 PM
Very cool. Looks like plenty of examples. Thanks to both yabbas and fanoush. I'm off to bluez.org.

vabgeo
01-08-2008, 10:46 PM
Very cool. Looks like plenty of examples. Thanks to both yabbas and fanoush. I'm off to bluez.org.

I have used python, bluez to connect to the wiimote using bluetooth. It worked in OS2008 too. https://garage.maemo.org/projects/pyaxelwii/
Check the source code in garage SVN
https://garage.maemo.org/plugins/scmsvn/viewcvs.php/trunk/pyaxelwii/src/pyaxelwii?root=pyaxelwii&rev=34&view=markup