I'm trying to set up a Bluetooth link between a Raspberry Pi and an Arduino (Megapi). These are both mounted on a robot for a wireless robotics project. While running the Bluetooth server/listener on the Pi, I get the Invalid Exchange socket error. The troublesome code is shown below-
self.host = "00:0D:19:EA:28:52"
self.port = 3
self.sock = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM)
self.sock.connect((self.host, self.port))
The fourth line is where the error pops up-
File "Client.py", line 21, in __init__
self.sock.connect((self.host, self.port))
File "/usr/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 52] Invalid exchange
Unfortunately, there appears to be very little documentation on socket errors available on the internet, other than one/two word descriptions of what the error codes mean. I was hoping you can help!