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
0
votes
0 answers

Python recv drops bluetooth data?

I have a python application running on an IOT device which is receiving data over a bluetooth (pybluez) connection. I'm testing the IOT device with an android phone. Most of the protocol is small chatty packets, however, there's one operation which…
James Suffolk
  • 213
  • 1
  • 12
0
votes
0 answers

How to establish bluetooth HFP service level connection

I am trying to establish a HFP (Hands Free Profile) service level connection using the python test code provided in the bluez repository. In order to even run, the example needed some modifications: Fix the deprecated import statement: import…
0
votes
1 answer

BlueZ stopped working (it doesn't discover any SDP service)

I am using Bluez version 5.53-0ubuntu3 PyBluez latest and until yesterday everyhing worked fine this python code discovered services just fine import bluetooth mac = "FF:A0:AB:21:20:F4" print(bluetooth.find_service(address=mac) but today this…
0
votes
0 answers

Send custom bluetooth packets (bypass HCI)

I'm trying to achieve in bluetooth a way to bypass the HCI. I'll elaborate. in the HCI H4 layer there is the event field. I want to be able to send HCI Commands. now - if i'll do it currently - the commands will stop at the controller as it recieved…
Jentel
  • 148
  • 2
  • 17
0
votes
0 answers

Why pybluez doesn't see MAC address of my phone in python?

when I enter print(bluetooth.discover_devices()), there isn't MAC address of my phone in console, although bluetooth is turned up in my phone. I want to know why this is happening.
pinkcat
  • 327
  • 4
  • 17
0
votes
1 answer

How to install module pybluez in python for windows 10

I can't install module pybluez. When I write to the console: python -m pip install pybluez, I get errors: ERROR: Command errored out with exit status 1: error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools":…
pinkcat
  • 327
  • 4
  • 17
0
votes
1 answer

Broken Pipe During BLE Scan (RPi, Python 3.7)

I've got some Python 3.7 BLE scanning code which typically runs fantastic on a RPi3 device in production. However, recently I've seen devices* introduced into the environment that will crash the BLE Scanner in ways that I don't know how to…
0
votes
1 answer

Sending files via bluetooth depending on rssi value

I am scanning nearby bluetooth devices. And I have dictionary with MAC address and rssi value like this: dictionary = {"18:FF:E3:3B:5D:31": "-49","11:11:11:3B:5D:31": "-60", } In this case I would like to send file to 18:FF:E3:3B:5D:31 only when…
derirative23
  • 486
  • 2
  • 7
  • 22
0
votes
1 answer

PyBluez over HCI working oddly on Raspberry Pi Compute Module with ESP32

I'm using a Raspberry PI compute module 3 in a custom motherboard connected to an ESP32 using HCI over UART to connect to a mobile phone over bluetooth. It partially works: The phone is able to pair with the device, the device can see the phone in…
James Suffolk
  • 213
  • 1
  • 12
0
votes
0 answers

How to execute client.py and server.py to enable Bluetooth connection

I can't work out how to get the client.py and server.py files to run at the same time to establish the Bluetooth connection and transfer data from the server to the client. I've started writing an android app using kivy, and I need it to lookup a…
0
votes
1 answer

Connect android-BluetoothChat to bluez in a Raspberry Pi

I need to connect android-BluetoothChat to a Raspberry Pi B+, preferably headless. I installed the scripts here to get the Pi to automatically accept pairing requests, and my Android Tablet (a Walmart ONN) says it is paired with my Pi. The correct…
Phlip
  • 5,253
  • 5
  • 32
  • 48
0
votes
0 answers

Music streaming from PC with Ubuntu to audio device via Bluetooth

I want to stream music from my laptop with Ubuntu 18.04 to audio device (LG CM2760). I wrote short script in Python where I want to connect with my audio device and then play music. I'm not sure but think that connection is established correct…
0
votes
1 answer

Python3 won't find a module even though it is properly installed

I'm using a Python 3.6.7 venv and I have installed the PyBluez bluetooth library, in addition to ALL of its dependencies such as sudo apt install bluetooth libbluetooth-dev python3-bluez . When I run my python script, I'm…
the_endian
  • 2,259
  • 1
  • 24
  • 49
0
votes
1 answer

OSError: The requested address is not valid in its context

I am attempting to make a simple bluetooth program in python using pybluez. For the server script I have this code: import bluetooth as bt HOST = "" PORT = 8888 s = bt.BluetoothSocket(bt.RFCOMM) s.bind((HOST,PORT)) s.listen(1) conn, addr =…
john doe
  • 107
  • 2
  • 10
0
votes
1 answer

Interpret AVRCP packets

After some mucking about, I have got a pybluez script to connect to an AVRCP profile on various devices, and read the responses. Code snippet: addr="e2:8b:8e:89:6c:07" #S530 white port=23 if (port>0): print("Attempting to connect to L2CAP port…
Robbie Matthews
  • 1,404
  • 14
  • 22