I ran into the following error while trying to read serial input on a Raspberry Pi hooked up to an Arduino via USB:
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0za8 in position 0: invalid start byte
The solution was as follows:
#buffer_string = ser.read().decode('utf-8')
buffer_string = ser.read().decode('utf-8', errors='replace')
Thanks to the following link: https://github.com/OpenBCI/OpenBCI_Python/issues/24
Just thought I’d leave a couple of links to some guides I came across for setting up boot scripts on a raspberry pi.
Quick guide on how to get them running: http://www.instructables.com/id/Raspberry-Pi-Launch-Python-script-on-startup/
How to delay the boot process until the network is available: https://raspberrypi.stackexchange.com/a/45774
A bit of weird issue today – my RaspberryPi kept reverting to the login screen. To get around this, open command prompt from the login screen (ctrl + f1) and then run sudo rm ~/.Xauthority
Reboot and then it should work normally.
I ran into a bit of a weird issue with a raspberry pi camera preview today. After starting the preview I hit an uncaught exception which meant that exitPreview was never called.
To get around this use the terminal hotkey and kill the python process. Note that while you won’t be able to see the terminal, it will be running in the background.
ctrl + alt + t