Exception: JVM exception occurred: read failed, socket might closed or timeout, read ret: -1 java.io.IOException

41 views Asked by At

I am encountering following error when connecting my Kivy application to Bluetooth.

Exception: JVM exception occurred: read failed, socket might closed or timeout, read ret: -1 java.io.IOException

I am using Pyjnius. Can anyone help me?

Here's what I initiated:

try:
  # Create a Bluetooth socket
  socket = device_to_connect.createRfcommSocketToServiceRecord(UUID.fromString("00001101-0000-1000-8000-00805F9B34FB"))

  # Connect to the device
  socket.connect()
  self.update_label('Connected to the paired device successfully.')
 
  # Close the socket when done
  #socket.close()

except Exception as e:
  print(e)
  self.update_label(f"Error connecting to the paired device: {str(e)}")

I have already tried other ways but there's nothing that works so far.

0

There are 0 answers