pybluez

Cannot import Bluetooth in Python 3 (OSX)

删除回忆录丶 提交于 2019-12-11 09:51:18
问题 I reinstalled PyBluez some weeks ago since I couldn't get basic functions to work. Now I can't even import it to Python 3. import bluetooth Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import bluetooth File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PyBluez-0.22-py3.6.egg/bluetooth/__init__.py", line 47, in <module> from .osx import * File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PyBluez-0

Which tool has replaced gatttool in bluez5?

为君一笑 提交于 2019-12-10 12:47:18
问题 It seems like since commit b1eb2c4cd057624312e0412f6c4be000f7fc3617 gatttool has been deprecated but I'm unable to find any information on what has replaced gattool. Every Python Bluetooth LE packages I looked into relays on gatttool and is now broken on my ArchLinux system since the bluez package isn't build with --enabled-deprecated flag (which would build gatttool binary). pygatt is just broken on my system and bluepy doesn't build as they ship there own (on my system broken) bluez code to

Python Bluetooth how to send a file to a phone

大兔子大兔子 提交于 2019-12-07 12:02:53
问题 in my current project it is a requirement to send a file from a windows computer to an android device over bluetooth without anything on the phone other than it's standard state and of course a paired bluetooth connection. i've looked over pybluez and it seemed simple enough to send files between a client and server architecture (and in fact got it sending between my laptop and desktop rather quickly) but I cannot for the life of me find any way to get python to send a file from the computer

Python Bluetooth how to send a file to a phone

情到浓时终转凉″ 提交于 2019-12-05 21:32:11
in my current project it is a requirement to send a file from a windows computer to an android device over bluetooth without anything on the phone other than it's standard state and of course a paired bluetooth connection. i've looked over pybluez and it seemed simple enough to send files between a client and server architecture (and in fact got it sending between my laptop and desktop rather quickly) but I cannot for the life of me find any way to get python to send a file from the computer to android once the connection is established; my attempts have been grabbing the bluetooth mac address

Pairing bluetooth devices with Passkey/Password in python - RFCOMM (Linux)

痴心易碎 提交于 2019-12-04 05:58:46
I am working on a Python script to search for bluetooth devices and connect them using RFCOMM . This devices has Passkey/Password. I am using PyBlueZ and, as far as I know, this library cannot handle Passkey/Password connections ( Python PyBluez connecting to passkey protected device ). I am able to discover the devices and retrieve their names and addresses: nearby_devices = bluetooth.discover_devices(duration=4,lookup_names=True, flush_cache=True, lookup_class=False) But if tried to connect to a specific device using: s = bluetooth.BluetoothSocket(bluetooth.RFCOMM) s.connect((addr,port)) I

Python code for Bluetooth throws error after I had to reset the adapter

折月煮酒 提交于 2019-11-30 00:48:30
I was trying out bluetooth programming in python. It was working fine till yesterday. This morning, there was a power outage and for some reason, the bluetooth module got disabled and it could not be turned on. So, I did a sudo hciconfig hci0 reset and then turned it on. From that point onwards, the simplest of the programs are failing to execute. Take this one for example. It gets stuck at advertise_service in bluetooth module and throws the following error (FYI: virtualenv was not a problem here. The systemwide python also does the same thing). Traceback (most recent call last): File "bt.py"

python bluetooth - check connection status

别等时光非礼了梦想. 提交于 2019-11-29 14:53:56
I am using the bluetooth module for python import bluetooth which I believe is the PyBluez package. I am able to connect, send, and receive just fine from the bluetooth.BluetoothSocket class but my application is completely blind when it comes to the status of the connection. I want my application to disable certain functionality when the device is disconnected but there does not seem to be any BluetoothSocket.is_connected() methods of any kind. I would like it to detect changes in the bluetooth status as soon as they occur. Usually there are multiple topics about something as simple as this,