Comments (5)
My apologies for the double submit, please delete the other issue.
This was solved by running the script with SUDO
from onoff.
@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.
I was yes, fresh install too so all permissions should be default
from onoff.
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.
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)
- Problem using watch function with relay HOT 10
- Initialize GPIO without change pin status. HOT 6
- GPIO not working in a worker_thread - nodejs 14.15 HOT 2
- EACCES: permission denied, open '/sys/class/gpio/export' as superuser HOT 2
- Cannot run on non Rpi system HOT 1
- TypeError: writeSync is not a function HOT 4
- Raspberry Pi GPIO control in electron App HOT 8
- My computer does not have a /sys/class/gpio directory, but has /dev/gpiochip* HOT 1
- Interrupt misfire HOT 3
- Raspberry 4 - malloc(): corrupted top size HOT 3
- Error: EPERM: operation not permitted, write HOT 4
- Does not work with Compute Module 4. HOT 2
- Event is fired multiple times
- Superb library - I am running on Node v20 HOT 2
- Pi 5 Compatibility issues HOT 9
- Compatibility with ppp asked?
- RPI 5 gpio numbers HOT 2
- fs error HOT 8
- Newer version of epoll
- Button.watch spams endlessly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onoff.