Fixed up code (now it works) on rpi