The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
67 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
10k 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
292 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
258 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
63 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
98 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
476 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
407 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
21k 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
311 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
448 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
359 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
420 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
54 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
299 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
26 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
53 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
396 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
32 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
747 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
356 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
358 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
33 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
27 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 ...
0
votes
1answer
441 views

NameError:Function not defined

I have a class RelayChannel and I want to call the function RelayChannelOn() to this code but I get error : NameError: name 'RelayChannelOn' is not defined. Here is the code where am calling the ...
0
votes
1answer
49 views

RPi.GPIO “flush” interrupts

Intro It seems to me that when one adds and event detection, then removes it and the adds it again, something strange happen: 1) an event is removed to the "detection list"; 2) the event happens; 3) ...
0
votes
2answers
349 views

PIR Module False Positivesq

All I am working with a PIR Module and a camera for a project to provide text messaging when motion is detected as well as taking a picture. I am seeing a large number of false positives from the PIR. ...
1
vote
1answer
2k views

Issues with Kivy on Raspberry Pi 3 with 3.5 in Touchscreen

I followed every guide I could find on installing Kivy to Raspberry Pi. My touchscreen works totally fine. Trying to launch various Kivy demos will result in what seems to be a partial launch, but ...
0
votes
1answer
374 views

Connecting 4 HX711 to one Raspberry Pi

I have four individual scales that are each connected to a HX711, those HX711s are each connected to the Raspberry Pi. I'm a beginner in python as well as this Rasberry Pi. how do i properly code this ...
1
vote
1answer
88 views

GPIO pin (BCM 12) acts differently on PI3 and PI4

The following code is running on PI3 and is working perfectly fine. I try to provide a short description of what the code does. In this code I first set the BCM 12 as the pin of interest for my sensor ...
0
votes
1answer
311 views

Setting up the Raspberry Pi as a client on a sever

I'm attempting to give my Raspberry Pi a static IP address on an ethernet network that I am controlling from a Windows machine. I want to be able to send my PI UDP packets directly from my server via ...
0
votes
1answer
167 views

Python code to use Adafruit motor shield v1 with Pi 3

It is dangerous to run motors directly from the Pi, hence we need a motor shield. I own an Adafruit arduino motor shield clone: https://learn.adafruit.com/adafruit-motor-shield Note: I'm aware about ...
0
votes
2answers
673 views

Python MCP23017 16 ch. I2C input loosing a bit

I bought a MCP23017 and doing some small test with it. I've made a simple Python script to make read_out of pin state. Can anyove explain to me, why i'm loosing a bit when GPIO_A7 is triggered? I've ...
1
vote
2answers
75 views

Is there a way to see if bluetooth scanning/advertising are running?

I have made a python script based on this github in order to use ble scanning/advertising. This script will run a long time and the Bluetooth thread might have a problem which caused them to stop. I ...
0
votes
1answer
944 views

Wiegand GPIO read not working all the time. Works most times but hangs on some reads

I'm extremely new to Python, I've been learning a bit over the last couple weeks. This is what I've managed to come up with. I'm pretty over the moon the code works most of the time but it doesnt work ...
3
votes
1answer
352 views

Is it possible to connect a Minecraft Pi Edition Python script to a specific active game window?

Is it possible to connect a Minecraft Python script to a specific active game window when multiple game windows are currently open? For example, I have three different open games on one Raspberry Pi ...
2
votes
1answer
490 views

USB audio from Pygame

I am running Raspbian Stretch. I've connected a USB sound device and selected it through the graphic interface. This sends the sound out fine from youtube in Chrome but is silent with a Python ...
1
vote
1answer
59 views

Nested Else issue. Very Basic

This is the code I am using to operate a relay to open my garage and the garage status is checked by a magnetic switch. However there is an issue with the logic can someone help me please as I am ...
1
vote
1answer
505 views

Bluetoothctl connect TIMEOUT exception

This is the error I am getting when I connect to my mobile phone using the connect method in this documentation: https://gist.github.com/egorf/66d88056a9d703928f93, raise TIMEOUT(msg) pexpect....
-1
votes
1answer
72 views

Response to a incoming call using python script

I am trying to implement a system using Raspberry-pi and SIM-800 modules. Now I can see incoming calls from my python script, but it can not parse data. import serial serialport = serial.Serial("/...
0
votes
1answer
626 views

Sense Hat RGB Code

I am a new programmer, trying to learn python. I am using the sense hat to mess around with, I want to make it like rotate RGB colors. I am using the sense.set_pixel and passing in the x,y and r,g,b ...
0
votes
1answer
4k views

Reading registers through pymodbus

I have been trying to use pymodbus to read registers from a power meter and searching around here I found a useful code from the question I attach in the end of this post. So I wrote/copied the next ...
0
votes
2answers
362 views

Trying to interface with the serial port with a simple program

Hey I am trying to work with the serial port of my raspberry pi model 2B with a raspbian jesse OS. I have disabled the serial login shell over serial in the advanced options. I have enabled uart in ...
1
vote
1answer
419 views

Error when installing Flexget

Having some problems trying to install flexget. I get the following error when I run the command: pi@rpi:~$ sudo pip install flexget Requirement already satisfied (use --upgrade to upgrade): ...