2

I'm running Ubuntu 13.04 Server on a Mac OS X (Maverick) and python 2.7.5.
I installed PyBluez and Bluez-libs. When I type

import bluetooth

or

from bluetooth import *

it successfully imports but when I try to run a basic script using the

discover_devices()

method, I get this error

Traceback (most recent call last):
  File "./fin.py", line 4, in <module>
    devlist = discover_devices()
  File "/usr/lib/python2.7/dist-packages/bluetooth/bluez.py", line 17, in    discover_devices
    sock = _gethcisock ()
  File "/usr/lib/python2.7/dist-packages/bluetooth/bluez.py", line 226, in _gethcisock
    raise BluetoothError ("error accessing bluetooth device")
bluetooth.btcommon.BluetoothError: error accessing bluetooth device

and when I type

~$ hcitool dev

no devices are named.

Any ideas?

Thanks in advance.

3
  • How do you run Ubuntu "on a Mac OS X (Maverick) and python 2.7.5"?
    – guntbert
    Jan 30, 2014 at 21:36
  • I have an Ubuntu Server partition installed on Oracle VM VirtualBox and that has python 2.7.5+ on it. I'm using SSH to communicate with it on my Mac which has OS X Maverick.
    – o-90
    Jan 31, 2014 at 1:50
  • You should upgrade your server BTW.
    – Braiam
    Jan 31, 2014 at 17:36

2 Answers 2

1

Before you run discover_devices(), make sure the 'hci0' is in an UP RUNNING state by running the command:

hciconfig hci0 up
0

This happens because (most likely) the server doesn't have bluetooth interfaces (what server uses bluetooth anyways?) or it doesn't get detected. The output of hcitool being blank points that you don't have bluetooth interfaces connected to the system working as server (if it's a VM, unless it's USB adapter it could not work).

5
  • ok. I have a bluetooth usb adapter in my MAC. Is there a way to get Ubuntu to recognize this?
    – o-90
    Feb 25, 2014 at 21:28
  • @GoBrewers14 do it works in a desktop?
    – Braiam
    Feb 26, 2014 at 0:59
  • Yes, when I insert the usb into the MAC, the MAC reads it.
    – o-90
    Feb 26, 2014 at 1:55
  • I meant a desktop version of Ubuntu...
    – Braiam
    Feb 26, 2014 at 1:56
  • I installed Ubuntu Desktop on the VirtualBox. I plugged in the bluetooth adapter and it still says devices: [nothing]
    – o-90
    Feb 26, 2014 at 4:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .