Questions tagged [pybluez]

PyBluez is a Python extension module allowing access to system Bluetooth resources on Windows, Linux, and OS X(unstable).

PyBluez is a Python module that works on both Python 2 and 3 on Windows and Linux. It has support for both L2CAP and RFCOMM, however L2CAP is unsupported in Python 2. It also has experimental BLE(Bluetooth Low Energy) functions in Linux versions. Mac OS X versions are currently unstable. https://github.com/karulis/pybluez

162 questions
4
votes
1 answer

Bluez core interferes with HCI socket commands

I have following problem: I have created a HCI socket via pybluez and try to create a connection to a remote device. I send successfully a CREATE_CONNECTION command but after receiving the answers it seems the bluez stack sends further requests…
ph10
  • 57
  • 6
4
votes
2 answers

Connect to local bluetooth

I am using pybluez to develop a bluetooth application on linux in python. I want to know if it is possible to connect to a "localhost" for bluetooth so I can run the client and server on the same machine (as most people do for web development). If…
Jordan
  • 397
  • 2
  • 18
4
votes
2 answers

Python Socket Bluetooth

I'm trying to pair my cardio bluetooth sensor to my windows pc. After some searches I found pyBluez for x64 systems and now i'm able to discover bluetooth devices around me, their names,address and services. My Polar sensor has an L2CAP protocol and…
Danilo
  • 41
  • 1
  • 1
  • 3
4
votes
0 answers

Is there a way to list channel in-use of RFCOMM in Linux?

Environment: Ubuntu 14.04 running in vmplayer. in PyBluez Example, rfcomm-server.py, Problem with running RFCOMM server on PORT_ANY code chunk: from bluetooth import * erver_sock=BluetoothSocket( RFCOMM…
bcat
  • 397
  • 2
  • 6
3
votes
2 answers

How to get the error code from BluetoothError

I have this code for reading from a bluetooth socket: socket.settimeout(timeout) try: data = socket.recv(1024) except bluetooth.btcommon.BluetoothError as e: if e.code == 11: self.connect() obviously, I want to make a difference between a…
Bart Friederichs
  • 33,050
  • 15
  • 95
  • 195
3
votes
0 answers

RPi 3 pybluez connetion timeout

On a Raspberry Pi 3, is there a way to set a timeout to bluetoothsocket.accept so that it will continue if there was no connection attempted instead of ending the code? I've tried settimeout but it ends the code.
3
votes
1 answer

Send message over bluetooth with Python 3

I am currently trying to send a message from Python 3 to a Arduino (with HC-06). I've managed to establish a connection but I can't seem to find the right way to send a message. Here is the code I use to setup the connection (I'm using PyBluez for…
Carl Bratt
  • 47
  • 2
  • 7
3
votes
1 answer

Android Bluetooth RFCOMM directly to Raspberry Pi without pairing

I need to make an application that communicates through an RFCOMM socket to a Raspberry Pi, without pairing. On the Android side, I have the MAC address of the RPi and I'm trying to connect to the server using this code: BluetoothDevice device =…
user3808318
  • 827
  • 1
  • 8
  • 15
3
votes
0 answers

I can't install PyBluez on PyCharm Windows 10

I've last PyCharm version and I use Python 3.6.1 When I'm trying to install a PyBluez 0.22 I get error message Here is my error details: Collecting PyBluez Using cached PyBluez-0.22.zip Installing collected packages: PyBluez Running setup.py…
3
votes
0 answers

Python: Pair bluetooth speaker

Problem: I have a Logitech BT Adapter connected to a bunch of speakers at home. I have its address stored on my laptop and I want to use python to attempt to pair with it. What I have tried: I have tried using both RFCOMM and L2CAP using the…
otoomey
  • 939
  • 1
  • 14
  • 31
3
votes
2 answers

Where can I find the PyBluez API

I understood from Bluetooth for Programmers chapter 2, that the PyBluez API does provide functions like discover_devices and lookup_name. However I have not found any API documentation for PyBluez. What I am looking for is the complete list of…
lolo67
  • 184
  • 1
  • 1
  • 7
3
votes
2 answers

Python alternative to linux bluetooth command "rfcomm connect"

Requirement: I need to connect to a remote bluetooth device & port and send data using a device file. 1. First scan the nearest bluetooth devices 2. connect to a remote BT addr & channel and communicate using a device file (/dev/rfcomm0) I'm stuck…
manikawnth
  • 2,739
  • 1
  • 25
  • 39
3
votes
0 answers

Android to bluetooth connection only works in android debugger but not in release/run mode

As stated in the title, the my bluetooth socket will only make a connection if it is ran in the debugger. When i put a breakpoint on the connect(), it connects when i step over taking about a second to connect. When I try running in release it…
alan7678
  • 2,223
  • 17
  • 29
3
votes
1 answer

Discovering bluetooth devices IOError: The RPC server is unavailable

I just tried to implement bluetooth from Python in PyCharm, using PyBluez. I am stuck with this particular error. I tried to search this error but could not find it. Can anybody help ? This is my code >>> from bluetooth import discover_devices >>>…
2
votes
0 answers

I am getting error AttributeError: module 'lightblue' has no attribute 'finddevices' in MacOS

I am using below code on MacOS using python3 : nearby_devices = bluetooth.discover_devices(duration=8,lookup_names=True,flush_cache=True,lookup_class=False) When I run the code , I am getting below error: Traceback (most recent call last): File…
Pixzium Media
  • 109
  • 2
  • 10
1
2
3
10 11