Closed tve closed 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.
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.
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).