Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • 1
    Instead, maybe check this. Nothing says you have to have root rights. // Using the setuid bit still makes the script run as root (except scripts cannot use setuid). I suggest you read up a little on Linux and chmod and whatnot.
    – Daniel B
    Commented Mar 23, 2022 at 18:45
  • You should never ever set the SUID bit on a script As Daniel pointed out you can allow your normal user to access GPIO just fine. Commented Mar 23, 2022 at 18:49
  • Thanks, to both of you - actually I already found the question but I didn't get it to work. I will take a closer look. And even though setting the suid bit is not recommended, I am interested what I missed. The owner is root, the executable and suid bit are set and still when I run my python gpio script I get the dev/mem permission denied error. Also tried this with a bash script and whoami -> echoes pi. Its a bit frustrating, every solution I found is either not working or not recommended...
    – ningelsohn
    Commented Mar 24, 2022 at 20:35
  • I updated my question, seems like the package I am using doesn't supports /dev/gpiomem
    – ningelsohn
    Commented Mar 24, 2022 at 21:13
  • Relevant? Commented Mar 24, 2022 at 21:27