I have a RPi and a normal Debian on my pc, both using the Bluetooth Python module to communicate. Both have some Bluetooth USB dongle in them.
I can use the pc as server and the RPi as client, this connection works very well. However I'm not able to do it vice versa, I checked my rfcomm.conf
and main.conf
, but both seem to be ok.
Any other pitfalls?
#Server.py
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 "Accepted connection from ",address
data = client_sock.recv(1024)
print "received [%s]" % data
client_sock.close()
server_sock.close()
#Client.py
import bluetooth
bd_addr = #myspecificmacaddress
port = 1
sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )
sock.connect((bd_addr, port))
sock.send("hello!!")
sock.close()
So to be more precise: Running Client.py
on RPi and Server.py
on pc works fine, doing vice versa, obviously with corrected MAC, simply says: bluetooth.btcommon.BluetoothError: (112, 'Host is down')