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
2
votes
1 answer

PyBluez ImportError: DLL load failed: %1 is not a valid Win32 application

Whenever I Attempt To Import The bluetooth Module I Get This Error Traceback (most recent call last): File "C:/Users/super/PycharmProjects/untitled1/Sql.py", line 1, in import bluetooth File…
Mick Hugi
  • 23
  • 4
1
vote
1 answer

PyBluez: error in PyBluez setup command: use_2to3 is invalid

I am trying to pip install pybluez and I get this error: Collecting PyBluez Using cached PyBluez-0.23.tar.gz (97 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × python setup.py egg_info did not run…
Zany Geko
  • 19
  • 3
1
vote
1 answer

JSONDecodeError Expecting value: line 1 column 1 (char 0) when receiving via Bluetooth

I am transmitting a JSON payload from an Arduino microcontroller and attempting to receive it using a Python script: import bluetooth #pybluez import json sensor_address = "18:D9:31:YY:C7:4A" socket =…
John Harrington
  • 1,314
  • 12
  • 36
1
vote
1 answer

Using python sockets to connect bluetooth device

I'm trying to connect to custom bluetooth device with sockets using python. I use pybluez to find device and get it's address. Current code looks like this: import bluetooth, subprocess import socket class BCI(object): """ Bluetooth…
1
vote
1 answer

Discovering Bluetooth devices in Python with M1 MacBook

Is there any way to discover nearby Bluetooth devices using Python on macOS running on the newer Apple Silicon? I tried Pybluez, but lightblue, one of its dependencies, doesn't seem to be supported.
Sam Lerman
  • 301
  • 2
  • 8
1
vote
0 answers

PyBluez 'bad bluetooth address'

I am running Windows 11 and ideally I would like to 'talk' with my PS5 controller via the internal bluetooth of my laptop using python. I was going to run this sample code for PyBluez, but I get the error message 'bad bluetooth address'. from…
bob0815
  • 21
  • 4
1
vote
0 answers

PyBluez2 Connect To Bluetooth Device

I'm using PyBluez2 to try and connect a bluetooth device. I have it searching for a device printing them out 1 by 1 with the address and the name as well as throwing them in a list. I use some janky methods to get the mac address separate. I can't…
Steven8200
  • 11
  • 2
1
vote
2 answers

Python module importing itself with leading underscore but there is no corresponding .py file

In the PyBluez source code I've noticed a couple things I haven't seen before. This file named widcomm.py starts with the following: from .btcommon import * import socket import struct import threading import os import _widcomm In the previous…
Temerity
  • 13
  • 3
1
vote
1 answer

How to send data via bluetooth to Pi pico

I need a way to send data to and from my pi pico via bluetooth. Here is the program I'm running on my pc. Note: Everything on the pi is working correctly (tested with a bt serial terminal) import bluetooth as bt print("Scanning Bluetooth…
Jake A
  • 83
  • 1
  • 8
1
vote
0 answers

Is there an example using Python where you connect or disconnect from an already paired device programmatically?

I am using the Pybluez module in Python and got an example program to run where I could get the target address of my bluetooth headset device by name. But what does one do as a method where you actually get connected or disconnected from your…
1
vote
2 answers

How to fix installation error by pybuez error on subprogress

i wanted to use pyBluez for Python, so i ran "pip install pybluez" ( I use Win11 64gb) but this error happend: Collecting pybluez Using cached PyBluez-0.23.tar.gz (97 kB) Preparing metadata (setup.py) ... error error:…
TomCraft
  • 27
  • 1
  • 7
1
vote
1 answer

How do I resolve 'PY_SSIZE_T_CLEAN macro must be defined for '#' formats' for Pybluez on Windows 10

I am trying to run the Pybluez server example but I am getting an error that I don't understand. Is there any way to resolve this? I am running Windows 10. Traceback (most recent call last): File "C:\Users\cmbro\PycharmProjects\test\server.py",…
user18124102
  • 13
  • 1
  • 3
1
vote
1 answer

Is it possible to "authorize service" using pybluez?

If I pair a bluetooth device to my PC but I don't trust it, any time I power on the bluetooth device I will get a prompt like this in bluetoothctl: Authorize service [agent] Authorize service 0000111f-0000-1000-8000-00805f9b34fb (yes/no): If I type…
Hubro
  • 56,214
  • 69
  • 228
  • 381
1
vote
0 answers

How to apply authentication while making BLE connection using Bluez5.60

I'm trying to connect my Raspberry Pi 3B+ over BLE GATT Server using the Bluez5.6 library. I have successfully tested the BLE server application. Able to connect & communicate over the GATT services on the BLE client application over android. I…
1
vote
1 answer

How do I connect a L2CAP-based Bluetooth Camera Shutter (AB Shutter 3) to Linux and get the key event in Python?

Goal I have a HITSLAM Camera Shutter Bluetooth button (which is a AB Shutter 3 device, a common Bluetooth camera remote control) which I want to connect to my NVIDIA Jetson Nano using Bluetooth, so that I can use the button's input for some…