Questions tagged [python]

Python is a general-purpose, dynamically typed, object-oriented high-level programming language. Interpreters for versions 3.x and 2.x come installed on the Raspberry Pi's most popular operating system distributions.

Filter by
Sorted by
Tagged with
2
votes
1answer
259 views

Button isn't triggering in python script

Software guy here, first time doing hardware. Here is my breadboard setup (yellow is GPIO-8, green is ground): Here is my Python: import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO....
2
votes
2answers
159 views

Is there any built in LED connected with GPIO pin?

In Arduino a built in LED is attached with number 13 Digital pin. Is there any LED like Arduino in Raspberry Pi,which I can use to test my code?
1
vote
1answer
60 views

PIGPIO bit banging UART - SLR to plaintext

I've managed to read UART input by SLRO and SLR commands from pgpiod, however, SLR returns UART bit-banged data in the following format: [number of read bytes] [bytes] http://abyz.me.uk/rpi/pigpio/...
0
votes
1answer
27 views

spidev sanity check not working

ArchARM on Raspberry Pi 3, spidev installed from AUR. I'm trying to control a Waveshare device via SPI, and can't get SPI to work from Python. The most basic sanity test I can think of is failing: ...
0
votes
1answer
334 views

How to save images taken from dslr into the raspberry pi's sd card

I'm working on a project which I need to take images automatically from a DSLR camera and should save it in the raspberry pi's SD card. There was a tutorial it shows how to save the image into sd ...
2
votes
1answer
353 views

SPI only returning zeros with Raspbian (It works with IoT core)

I am using this ADC connected to the channel 0 of my Pi3 board for reading values from a sensor. In IoT core, I was using a very simple code for testing the my device, and it worked fine. The C# code ...
0
votes
2answers
75 views

Ending a camera video stream in Python / threading

I’m very new to Python and have been struggling with the code for a wildlife camera project on the Pi. I’ve managed to get the PIR sensor and automatic camera capture working, but I’d like to have a ...
0
votes
1answer
423 views

WHY my Python BLE device discover codes don't catch as many devices as Raspberry Pi OS panel does?

I developed some BLE device discovery python codes from the example given in https://github.com/pybluez/pybluez/blob/master/examples/ble/scan.py which are run on a Google AIY Raspberry pi. from ...
0
votes
1answer
339 views

Tkinter application window in front of Chromium in Kiosk mode

On my Raspberry Pi I have created a tkinter application with one button and configured Chromium to start in kiosk mode. In my python application I set the following: root.lift() root.wm_attributes("...
0
votes
1answer
54 views

measuring phase difference in 3 phase power

For my ceramics oven I had 3 phase power installed. But power consumption according to the meter is way higher than the nominal 7KW the oven consumes. A friend told me that if the phase (or sinus) is ...
1
vote
1answer
288 views

Parallax RFID Serial Not reading tags

I am a complete newbie with Raspberry Pi and any type of hardware prototyping. I have been trying to get a Parallax RFID working with my Pi 3. I currently have it wired to the GPIO using BCM and the ...
0
votes
2answers
53 views

Communicate with GPIO HIGH/LOW between 2 PIs

I have 2 raspberry PIs 1x PI3 and 1x PIZero with camera attached. I want to set up a system to have a output GPIO pin on the PI3 and a input pin on the pizero connect so that when I set the PI3 pin ...
0
votes
1answer
271 views

Pi Camera recording function needs to loop each hour

I have made good use of this forum over the past year as I have been creating a birdbox with camera for my mother. Until now I have been able to find an answer to all of my questions but this time I ...
0
votes
2answers
525 views

Cannot connect to USB GSM Modem using Python

I am having trouble connecting to a 3G usb modem using python. when I try, in python interpreter: import serial ser = serial.Serial("/dev/ttyUSB1", timeout=2) I get: Traceback (most recent call ...
0
votes
1answer
422 views

Raspberry Pi error when connecting to Firebase

When I tried from firebase import firebase running in the Python 3 (IDLE) and Thonny Python IDE, it gives an error likes this at the first line: Traceback (most recent call last): File "/home/pi/...
1
vote
1answer
252 views

Asterisk and Python communicate in Raspberry Pi?

I'm currently working on a project which is based on RPi and Asterisk. What I Want In my project, I need to get incoming call details like caller ID into python and perform some functions connected ...
0
votes
1answer
352 views

/dev/ttyusb0 cannot be find while starting script on boot for raspberrry pi

(Currently using Raspbian Jessie latest) So currently I am trying to start a script that reads from the rf receiver and gathers the data and sends it over to the cloud... I am trying to start this ...
1
vote
1answer
5k views

Selenium - Firefox - OSError: [Errno 8] Exec format error

I'm trying to run selenium on a Raspberry Pi 3. I've installed geckodriver and added it to my path. $: which geckodriver /bin/geckodriver echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/...
0
votes
1answer
699 views

Minimize active window

Is it possible in python to minimize an active window by name or by focus state and, if so, how? For example: I have an open Chromium browser and run a script in python and for five seconds my ...
0
votes
1answer
386 views

Lighttpd running FastCGI script hangs and give 500 internal error

I'm attempting to use lighttpd and fastcgi to run a small flask application. When I try to start lighttpd, it starts the server just fine, but when I try to connect in the browser, it hangs without ...
2
votes
1answer
69 views

Moving from Raspberry Pi to another platform?

Lets say that I develop my highly complicated LED diode project on Raspberry Pi 3 B+ in Python. Now I don't want to use my RPi for this project becouse it is expensive and I want to move with next one,...
4
votes
3answers
11k views

I can't download PyCharm for Raspberry Pi 3

I have had my raspberry Pi 3b for a few months so I'm just getting used to it. I would however want to install PyCharm because I want to use my Pi to program on rather than my PC. Any ideas would be ...
0
votes
1answer
298 views

webiopi write to log when button is pushed

Trying to learn the webiopi and python. I have a simple button to turn off and on a relay. Here is the HTML <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/...
4
votes
3answers
6k views

No module named 'ImageTk'

I am learning tkinter and trying to place an image on a Button, but I cannot get past the import. My code: from tkinter import * from PIL import Image, ImageTk The error: No module named 'ImageTk' ...
0
votes
4answers
1k views

boot up rasbian into gui program, no interaction

I have a project I want to do, and I got an SPI touch screen (tontec 3.5") for it. I want to start up into some sort of GUI application. I only have roughly 950mb left on my micro SD (8gb, install ...
0
votes
1answer
263 views

gamepad/joystick-> raspberryPi->nrf24l01->arduino; variable confusion between cpp and python

I'm trying to operate an r/c robot with joystick and a raspberry pi running Debian and an nrf24l01 to communicate the joystick commands to the arduino on the robot. I only really need forward/back ...
0
votes
0answers
67 views

Random crash after several hours

sorry for the next error) I'm working on a project with my rpi, which just test on a student website if a teacher is absent, or if a lesson is moved. Actually, the rpi crash totally randomly : after 7-...
1
vote
1answer
121 views

Two stepper motors with python

I want to make a motorized rc paddle boat type machine for fun. I plan to use two stepper motors to spin two wheels on either side of the boat. I am controlling it with python. I have a master script ...
0
votes
1answer
495 views

Controlling High voltage devices with Raspberry Pi

Can I control high voltage (here 5V) to power a led lamp and a fan(both operating at 5v) from Raspberry Pi GPIO only using a transistor . Or should I isolate both the circuits using a relay or octo-...
0
votes
1answer
413 views

Properly installed Kivy on Pi3B won't exit or show mouse/cursor moves

I have set up kivy to where I can successfully launch the demos and even my own hello-world apps on a Raspberry Pi 3B. I have two problems that do not seem to have any good answers on the web at this ...
0
votes
2answers
268 views

Pigpio belt speed encoder

I'm trying to read pulses from an encoder to measure belt speed. My encoder is 500 ppr. I have approx 2400 pulses per meter and I need to measure speeds upto 450 meters per minute. Can anyone help ...
1
vote
1answer
51 views

Play a defined set of MP3's on defined days

am new to Python and have been struggling to create a workable script for a friends project - am hoping someone can point me in the right direction! The script is to control playback of mp3 files ...
4
votes
3answers
22k views

How do I remove 'Python Games' from Raspbian?

When you download Raspbian, there are 'Python Games' installed. Is there an easy/clean way of removing this from the system including the Menu? I preferably want to get rid of whatever 'Minecraft Pi' ...
0
votes
1answer
318 views

Keypad matrix 4x4 Python code error

Below is my code The code doesn't work because have this error: :NameError: name 'processKey' is not defined How do I fix this?
0
votes
1answer
474 views

How to keep script running even after session timeout

I have a python script I want to keep running for most of a day. I have tried the following; -- Screen. I SSH to the Raspberry Pi,and they type "screen bash", I then start my script and then "control-...
0
votes
2answers
364 views

Control Raspberry Pi to control an Arduino over Apache

I want to control a Raspberry pi to control an arduino which is controlled by a webpage hosted by apache. I do not know how I would attempt this and if it is even possible. Can anyone please guide me ...
0
votes
1answer
1k views

serial errno 25 inappropriate ioctl for device

I have raspberry pi 3 B+ running latest raspbian-strech lite. i have a max485 ic connected to uart on the gpio. import serial,fcntl, struct ser = serial.Serial( port='/dev/serial0', ...
2
votes
1answer
431 views

prevent GUI notification for Bluetooth Pairing

Currently, I am trying to control Bluetooth (pairing - connecting - removing ...) with my python code (by accessing to bluetoothctl through pexpect). It actually works fine but I have a problem with ...
0
votes
2answers
61 views

Configure Raspberry pi to run my application before GUI Desktop

I have created an application through Python that has library dependencies on Qt4, pyqt4, pyqtgraph etc. This application is based on Raspberry Pi, I have developed and finished it on the platform. I ...
1
vote
3answers
303 views

How to display gpsd.utc using paint or similar method

I am receiving reliable gps data from my Adafruit gps sensor. I would like to to show the gpsd.utc data across the screen so that it appears like a regular clock. I have the following code which shows ...
0
votes
0answers
37 views

How can I release all camera instances of a RPi in Python?

I'm trying to make a camera application with my Raspberry Pi that should launch on RPi startup. The program itself works fine. My problem is I'm getting the error picamera.exc.PiCameraMMALError: ...
1
vote
1answer
99 views

Cannot install pandas on Raspberry Pi

I have been trying to install pandas for a week now. Read pretty much every thread I could find but nothing seems to work. I keep getting a ton of import and dpkg errors every time. Everything is up ...
1
vote
1answer
402 views

Python's raw_input() function causes problems in systemctl service

I am attempting to create a safe reset switch according to these instructions. I have implemented the interrupt-based solution (listing 1) which runs fine if I start the script from the command line, ...
0
votes
2answers
40 views

Ultrasonic Sensor + omxplayer block CPU

Thanks to the community i create a scrip that check status of 3 ultrasonic sensors and depending on the status omxplayer will play a movie or other. Problem is that after few while and video loops CPU ...
0
votes
2answers
757 views

How to measure the frequency of the audio output

I was wondering how I can measure the frequency of the audio output of my raspberry pi. Currently I am trying to create a script to control an RGB led to the music that is being played through the ...
2
votes
1answer
364 views

Raspberry pi freezes after 20 minutes of use

using tkinter i have made a GUI in which a video plays continuously in a loop until the ultrasonic sensor detects a person in front of it. when a person is detected it displays a messages"hi..welcome"....
0
votes
1answer
360 views

Running openCV C++ file from python in Raspberrypi

I'm creating a object and color detection robot. Here in this case, I'm using C++ to run the camera and process the image with openCV in C++, but before I run the Camera, I want the robot to move and ...
0
votes
1answer
40 views

Running script after reboot does not work

I have a simple script will runs a loop that reads off temp data in the console from a sensor and then writes it to a file. I would like to make sure that this script starts running right after my pi ...
0
votes
3answers
2k views

OpenCV 4 error?

When I run the command python faceDetection.py I get the error- VIDEOIO ERROR: V4L: can't open camera by index 0 Traceback (most recent call last): File "faceDetection.py", line 21, in <module&...
0
votes
0answers
28 views

Combining potentiometers to register as buttons

Does anyone know how I could use 2 potentiometers (1 for vertical axis, other for horizontal) and combine them to register as buttons? I want to make a shifter for sim racing and I want to combine 2 ...