Questions tagged [sysfs]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
8 votes
1 answer
4k views

GPIO callbacks in any language

I know the linux kernel has a language agnostic GPIO interface through /sys/class/gpio which can be manipulated with echo, cat, etc. How can this be used to create event driven callbacks ...
goldilocks's user avatar
  • 58.9k
2 votes
4 answers
3k views

Using GPIO PWM with sysfs

I'm able to write to GPIO pins with sysfs with the standard commands like echo "1" > /sys/class/gpio/gpio6/value, but that only turns the pin on or off. I tried echo "0.5" > /...
Synetech's user avatar
  • 131
2 votes
1 answer
661 views

Raspberry GPIO button sysfs

I am trying to connect a button to my raspberry pi 3 (model B). I want to do it via the sysfs approach. Here is a picture or my small circuit: It cannot be simpler: the black wire is connected to a ...
Gru-gru's user avatar
  • 151
2 votes
1 answer
276 views

Configure Alt GPIO using sysFS

I have a Model B Revision 1.0 + ECN0001 that I am making a program in C to read and control a HCTL-2022 Quadrature Decoder using the GPIOs by way of sysfs. It's working great, but now I would like to ...
hoss's user avatar
  • 123
2 votes
1 answer
69 views

Intermittent access errors when writing to GPIO using SYSFS and Ruby

I am using Ruby to drive output GPIO pins using the old SYSFS pseudo-filesystem interface, and am regularly encountering intermittent Errno::EACCES: Permission denied @ rb_sysopen errors. My user is a ...
Dan's user avatar
  • 125
2 votes
0 answers
65 views

EasyDriver stepper motor through sysfs not moving

I'm trying to activate a stepper motor using easydriver from here https://www.schmalzhaus.com/EasyDriver/Examples/EasyDriverExamples.html using sysfs and C, but it doesn't move. I connected my ...
Cris's user avatar
  • 121
1 vote
2 answers
5k views

Is there a way to use interrupt-driven GPIO input through the sysfs interface without a race condition?

I want to use the GPIO pins to wait for a button-press without using a CPU spin loop. My preferred way of using the GPIO pins is via the sysfs interface at /sys/class/gpio, but it seems to me that ...
Dolda2000's user avatar
  • 111
1 vote
1 answer
1k views

Overclocking - CPU Frequency Measurement Accuracy: vcgencmd vs cpuinfo_cur_freq

As a follow-up to this question: Raspberry Pi B+ Overclocking: Force Turbo not working I had trouble getting force turbo to work. I was using the command: sudo vcgencmd measure_clock arm to get the ...
user123456098's user avatar
0 votes
2 answers
595 views

Interfaces besides sysfs for GPIO programing in C

I am writing GPIO functions in C using standard libraries that come with the raspberry pi, and do not require installing other libraries such as wiringpi. So I have been using stdlib.h and stdio.h, ...
j0h's user avatar
  • 2,473
0 votes
1 answer
35 views

sysfs pwm: corresponding pins and LED driving

Using a Raspberry Pi 3B+ with Linux raspberrypi 5.10.103-v7+ #1529 SMP Tue Mar 8 12:21:37 GMT 2022 armv7l GNU/Linux I would like to drive an LED with pwm. There are two couples of GPIO pins which ...
BowPark's user avatar
  • 101
0 votes
0 answers
157 views

sysfs blocks gpio pins after one minute from restart

I am using Raspberry pi 4b with Linux raspberrypi 5.10.63-v7l+. I am writing simple userspace program for control one GPIO by ioctl() (in my case GPIO 13 for example). However program responses: ...
Aro Math's user avatar
0 votes
1 answer
948 views

Ubuntu 19.10 64-bit on Raspberry PI 4: How to unlock 100 MGz as min cpu frequency?

Is there way to unlock min cpu frequency for Ubuntu 19.10 64-bit for raspberry pi? First, this linux does't have /boot/config.txt similar to raspbian or ubuntu 18.04 from berryboot Next, the ...
Professor Pro's user avatar
-1 votes
2 answers
143 views

Translate GPIO pwm commands to linux sysfs interface

I am trying to translate some raspberry pi gpio pwm commands to use the linux sysfs interface to control the pins instead in order to get the same pwm output. The goal of this is to provide pwm output ...
turtlemcnuggets's user avatar