You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
port = 1
server_sock.bind(("", port))
server_sock.listen(1)
client_sock, address = server_sock.accept()
print(f"Accepted connection from {address}")
while True:
data = client_sock.recv(1024)
if not data:
break
print(f"Received: {data}")
client_sock.close()
server_sock.close()
`
here was my error macName Bluetooth % python3.9 main.py /opt/homebrew/lib/python3.9/site-packages/lightblue/_macutil.py:169: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class BBCocoaSleeper(NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_macutil.py:192: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class BBFileLikeObjectReader(NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_macutil.py:218: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class BBFileLikeObjectWriter(NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py:760: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class _ChannelEventListener(Foundation.NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py:834: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class _ChannelServerEventListener(Foundation.NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_obex.py:338: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class _BBOBEXClientDelegate(NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_obex.py:447: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class BBOBEXObjectPushServer(NSObject): Traceback (most recent call last): File "/Users/pi/Documents/Coding Projects - Personal/Python/Bluetooth/main.py", line 7, in <module> sock.connect((server_address, port)) File "/opt/homebrew/lib/python3.9/site-packages/bluetooth/macos.py", line 119, in connect return self._sock.connect(addrport) File "/opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py", line 348, in connect self.__eventlistener = self.__createlistener() File "/opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py", line 642, in __createlistener listener = _ChannelEventListener.alloc().initWithDelegate_(self) File "/opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py", line 787, in initWithDelegate_ self = super().init() AttributeError: 'super' object has no attribute 'init' sys:1: UninitializedDeallocWarning: leaking an uninitialized object of type _ChannelEventListener macNamer Bluetooth %
The text was updated successfully, but these errors were encountered:
PyBluez is not under active development but we are seeking new contributors
to investigate bugs and submit patches.
System
Issue
I get this error for this code `import bluetooth
server_address = 'DC:A6:32:90:0F:DE' # Replace with your Raspberry Pi's Bluetooth address
port = 1
sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
sock.connect((server_address, port))
while True:
data = input("Send: ")
if not data:
break
sock.send(data)
sock.close()
`
on my macos.
I used python 3.9 and installed use_2to3 to install
The raspberry pi running pi os was completely fine `import bluetooth
server_sock = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
port = 1
server_sock.bind(("", port))
server_sock.listen(1)
client_sock, address = server_sock.accept()
print(f"Accepted connection from {address}")
while True:
data = client_sock.recv(1024)
if not data:
break
print(f"Received: {data}")
client_sock.close()
server_sock.close()
`
here was my error
macName Bluetooth % python3.9 main.py /opt/homebrew/lib/python3.9/site-packages/lightblue/_macutil.py:169: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class BBCocoaSleeper(NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_macutil.py:192: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class BBFileLikeObjectReader(NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_macutil.py:218: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class BBFileLikeObjectWriter(NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py:760: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class _ChannelEventListener(Foundation.NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py:834: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class _ChannelServerEventListener(Foundation.NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_obex.py:338: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class _BBOBEXClientDelegate(NSObject): /opt/homebrew/lib/python3.9/site-packages/lightblue/_obex.py:447: ObjCSuperWarning: Objective-C subclass uses super(), but super is not objc.super class BBOBEXObjectPushServer(NSObject): Traceback (most recent call last): File "/Users/pi/Documents/Coding Projects - Personal/Python/Bluetooth/main.py", line 7, in <module> sock.connect((server_address, port)) File "/opt/homebrew/lib/python3.9/site-packages/bluetooth/macos.py", line 119, in connect return self._sock.connect(addrport) File "/opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py", line 348, in connect self.__eventlistener = self.__createlistener() File "/opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py", line 642, in __createlistener listener = _ChannelEventListener.alloc().initWithDelegate_(self) File "/opt/homebrew/lib/python3.9/site-packages/lightblue/_bluetoothsockets.py", line 787, in initWithDelegate_ self = super().init() AttributeError: 'super' object has no attribute 'init' sys:1: UninitializedDeallocWarning: leaking an uninitialized object of type _ChannelEventListener macNamer Bluetooth %
The text was updated successfully, but these errors were encountered: