Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [gpiozero]

For questions relating to the python gpiozero library.

0
votes
0answers
16 views

Gpiozero inside custom function

So I have a odd problem. I have raspberry pi model 3 using gpiozero in python 3. Just trying to turn on the motor at half speed when calling the function. Issue is that nothing happens when ...
0
votes
0answers
21 views

GUI lag using Tkinter to update a dynamic label counter [closed]

I've created a simple program to change the LED blink rate (using a Raspberry Pi 2B running Raspbian) based on a GUI button input. The code works, but the problem I'm having is that there is a ...
2
votes
1answer
21 views

Attribute and Type Error using Button class in Tkinter/GPIO Zero combination

I'm new to programming and I'm trying to write a simple program to change the blink rate of an LED using a GUI. When I try to run this on my RaspberryPi 2B running Raspbian, I get the following ...
0
votes
1answer
28 views

Using `gpiozero` on `raspberry pi` to control pins, but output pins are reset upon script exit, even though state is remembered between runs

I am using gpiozero to control devices on the Raspberry Pi. When I create a reference to (for example) an LED device, there is a parameter for creating the object without effecting it's current state:...
1
vote
1answer
89 views

Python IDLE (mu-editor) “RuntimeError: Failed to add edge detection ” Error

from gpiozero import Button from signal import pause def say_hello(): print("Hello!") button = Button(2) button.when_pressed = say_hello pause() The above code works nicely in when I run it ...
0
votes
1answer
57 views

Wiring Omron D6T Thermal Sensor to Raspberry Pi Zero W with Adafruit T-Cobbler Plus

I have a Raspberry Pi Zero W connected to a Adafruit T-Cobbler Plus and breadboard. My question is regarding wiring. I have followed tutorials to create simple circuits, however, I am struggling to ...
-2
votes
1answer
67 views

Understanding the GPIO pins

I've not yet got into the GPIO pins. Can someone help me understand how they work? Are some of them special in some way? Do certain pins produce certain polarities or is that software defined? What ...
2
votes
1answer
55 views

LED not blinking

Raspberry Pi Zero Wireless I have a Pi Zero connected to a breadboard using the GPIO Extension Board and ribbon cable. I have followed several of the basic blinking LED tutorials. One jump cable is ...
1
vote
1answer
44 views

Monitor GPIO activity to debug possibly broken script

I recently picked up a b3+ and a nespi+ case. The case comes with a power and reset button and provides a script for the safe shutdown and for the most part has been driving me insane. I've fixed the ...
0
votes
1answer
52 views

RpiZeroW - Can't find `pigpio` while running Python code

I have a python code, using gpiozero. When running this code on a RPI-ZEROW it fails, while running same code on RPI3 it succeeds. All installed pretty much the same ( shown checks below ), pigpio is ...
0
votes
1answer
177 views

gpiozero : Not working, no error messages

I can't make gpiozero to work. Here is my config: raspbian on raspberry 3B V1.2 $ python -V return: python 2.7.13 $ python3 -V return: python 3.5.3 which mean that I have several version of ...
0
votes
0answers
37 views

HTTPServer / FTPServer loop colliding with callback thread

I am building an alarm application. I have a few PIR sensors and webcams. The application contains a webserver I use to manage the alarm from a mobile application done with kivy.The webcams upload ...
0
votes
2answers
381 views

How can I wait for two presses of the button then run function in while loop

I am trying to compute the difference between two images with OpenCV on Raspberry Pi and I want the script to run continually like in a while loop and then after the first button press store the first ...
1
vote
1answer
196 views

Fail to run Remote GPIO code from a PC using python3

I'm trying to run a remote GPIO code from a Linux machine to operate on RPI3. Code is running OK on another RPI3 to control each other, but when trying to do so from a PC, it fails. I followed the ...
0
votes
0answers
91 views

Remote GPIO Control Help

Detailed Storyline Of What I Am Trying To Do: I have two raspberry pis, RaspiA and RaspiB. I want to control the GPIOs of RaspiB remotely from RaspiA. I followed the instructions from http://...
3
votes
2answers
3k views

Failed to create MMAL component b'vc.ril.camera': Out of memory

I am trying to run a simple script that listens for a button click and then takes a picture. Once two pictures have been taken it compares the two using OpenCV to calculate the difference. I am ...
0
votes
1answer
266 views

Difference in using an LED with gpiozero vs. RPi.GPIO

I'm trying to turn on an LED and it was trivial with the gpiozero library. The following works just as expected. # Version 1 (working) import gpiozero import time led = gpiozero.LED(21) led.on() ...
1
vote
1answer
258 views

Showing “ssh packet_write_wait broken pipe” error while taking button input on Pi

I was trying to write a program which can take input from button. Here is the code: from gpiozero import Button btn = Button(4) while True: btn.wait_for_press() print('You pressed me') ...
1
vote
2answers
539 views

Run gpio script from startup to listen for button press and then execute command and bash script

I have this python script that is intended to run from startup and listen for a buttonpress. If there is a buttonpress (held for 2s) the gpio script should run two bash scripts. The python script runs ...
0
votes
0answers
111 views

Python, RpiZero and gpiozero

I'm coding on Rpi3 using python3. When trying to run a code, containing a gpiozero lib - it fails when running on RpiZero, while succeeds on Rpi3. RpiZero contains gpiozero lib Trying to find the ...
0
votes
1answer
56 views

MC3008 vs. Justboom amp

I just ordered the Justboom AMP Zero pHAT. My project needs reading analog signals, too. So I also ordered a MCP3008 in order to convert from analog to digital. My question: is it possible to connect ...
0
votes
1answer
147 views

Running Flask on Pi Zero getting uneven PWMLED

This is my first trial run using a Raspberry Pi Zero W to run RGB LEDs following this tutorial: https://dordnung.de/raspberrypi-ledstrip/ I've completed the tutorial, have everything wired up, and ...
0
votes
2answers
812 views

function button.is_pressed from gpiozero do not work

Im working on a university project with raspberry and gpiozero. I need to manage the button response to take diferent actions. The problem is that de function button.is_pressed its always true (even ...
0
votes
1answer
311 views

GPIOs of Pi3 not working

Problem Description I have experienced some problems with the GPIOs on my Pi3. From one day to another the MotionSensor and the LED strip that where connected to the GPIOs stopped working while the ...
0
votes
0answers
311 views

Direct control of GPIO pins using gpiozero without using Button or LED interface

Using gpiozero, is there a way to directly control the GPIO pins of the Raspberry Pi? I know gpiozero has objects such as Buttons and LED for input and output. However I would like to access the pins ...
0
votes
1answer
452 views

Ultrasonic program in raspberry pi stops working after some time

Below is the code I'm running on my raspberry pi zero to detect the range by Ping))) ultrasonic. after some time (ex: 300 pings) the program uses most of the CPU (90%) and then it stops working, is ...
1
vote
1answer
146 views

Upgrade to gpiozero 1.4 on Jessie breaks gpiozero

On a stock Jessie install, gpiozero works. E.g. >>> from gpiozero.devices import pin_factory >>> print(pin_factory) <class 'gpiozero.pins.rpigpio.RPiGPIOPin'> I then upgrade ...
1
vote
2answers
784 views

Using GPIOZERO button for 2 functions (Long/Short press )

I'm trying to make a dual use of 1 button: first use ( short press ) to exectute function "A", a second use ( long press ) to execute function "B". function A is executed after button1.when_pressed = ...
3
votes
1answer
321 views

PiCamera, PIR Motion Sensor 'Attribute Error: __exit__'

I'm pretty new to both Python and utilizing the GPIO pins on my Raspberry Pi. I am trying to make a "trail camera" that will take pictures of birds when they land on the branches of the trees just off ...
-1
votes
1answer
47 views

Raspberry Pi Zero get 5 V directly from the input

I have a Raspberry Pi Zero and I would like a tiny fan which draws 90 mA. Obviously, I can't connect it to the GPIO pins and therefore I need to get 5 V from the input cable. Before I ...
0
votes
1answer
316 views

gpiozero: Ignore false positives/negatives

I've seen several threads where users experience some noise fluctuation in the GPIO input readings, for instance, without any physical change to a Button's state, the events when_released/when_pressed ...
0
votes
2answers
156 views

Weird LED behaviour

I run my program: from gpiozero import PWMLED ledpins = [2, 3, 4] z = 10 for i in ledpins: PWMLED(i).blink(on_time=1/z, off_time=1/z, n=3) I tried it and got: Exception Exception ...
0
votes
0answers
161 views

Docker and IRQs disabled

Using a custom Docker image based on resin/raspberrypi-python, I have some code that accesses the GPIO to control some Energenie plugs. The container runs as --privileged. When I try to access the ...
4
votes
2answers
788 views

Python parallel processes for raspberry pi zero…possible?

I'm trying to setup a concurrent photo capture and immediate email of said capture (triggered by a PIR motion sensor) in a Python script. Basically what I'm trying to accomplish is to have my Pi take ...
1
vote
1answer
1k views

Python picamera module: Interval photo capture while recording video

So I've been trying to figure this out for a while now, without success. I am using a RPi Zero Rev 1.3 model and have connected it to the 8MP RPi camera along with a PIR motion sensor. What I'm ...
-1
votes
1answer
55 views

pi camera will not work with Pi zero

My Pi camera will not work with the Pi zero using the same python code I use on my Pi 3 or Pi 2 Is there something I am missing?
0
votes
1answer
554 views

GPIOzero motor backward and forward pins

When creating a new motor object from the GPIOzero module like this: import gpiozero, then motor1 = gpiozero.Motor() you need to specify the backward and forward pins. What does that mean and what if ...
4
votes
1answer
1k views

GPIOZero button not working

I've been getting into GPIO recently with the GPIOZero library but when i first tried it today it completely failed. As my first foray into GPIO i set up a circuit to light up an LED with the push of ...
2
votes
1answer
1k views

gpiozero button callback running only once

I'm getting started with a project on a Raspberry Pi (never done anything with RPi or python before, so it's all new to me, but I've done a little Arduino stuff). I'm trying to create a very simply ...
2
votes
1answer
4k views

Unable to locate package python-gpiozero

I've just run apt-get update and apt-get upgrade on Raspbian, but when I try apt-get install python3-gpiozero python-gpiozero it can't find either package. Can't find any evidence of ...