fivdi/pigpio

Freeze when using invalid GPIO numbers

lmeysel opened this issue · 1 comments

Just a minor issue, but after migrating from rpio to this lib, i used the physical GPIO numbers. Starting my software freezed the Pi Zero W and forced me to hard-reset.

Throwing an exception could have saved me few hours of debugging.

fivdi commented

The smallest valid GPIO number accepted by pigpio is 0 (Gpio.MIN_GPIO) and the largest valid GPIO number accepted is 53 (Gpio.MAX_GPIO). These are also the GPIO numbers accepted by the underlying pigpio C library. I'm not familiar with rpio but it looks like the pin numbers accepted by rpio are in the range 1 to 40. This means every valid rpio pin number is also a valid pigpio GPIO number. As such, it's not possible for pigpio to throw an error that would have helped to discover the problem mentioned above.