• I've found the python3 example code by now -but somehow this does not work on my pi:

    pi@millow:~ $ python3 bluepi_uart.py c4:f0:3e:4d:c2:9d
    Traceback (most recent call last):
      File "bluepi_uart.py", line 34, in <module>
        nustx.write(command[0:20]);
      File "/home/pi/.local/lib/python3.5/site-pack­ages/bluepy/btle.py", line 200, in write
        return self.peripheral.writeCharacteristic(self­.valHandle, val, withResponse)
      File "/home/pi/.local/lib/python3.5/site-pack­ages/bluepy/btle.py", line 542, in writeCharacteristic
        self._writeCmd("%s %X %s\n" % (cmd, handle, binascii.b2a_hex(val).decode('utf-8')))
    TypeError: a bytes-like object is required, not 'str'
    

    This is on a pi with python 3.5, bluepi itself seems to work and run. Also I would like to use python3 - but I am really not an expert here. Any ideas?

About

Avatar for hansamann @hansamann started