Questions tagged [pigpio]

pigpio is a library for accessing GPIO pins as well as other functions including I2C. pigpio has a client-server architecture , which enables you to remotely control GPIO pins.

Pigpio is a library for accessing GPIO pins as well as other functions including I2C. The home page for Pigpio is http://abyz.me.uk/rpi/pigpio/index.html.

Please Note!

If you are not aware, there are a number of different pieces of software that serve a similar fundamental purpose (controlling the Raspberry Pi GPIO pins) and are independent of one another. Not surprisingly, they also all use spins on combining "rpi" and "gpio" in their name. Each has a separate tag and questions about their use should use that specific tag. This is documented here to prevent confusion.

  • The page you are on now is for the pigpio library, written in C but with ports to python and other languages: Tag
  • The RPi.GPIO module for python: Tag
  • The pi-gpio library, for node.js (javascript): Tag

This isn't intented as an exhaustive list of such software, just the three most prone to confusion here due to the similar names perhaps made more similiar by restrictions on tag labels (all lower case, etc).

314 questions
16
votes
2 answers

Raspberry as an I2C SLAVE

Does anyone know how to setup a Raspberry Pi 3 as an I2C slave (in C++)? Before someone answers saying that it's not possible, it is possible. Here is a link that says it is possible (pigpio documentation) This is the code I'm trying to use (from…
Sebastião
  • 163
  • 1
  • 1
  • 8
13
votes
2 answers

pigpio Can't lock /var/run/pigpio.pid

Trying to run the pigpio example program freq_count_1 I get the error Can't lock /var/run/pigpio.pid. The gpiotest program, however, runs as expected. Below you can see what I did. I have a Raspberry Pi 2 running Jessie. gcc -Wall -pthread -o…
user37342
  • 301
  • 1
  • 2
  • 4
7
votes
1 answer

pigpio - set_PWM_dutycycle vs hardware_PWM

What is the difference between the set_PWM_dutycycle function and the hardware_PWM function in the pigpio python library when assuming the same frequency is set for both the functions. Will I get a more stable output from one versus the other? I'm…
Peter Zhu
  • 278
  • 3
  • 12
6
votes
0 answers

Raspberry as I2C Slave, how to slow down transfer rate?

I have had minor success using the PIGPIO library and interfacing the Pi as an I2C Slave (Using GPIO Pins 18 and 19 as SDA and SCL) with a Campbell CR1000X Datalogger I am encountering a problem receiving messages after I slow down the scan rate…
6
votes
1 answer

I2C repeated start with BitBanging not working - Pigpio library on Raspberry Pi B+

First post here on the forum! Been getting a lot of help here from all the past posts and I am grateful for such a great community. I have been trying to use Repeated Start by using the PIGPIO library using bitbanging. However, I have not been able…
Thomas
  • 61
  • 1
5
votes
1 answer

Is there a GPIO current limit function available, and where is the documentation?

I have read that limits may be programmed for the output current of GPIO pins. However, after reading several online versions of Broadcom's data sheet for the SoC, I've found nothing to corroborate the data in this reference. Is there a "definitive…
Seamus
  • 23,558
  • 5
  • 42
  • 83
5
votes
1 answer

How does pigpio's wave_chain() method happen in hardware?

The Python package pigpio has a wave_chain() method that allows one to chain together a series of waveforms in an easy-to define looping structure. But the GPIO chip itself has quite a limited number of 32-byte registers. Is the CPU executing this…
uhoh
  • 562
  • 6
  • 21
5
votes
3 answers

How fast can GPIO pins toggle on the Pi 4?

Benchmarking of the Pi 4 using the Python GPIO Zero library shows a significant increase in the frequency of toggling a GPIO pin on and off compared to previous models. This result is attributed to the higher CPU speed. source Other benchmarks,…
Ghanima
  • 15,958
  • 17
  • 65
  • 125
4
votes
1 answer

Multiplexing to 1000 devices, Raspberry Pi and Python

All, I'm working to develop a piece of hardware that allows me to control 1000 outputs (servos) from a single output pin. I'm using pigpio on a Raspberry Pi B3 with python. I'm also using an array of 74HC4051 multiplexers. I've created a board…
user2355051
  • 153
  • 5
4
votes
1 answer

gpiotest problem and gpio 30

After soldering a header on my Pi Zero W I used pigpio's gpiotest utility to check for problems. I was dismayed that this produced no output and crashed the Pi. After stepping through the tests I found what had caused the problem (operator error). I…
Milliways
  • 62,573
  • 32
  • 113
  • 225
4
votes
1 answer

Counting Pulse Length Using PiGPIO

Background I am trying to get a particle sensor to work with the Raspberry Pi (model B+). I am using the Shinyei PPD42N6 (datasheet here). The sensor outputs a digital signal with pulses ranging from 10-90ms. According to the datasheet, the…
Jonathan
  • 141
  • 1
  • 2
4
votes
1 answer

PIGPIO without sudo

I am working on setting up an automated deployment of an executable using the PIGPIO C bindings to a Pi Zero. I copy the executable to the pi (into a directory on pi user's desktop) as expected, but when I try to run it, I get a permissions…
RedBassett
  • 141
  • 1
  • 3
3
votes
1 answer

pigpio pwm -- gpio bad dutycycle (nnn)

I'm tinkering with the pigpio [C] PWM functions and get ``pio bad dutycycle (nnn)'' messages while cycling an LED with increasing/decreasing gpioPWM() values. As always, any help will be greatly appreciated. Code: #include #include…
Farad'n
  • 127
  • 1
  • 11
3
votes
1 answer

Where do the pigpio watchdogs run? Could watchdogs on multiple GPIO pins conflict?

I'm using pigpio bit-banging script (download, GitHub) that interprets the pulse durations generated by the DH22 Temperature/Humidity sensor. It sets a 200 ms pigpio watchdog to the GPIO pin and attaches a callback, passing the tick count and new…
uhoh
  • 562
  • 6
  • 21
3
votes
2 answers

Is there a way to read the pullup status of a GPIO pin in python with, or if not, without pigpio?

I've discovered pigpio and am starting to learn to use it with Python. I thought I would use it to "discover" the pullup status of a pin before setting it, but while mode has both .set_mode() and .get_mode() methods as shown in this documentation,…
uhoh
  • 562
  • 6
  • 21
1
2 3
20 21