Git Product home page Git Product logo

Comments (5)

antsmo avatar antsmo commented on August 24, 2024

My apologies for the double submit, please delete the other issue.

This was solved by running the script with SUDO

from onoff.

fivdi avatar fivdi commented on August 24, 2024

@SimonTheEngineer if Raspbian Jessie is being used as mentioned here then it should not be necessary to run the script with sudo if logged on as user pi. Were you logged on as user pi?

from onoff.

antsmo avatar antsmo commented on August 24, 2024

I was yes, fresh install too so all permissions should be default

from onoff.

fivdi avatar fivdi commented on August 24, 2024

I just gave it a try with Raspbian Jessie and don't have the issue. i.e., it's not necessary to run the script with sudo.

What happens if you run the following commands from the command line? They should turn the LED connected to gpio4 on. Do the commands turn the LED on or is there an EPERM error?

pi@raspberrypi:~ $ cd /sys/class/gpio/
pi@raspberrypi:/sys/class/gpio $ echo 4 > export 
pi@raspberrypi:/sys/class/gpio $ echo out > gpio4/direction 
pi@raspberrypi:/sys/class/gpio $ echo 1 > gpio4/value 
pi@raspberrypi:/sys/class/gpio $ 

from onoff.

fivdi avatar fivdi commented on August 24, 2024

Note that EPERM: operation not permitted, write isn't actually related to permissions. An EPERM error occurs when an operation is not permitted because it doesn't make sense. In this case it looks like the EPERM error occurred because an an attempt was made to write data to an input. Here's an example:

pi@raspberrypi:~ $ cd /sys/class/gpio/
pi@raspberrypi:/sys/class/gpio $ echo 17 > export 
pi@raspberrypi:/sys/class/gpio $ cd gpio17
pi@raspberrypi:/sys/class/gpio/gpio17 $ echo in > direction 
pi@raspberrypi:/sys/class/gpio/gpio17 $ echo 1 > value 
-bash: echo: write error: Operation not permitted
pi@raspberrypi:/sys/class/gpio/gpio17 $ 

Errors related to permissions are usually EACCES errors.

from onoff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.