Questions tagged [gpio]

General Purpose Input/Output (GPIO) is a generic pin on a chip whose behavior (including whether it is an input or output pin) can be controlled (programmed) by the user at run time.

GPIO pins have no special purpose defined, and go unused by default. The idea is that sometimes the system integrator building a full system that uses the chip might find it useful to have a handful of additional digital control lines, and having these available from the chip can save the hassle of having to arrange additional circuitry to provide them. For example, the Realtek ALC260 chips (audio codec) have 8 GPIO pins, which go unused by default. Some system integrators (Acer Inc. laptops) employing the ALC260 use the first GPIO (GPIO0) to turn on the amplifier used for the laptop's internal speakers and external headphone jack.

Further information and deeper analysis: Opus on wikipedia

1751 questions
67
votes
5 answers

Docker Access to Raspberry Pi GPIO Pins

When running Docker on the Raspberry Pi 2, how can we expose the GPIO pins to the Docker container?
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
51
votes
3 answers

NameError: name 'true' is not defined

I want to use Boolean ( true / false ) in my python source file, but after running the application, I receive the following error: NameError: name 'true' is not defined The error lies on while true:, when I am trying to make the Raspberry Pi run a…
Jesper Andersen
  • 597
  • 1
  • 4
  • 7
33
votes
3 answers

Sphinx: how to exclude imports in automodule?

I have a Raspberry Pi project written in Python that uses RPi.GPIO module. All the work on the code is done on a Windows box where RPi.GPIO will not install and every time I try to run autodoc it crashes saying it cannot import…
pandasauce
  • 1,136
  • 2
  • 9
  • 11
32
votes
5 answers

How to find out which Linux driver is hogging my GPIO

I have a pad multiplxed as GPIO on my board. When I try to export it via /sys/class/gpio/export, I get -sh: echo: write error: Device or resource busy My guess is some other driver is requesting this pad before I get that chance. How can I find…
Atilla Filiz
  • 2,383
  • 8
  • 29
  • 47
30
votes
7 answers

Driving Beaglebone GPIO through /dev/mem

I'm trying to write a C program for blinking a LED on the Beaglebone. I know I can use the sysfs way...but I'd like to see if it is possible to get the same result mapping the physical address space with /dev/mem. I have a header file,…
Salvatore
  • 1,145
  • 3
  • 21
  • 42
22
votes
2 answers

Cannot disable systemd serial-getty service

On Raspberry Pi with Arch Linux there is a service active called serial-getty@AMA0. The unit file is: /usr/lib/systemd/system/serial-getty@.service As root I can invoke systemctl stop serial-getty@ttyAMA0 systemctl disable serial-getty@ttyAMA0 But…
lojoe
  • 521
  • 1
  • 3
  • 13
22
votes
4 answers

Raspberry Pi- GPIO Events in Python

I am using the GPIO pins on my Raspberry Pi with a PIR sensor to detect motion. When the sensor detects motion I want to then move the software onto other functions. At the moment, to detect motion I have my program constantly running in a loop…
Stefoth
  • 261
  • 1
  • 2
  • 4
20
votes
1 answer

Accessing the GPIO (of a raspberry pi) without ``sudo``

This question might not be specific to the raspberry pi, of course. Also, I'm relatively new to Linux. I want to write a little library (in node.js, if that matters) to access the GPIO of the raspberry pi using the sysfs. However, accessing the…
Rakesh Pai
  • 26,069
  • 3
  • 25
  • 31
13
votes
2 answers

Named GPIOs in DeviceTree

I am trying to create a device tree for an embedded system, and would like to expose a few GPIOs to userspace. These are not and should not be used by kernel drivers. For instance, there is a USB device soldered to the board that is controlled by…
FazJaxton
  • 7,544
  • 6
  • 26
  • 32
13
votes
2 answers

mmap slower than ioremap

I am developing for an ARM device running Linux 2.6.37. I am trying to toggle an IO pin as fast as possible. I made a little kernel module and a user space application. I tried two things : Manipulate the GPIO control registers directly from the…
Julien
  • 1,181
  • 10
  • 31
12
votes
1 answer

Python button functions oddly not doing the same

I currently have 2 buttons hooked up to my Raspberry Pi (these are the ones with ring LED's in them) and I'm trying to perform this code #!/usr/bin/env python import RPi.GPIO as GPIO import…
user5740843
  • 1,540
  • 5
  • 22
  • 42
11
votes
1 answer

Periodic task in a Linux kernel module

Currently I am developing GPIO kernel module for friendlyarm Linux 2.6.32.2 (mini2440). I am from electronics background and new to Linux. The kernel module loaded at start-up and the related device file is located in /dev as gpiofreq. At first time…
JD1910
  • 183
  • 1
  • 8
11
votes
1 answer

Purpose and usage of GPIO-Hog declaration

Questions What is the purpose and use-case of the gpio-hog declaration? Can a 'hogged' gpio pin be interfaced with from Userspace? If a 'hogged' gpio pin cannot be interfaced with from Userspace, then is there any mechanism to configure GPIO pins…
Liam Kelly
  • 3,524
  • 1
  • 17
  • 41
11
votes
4 answers

ValueError: The channel sent is invalid on a Raspberry Pi - Controlling GPIO Pin 2 (BOARD) using Python causes Error

So I have a tiny little fan connected to pin 6(Ground) and pin 2. I am trying to manually start and stop the fan when needed but I am getting this error when trying: ValueError: The channel sent is invalid on a Raspberry Pi Here is my code that I am…
Georgi Angelov
  • 4,338
  • 12
  • 67
  • 96
11
votes
1 answer

Turn USB power off/on with BeagleBone Black kernel >= 3.8

I need to: turn off -> sleep some seconds -> turn on the USB power of beaglebone black to be able to hardware-reset a device that is connected to USB (Huawei E220 Modem) Already tried soft-reset (with unbind/bind and with authorize 0/1), but…
pzn
  • 502
  • 3
  • 11
1
2 3
99 100