FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

I/O: Improve messaging when user doesn't have permissions to write to… · meikis/processing@a0d5cd7 · GitHub

Repository navigation

Commit a0d5cd7

Browse files
committed
I/O: Improve messaging when user doesn't have permissions to write to LEDs
This is e.g. the case with the newly released Raspbian 2015-09-24.
1 parent 243b4a7 commit a0d5cd7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • java/libraries/io/src/processing/io

‎java/libraries/io/src/processing/io/LED.java‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ public LED(String dev) {
8787
String fn = "/sys/class/leds/" + dev + "/trigger";
8888
int ret = NativeInterface.writeFile(fn, "none");
8989
if (ret < 0) {
90-
throw new RuntimeException(fn + ": " + NativeInterface.getError(ret));
90+
if (ret == -13) { // EACCES
91+
System.err.println("You might need to install a custom udev rule to allow regular users to modify /sys/class/leds/*.");
92+
}
93+
throw new RuntimeException(NativeInterface.getError(ret));
9194
}
9295
}
9396

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL