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 = s.accept()
print("Connected by", addr)
while True:
data = conn.recv(1024)
print(data)
When I attempt to run it I get the Error:
OSError: The requested address is not valid in its context.
I have done extensive research and am unable to find any real cause; it seems to be that pybluez doesn't like to be bound to the address "", but every example I found online said to do that.