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.

Filter by
Sorted by
Tagged with
8
votes
2answers
7k views

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 ...
6
votes
2answers
15k views

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 ...
6
votes
1answer
625 views

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 ...
5
votes
1answer
78 views

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 ...
5
votes
0answers
136 views

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 ...
4
votes
1answer
203 views

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 ...
4
votes
1answer
3k views

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 ...
4
votes
1answer
2k views

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 ...
4
votes
0answers
382 views

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 ...
3
votes
1answer
598 views

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 ....
3
votes
1answer
1k views

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 ...
3
votes
1answer
2k views

How to make a remote pigpiod socket call?

The pigpio GPIO library seems to provide a mechanism to invoke the pigpiod demon remotely using TCP/IP sockets. However, there appears to be some details missing. For example: Do we use a TCP or ...
3
votes
1answer
648 views

2 pigpio programs at the same time

I've made some programs with the pigpio library, all of them are working well, but when I try to run 2 at the same time I get this error (For the second one). initInitialise: Can't lock /var/run/...
3
votes
1answer
307 views

Output from pigpio unexpected

I have attached a DHT-22 weather sensor to my rev 1 raspberry pi after a fresh install of a recent install of debian. Following the instructions from https://www.youtube.com/watch?v=IHTnU1T8ETk I ...
3
votes
1answer
196 views

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 ...
3
votes
1answer
78 views

pigpio pwm — gpio <pin_no> 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 ...
3
votes
0answers
744 views

How to use pigpio to control 3 stepper motors with drivers

I need to control 3 independent stepper motors with stepper motor drivers using RPi. Driver of each motor requires STEP pulse to make one step (let's not bother about DIR and ENABLE signals for now). ...
2
votes
1answer
12k views

How to use pigpio to control a servo motor with a keyboard?

My aim is to be able to control a servo motor with my keyboard in a real time fashion using the python module of pigpio. That is, when I press say the 'w' key it rotates clockwise and when I press the ...
2
votes
2answers
2k views

python library to generate pulse frequency of “n” hz

I'm trying to make a function which would output a pulse frequency , given a Ts (time.sleep(ts) on my function) The function is for later use on an acceleration ramp for a stepper motor , as the ...
2
votes
1answer
159 views

Does pigpiod feature a verbose / debug mode?

As I'm currently trying to debug an issue with my SPI link, which is addressed through pigpio, I'd like to make pigpiod write warnings and debug messages (if such occur) to stderr.
2
votes
1answer
2k views

How to use piscope from my pigpio library on python

I want install piscope for my raspberry by python but after I installed according to link http://abyz.me.uk/rpi/pigpio/piscope.html, I not know how call piscope and using it how? I do as @joan guide ...
2
votes
1answer
558 views

pigpio PWM and ALSA

My Qt ( C++ ) application successfully dims the screen using the pigpio library on my Raspberry Pi compute module. It works great and is very stable using the code below. The problem, is that my ...
2
votes
1answer
93 views

Any way to add more GPIOs to the AIY Voice Kit?

I'm working on a project using the google AIY Voice Kit V2 as a base. I'm planning on adding a keypad which requires 12 GPIOs. Does anyone know of a way to add more GPIOs to the Pi Zero W with AIY ...
2
votes
1answer
73 views

Two data parsing frames for SPI reads of MCP3008 ADC, any advantages or disadvantages of either one?

I am reading an MCP3008 ADC using pigpio, I've abstracted the script below. I have also found a slightly different construction or parsing of the three SPI command bytes and reconstruction of the ADC ...
2
votes
1answer
1k views

pigpio = DHT22 humidity sensor + TMP36 readings PROBLEM

What I'm trying to do is to read temperature from TMP36 sensor (over MCP3008 ADC), light from LDR, and humidity from DHT22 sensor. Firstly, I had one script for temperature and light readings, and it ...
2
votes
2answers
13k views

How to read Wiegand card ID?

I need a simple script that outputs ID of presented card in console. I tried a lot of opensource code that based on WiringPi library, e.g. Pidoorman, its forks by Kyle Mallory and E.J. Dyksen, RFID ...
2
votes
1answer
792 views

PIGPIO stream pwm data over websockets with nodejs. GPIO

i use servoblaster, one of the first projects for PWM (pulse with modulation) on the raspberry pi. Now i got a new raspberry and i wanted to try the very promising pigpio. It looks really fast and ...
2
votes
1answer
75 views

Is there a way to slow down servo movement speed?

Despite searching I was not able to find an answer to this question. I have a servo attached to a pin that moves an arm back and forth. The problem is that it moves too quickly. Is there a way ...
2
votes
1answer
48 views

remote connection pigpio

Asking the other day this question I discovered a new fascinating world, the gpio zero library. My first code was this (an example to blink a led): from gpiozero import LED from time import sleep ...
2
votes
1answer
592 views

Can GPIO mode be changed at once for more than one pin?

I'm currently trying to understand the pigpio library and I found it supports reading from and writing to more than one GPIO pin at once. However can it do the same with pin mode? I'm asking the ...
2
votes
1answer
4k views

Measure rpm using hall sensor and pigpio

So far i get a hall sensor and a raspberry pi 3. The hall sensor has 3 wires. I connected 2 of them for power it up (12v) and on the signal one i put a voltage divider to get around 3V on the output. ...
2
votes
1answer
322 views

Issue with pigpio. Can't set GPIOs

I've installed the pigpio library and so I decided to check it with a simple script that I hope it's right. I wanted to write a script whenever the PIR sensor detected motion. I've checked with ...
2
votes
1answer
41 views

CE1 not going low for pigpio.spi_open() with flags

I'm attempting to modify joan's test script (https://raspberrypi.stackexchange.com/a/44320/42126) for an RPi SPI master to communicate with an Atmega328P slave. I cannot change which GPIO pins I have ...
2
votes
1answer
923 views

Active Piezo Buzzer Makes Sound On Both Rpi GPIO Low and High Level Signal

Goal: I want to replace a status-LED with a status-buzzer I use the same code which worked with the status-LED: (1) on start set buzzer to LOW (2) wait some time, than "blink" once (HIGH 200 ms then ...
2
votes
1answer
189 views

Pigpio reading sensor returning -83”i2c read failed”

I am testing using my new air quality 5 click sensor with my Raspberry Pi (https://www.mikroe.com/air-quality-5-click) using command line. When I enter i2cdetect -y 1it appears at address 48. Then ...
2
votes
1answer
488 views

Using hardware PWM and audio simultaneously

I am developing a project on a Raspberry Pi 3 B+. I am using the PWM0 channel to send a custom-made IR signal using PiGPIO waves. I gather it might then be possible to use PWM1 for mono audio; is that ...
2
votes
1answer
246 views

Are these both reasonable ways to check on the status of pigpiod from within Python?

I'm trying to check on the status of the pigpiod process from within a python script. These two methods both appear to work so far. Are there any significant advantages or disadvantages of one over ...
2
votes
1answer
408 views

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 ...
2
votes
1answer
333 views

error in atexit._run_exitfuncs when using DHT22 with pigpio library

I am using PIGPIO library to read temperature and humidity from a DHT22 sensor. This is the script I am using. import os import sys import time import pigpio pi = pigpio.pi() import DHT22 s = DHT22....
2
votes
1answer
776 views

Input NE555P pulses and measure width and frequency

After exhausting the google searches, I decided to post here for the first time. As the title suggests, I have created the NE555P circuit and although I can calculate the frequency and high/low width, ...
2
votes
1answer
437 views

Is Joan's pigpio rotary Encoder C library callable from python ctypes?

I'm using Python class Rotary Encoder to implement a Position PI on a stepper motor and using this encoder H6BM-1000-500-IE-S-H The code is working quite well, however I'm getting an error of ~5mm ...
2
votes
1answer
474 views

Is it possible to speed up code processing time by increasing i2c baudrate?

Is it possible to speed up execution time of a c++ program in raspberry pi solely by increasing the i2c baudrate and increasing the sampling frequency of the sensors? I have the issue of sudden ...
2
votes
1answer
226 views

pigpio returns -999.00 from pin 18

Thanks to this forum, I was able to successfully use the PIGPIO library to get my DHT22 sensor to work. My next requirement is to attach an RTC chip and it seems to use pin 4, which works for my ...
2
votes
0answers
25 views

Problem with PI GPIO using BB SPI

I've developed a PI Python application to replace an old control card which sent bit banging out to daisy chained LED drivers. It all works fine except when I need some fast updating of the LED's. ...
2
votes
2answers
146 views

AC mains dimmer dimming 7W LED lamp problem (RpiZero + MPDM V4.1)

I'm trying to dim a 7W LED with a Raspberry Pi Zero for home automation. However it doesn't work as expected. I followed this tutorial : https://www.youtube.com/watch?v=wqY4-gHqvZI . I have the exact ...
2
votes
0answers
41 views

Waveform not cancelling out hardware PWM

I've run into problems using pigpio's wave generator in combination with hardware PWM. Currently I'm working on a motion control with acceleration/sustain/deceleration phases. The phases are saved ...
2
votes
1answer
219 views

Pigpio not calling Callback for first rising or falling edge

I have some sample code (taken out of my larger program) that regularly (but not always) missing the first rising edge: #!/usr/bin/python import pigpio, time def callback(g, l, t): print("Callback ...
2
votes
2answers
110 views

pigpio I2C reply value

I'm sending a command e.g. "wifion" with I2C arduino(master) to RPI(slave) That works perfect but I need to return a confirmation value. How can I send back/reply from the RPI to the Ardunio a value? ...
2
votes
0answers
72 views

Trying to use pigpio wavechains to drive very specific acceleration and deceleration

I'm working on a kinetic sculpture that involves a large pendulum swinging perpetually left to right. I'm using a raspberry pi 3 B+ / arduino uno with a DM860AC to control a nema 34 stepper. I was ...
2
votes
0answers
266 views

Any GPIO library that supports I2C multi-master mode?

I am thinking of joan's PIGPIO library but I am aware there are others for the RPi, and I was wondering whether there are any that support multi-master I2C mode? As far as I can tell {see here} this ...