title: 'utf-8' codec can't decode byte 0xc4 in position 6: unexpected end of data
body: <p>I'm coding with Python on Raspberry pi 2.</p>
  
  <p>I'm trying to send several orders to two devices by bluetooth at the same time but it doesn't work.</p>
  
  <p>According to the error message, when I send an order to the second device, I can't decode the response. I already tried to encode with 'UTF-8' but it didn't work either...</p>
  
  <p>Here is the error message:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/pi/Desktop/Bluetooth-master/Bluetooth-master/rfcommcli.py", line 60, in &lt;module&gt;
      StartBTClient()
    File "/home/pi/Desktop/Bluetooth-master/Bluetooth-master/rfcommcli.py", line 54, in StartBTClient
      print('reception 2 : ', rec2.decode())
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc4 in position 6: unexpected end of data
  </code></pre>
  
  <p>So can you help me, please.</p>
  
  <p>Here is the code :</p>
  
  <pre><code>import bluetooth
  
  
  class BT(object):
  
      address_2 = ('00:04:3E:93:39:A9')
      address_1 = ('00:04:3E:6A:10:A9')
  
      def __init__(self):
          self.btSocket = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
  
      def __exit__(self):
          self.Disconnect()
  
      def Connect(self, mac, port=1):
          self.btSocket.connect((mac, port))
          print('Connecter')
  
      def Disconnect(self):
          try:
              self.btSocket.close()
          except Exception:
              pass
  
      def Send(self, data):
          self.btSocket.send(data.encode())
  
      def Receive(self, size=1024):
          return self.btSocket.recv(size)
  
  
  def StartBTClient():
      cli = BT()
      print('BT1 Connexion en cours ...')
      #cli.Discover()
      cli.Connect(cli.address_1, 0o01)
  
      cli2 = BT()
      print('BT2 Connexion en cours ...')
      #cli.Discover()
      cli2.Connect(cli2.address_2, 0o02)
      print('Donner un ordre ... (ordre shutter)')
  
      while True:
          data = input()
          if (data == 'exit'):
              break
          cli.Send("read\r")
          cli2.Send("read\r")
          rec = cli.Receive()
          rec2 = cli2.Receive()
          print('reception 1 : ', rec.decode())
          print('reception 2 : ', rec2.decode())
  
      cli.Disconnect()
      cli2.Disconnect()
  
  if __name__ == '__main__':
      StartBTClient()
  </code></pre>