maruel / dlibox

Home automation that does not depend on the internet
http://www.dlibox.com
Apache License 2.0
26 stars 1 forks source link

pio: permission errors turn into "invalid pin number" #5

Closed tve closed 8 years ago

tve commented 8 years ago

When running one of the sample programs, such as pin-write, without sufficient permissions to access the specified pins the error is "invalid pin number" instead of a more comprehensible permission denied type of error. The reason seems to be that the inaccessible pins are not registered by the driver and thus ByNumber says they don't exist. Instead, the driver should register all pins found but attach an error to those that can't actually be used. This way that error can be returned by ByNumber (and other functions to get hold of the pin).

maruel commented 8 years ago

Agreed, the problem is in sysyfs/gpio.go when it tried to export the pin. Error messages haven't been optimized yet.

tve commented 8 years ago

NP. I didn't mean the issue as "fix it!" but more to record the issues I encounter somewhere so they don't get forgotten.