Attempt at implementing #563

Not tested (I don't have RasPi)