2

I am trying to send informations from Raspberry Pi 3 to Arduino Uno with bluetooth. I managed to connect the Arduino's bluetooth module with the Raspberry Pi.

But I have this error when I execute my python script on Raspberry Pi (with python or python3):

Traceback (most recent call last):
File "bluetooth_test.py", line 6, in <module>
sock.connect((bd_addr,port))
File "<string>", line 5, in connect
bluetooth.btcommon.BluetoothError: (112, 'Host is down')

Here is my python script:

import bluetooth

bd_addr = "C8:FD:19:11:04:A3"
port = 1
sock = bluetooth.BluetoothSocket (bluetooth.RFCOMM)
sock.connect((bd_addr,port))

while 1:
    tosend = raw_input()
    if tosend != 'q':
        sock.send(tosend)
    else:
        break

sock.close()
0

just go to the raspberry preference menu then click on Bluetooth manager and select the name of specific Bluetooth device and marked first and then pair the module after that you just run your program. I hope it will work.

Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.