1

I have write program for raspberrypi3 bluetooth communication with hc05 ,but most of the time I am getting error bluetooth.btcommon.BluetoothError: (110, 'Connection timed out')

how can I solve this problem?

Programs:

                          import bluetooth
                          import time
                          import RPi.GPIO as GPIO
                          bd_addr = "00:19:E4:40:00:06"
                          sock= 
                          bluetooth.BluetoothSocket(bluetooth.RFCOMM)
                          port=1
                          sock.connect((bd_addr,port))
                          data = ""

                          while 1:
                               tosend= input()
                               print("your  input is ",tosend)
                               if tosend!='q':
                               sock.send(tosend)

                               else:
                                   break

                          try:


                            data = sock.recv(255)
                            data_end = data.find('\n')

                            if (data_end != -1):
                                       rec = data[:data_end]
                                       print data
                                       data = data[data_end+1:]




                         except KeyboardInterrupt:
                                   pass            

if I run this code in python 3 I am also getting error sometime like timeout error 110 as well as (bluetooth btcommon bluetootherror 112 host is down ')

  • How should we know why your program is not working? Can you please edit your question and copy the program source to it? – Ingo Mar 25 at 13:35
  • Ingo sorry for the inconvenience – BUBAI NAYAK Mar 25 at 13:56

Your Answer

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

Browse other questions tagged or ask your own question.