Attempt at implementing #563

Not tested (I don't have RasPi)
Merge pull request #605 from tonibm19/patch-1

Attempt at implementing #563