Stack Exchange Network

Stack Exchange network consists of 175 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 [python-3]

Use this tag when referring to the Python 3 language. This can include discussions about specific features unique to the language or perhaps when referring to software that requires Python 3 in order to function. Note that general programming questions are often better suited to Stack Overflow; use this tag only where directly relevant to the Pi.

2
votes
1answer
34 views

Turn Up or Down Volume for OMXPlayer 3.5mm Audio Jack

on my raspberry pi i have a speaker wired connected via aux cable to the 3.5mm audio jack. My first question ishow can i get rid of the noise coming out of my 3.5mm audio jack when keys are pressed or ...
-1
votes
0answers
11 views

Trying to deploy my flask web app using lighttpd

I'm trying to deploy my flask web app using lighttpd. I created this hello.fcgi file #!/usr/bin/python from flup.server.fcgi import WSGIServer from hello import app if __name__ == '__main__': ...
3
votes
2answers
217 views

I want to run a Python 3 script on startup and in an endless loop on my Raspberry Pi

I have created a smart vending machine using my Raspberry Pi. For now, I open the Raspberry Pi using SSH and run the script manually for every transaction. I want to automate the process and run the ...
1
vote
1answer
39 views

Can't get HC-SC04 Sensor to work

I'm using a Pi Zero W with a soldered project board to interface two ir Sensors and trying to make an HC-SR04 sensor work. I'm using the 5v supply to power all three sensors. I've set up a Motion.py ...
1
vote
1answer
21 views

Shuffling Music with OMXplayer on Raspberry Pi

So here I have created a loop that lists off each file in a folder and plays it using this python code: global shuffleVar listOfFiles = os.listdir('/home/pi/mysounds/') ...
1
vote
1answer
60 views

Connecting several (roughly 100) Buttons to the PI (USB?)

I havent found anything, but iam sure there is already info on the topic. So even just a link would be helpful for me. I want to build a Jukebox. So pretty simple. Around 30 Buttons, if Button is ...
1
vote
1answer
1k views

GPIO event handler triggers off rising and falling edges

I'm trying to set up a tachometer. I used a comparator IC to get a real clean signal on pin 21 but I'm getting iterrupts on the rising AND falling edges. #!/usr/bin/python3 import time import ...
0
votes
0answers
16 views

Control Led brightness with google home

I'm currently working my assignment to use google home to control the Led brghtness with pwm from raspberry pi 3. i've found some good tutorial on youtube and the internet, and now the connection ...
0
votes
1answer
24 views

See what song is playing on OMXPlayer

Currently i use the following command to play an audio file os.system('omxplayer -o local --vol 600 --loop /home/pi/sound/homescreen_audio.mp3 &') This is in my python code. My question here is ...
1
vote
1answer
627 views

PWM object's ChangeDutyCycle method is not working

I have a motor class but I dont' know why this motor cannot change speed class Motor: def __init__(self, pos, line_status=0): def set_motor_gpio(_a, _b, _pwm): self._A = _a ...
1
vote
1answer
30 views

no module named 'speech_recognition'

I installed speech recognition pip install SpeechRecognition ran this import speech_recognition as sr r = sr.Recognizer() with sr.Microphone() as source: audio = r.listen(source) print(r....
-1
votes
1answer
72 views

Python 3.7 takes 3 minutes to start

On Raspbian lite Stretch with a compiled python3.7.3 a python program takes 3 minutes to start the first run. Second and subsequent runs start almost immediately. (3 minutes measured from the ...
0
votes
0answers
22 views

storing local SSIDs in an array

on my raspberry pi im wondering how i can run a command in python to list the local wifi networks i can connect to, however each SSID must be stored in an array. for example if there were three wifi ...
1
vote
1answer
36 views

Should motion detection use images or still frames?

Some Context For a project I'm working on, I'm creating a security camera that detects motion. When the camera has detected motion, it checks again to see if that motion was caused by a human. This ...
0
votes
0answers
29 views

NEO-6M GPS module

I am using NEO-6m GPS module with raspberry Pi 3B+. My GPS module is working perfectly. IT is giving me my GPGGA strings. But for now, I am using different python scripts but i am getting the error ...
1
vote
0answers
21 views

Minecraft Pi Touchscreen Mode with Python

I have Raspberry Pi 3 Model B+ with 5 inches Display with touchscreen. I am using Debian Raspberry OS. I am on the file in /home/pi/mcpi/api/python/mcpi/touchControl.py to add only up, down, left and ...
0
votes
1answer
693 views

Controlling Linear Actuator

I am hoping to control a WINDYNATION 4" Stroke Length Linear Actuator with a Raspberry Pi for a senior design group project. Ideally, the program will make the actuator fully extend, and then retract ...
1
vote
1answer
37 views

I am using a RFID reader module MFRC522 with my raspberry pi but it is not working with python 3

I am using RFID reader module (MFRC522) with my raspberry pi and when I run the script with python 2 it works fine and reads the RFID tag but when I run it with python3 I get an error - No Module ...
1
vote
2answers
588 views

Raspberry Pi won't recognize nRF24L01+

I'm a Raspberry Pi n00b and a python beginner, but I have a lot of experience with DIY electronics, arduino and c#. I've tried everything I can think of, and I just can't get the Pi to recognise the ...
1
vote
1answer
47 views

Serial comms & USB camera in parallel/threaded?

My project is currently using OpenCV to controll a pair of motors via hardware PWM (am using the pigpio library for GPIO control). The video input is from a USB webcam. I would like to add some ...
0
votes
1answer
137 views

Failed building wheel for cffi on Model 3B+

The OS running on the Pi is Raspbian 9.8, I'm trying to do the sudo pip install --pre azure So I can send images from my Pi to my blob storage on azure but when I run the above command it begins ...
0
votes
0answers
26 views

Taking and Saving images fast! with Raspberry Camera

I want to design an autonomous RC car using Raspberry Pi B+. To achieve this I have to collect training examples (images) and commands to drive the car autonomously. The problem is I send commands ...
1
vote
0answers
28 views

MPR121 capacitive touch is sensible enough?

I have a Rapsberry Pi 3 A+ with an Adafruit Capacitive Touch HAT for Raspberry Pi (MPR121) and the idea is to plug it to the wet soil of a plant and it detects when I touch the plant (or a leaf) and ...
1
vote
1answer
41 views

Retrieve data from Smart Plug via Raspberry Pi (need help with python script)

I am using a tutorial from BeardMonkey in order to retrieve and store the measured data from a smart plug (a smart plug is monitoring the power consumption of my kettle at the moment) https://www....
1
vote
2answers
76 views

Piezo Beeper sound output is too low

I need to use some kind of indicator for errors and warnings, I thought a piezo beeper would be perfect since I have one lying around, I did some research online and found out that I can connect it ...
1
vote
0answers
21 views

raspberrypi3 bluetooth socket problem

I have write program for raspberrypi3 bluetooth communication with hc05 ,but most of the time I am getting error bluetooth.btcommon.BluetoothError: (110, 'Connection timed out') how can I solve ...
0
votes
0answers
50 views

How to execute Python code in Raspberry Pi from an Android phone?

My Android phone is connected to the Raspberry Pi via Wi-Fi. Is there a way to execute a Python code (with arguments) from smartphone to Pi?
1
vote
3answers
268 views

Self-balancing robot using Raspberry 3b+

I have built a self balancing robot using raspberry pi 3b+. I am not able to reduce the response time. Hence, the robot doesn't balance properly. I am using MPU 6050, 150rpm 12V DC motor. I checked ...
-1
votes
0answers
39 views

Meaning of output from 'ps -aef | grep python3'

When I enter this command, ps -aef | grep python3 I get the following message pi 828 1 0 12:06 ? 00:00:08 /usr/bin/python3 /home/pi/hs110-data-collect.py pi 5079 863 1 ...
0
votes
1answer
126 views

Servo robot with keyboard control

I am currently creating a design project that involves controlling several servo motors for a raspberry pi 3. I want to use a keyboard to control the direction of the motors, and I am using curses to ...
0
votes
2answers
65 views

Camera with speed sensor on raspberry pi? [closed]

im useing raspberry pi 3 with ultrasonic sensor and normal usb camera . so i will connect the raspberry pi to AZURE IOT HUB so ive setted the ultrasonic sensor in a place so if any car pass that place ...
0
votes
0answers
29 views

Raspberrypi 3b+ interface with Voice recognition module V3.1

I have write program for Voice recognition Module V3.1 and Raspberrypi 3b+ , but my problem is I am not able to write any of my voice command on voice module when I speech my command its not return ...
0
votes
1answer
80 views

PyQt5 not found by Python3.7

I installed Python 3.7 on my raspberry pi with the help of Installing Python 3.7.0 on Raspbian tutorial and wanted to use it to start my script which uses PyQt5 but its throwing a ModuleNotFoundError. ...
1
vote
1answer
56 views

Accessing a Virtual Environment from IDLE3 shell?

On my pi3 I have created a virtual environment with Python3. I run my pi headless, using my Windows 10 PC. I access the pi with 3 apps: - PuTTY for terminal usage; - WinSCP for a file Explorer; and ...
0
votes
0answers
32 views

Sending Data from LoRa connected to Raspberry Pi

My objective is to connect a LoRa module with RPi and send data using it. So I made the connection:(Rpi to LoRa) 3v3 (Physical Pin 1) to Power Source (Pin 1) Tx (Physical Pin 8) to Rx (Pin 3) Rx (...
0
votes
0answers
47 views

Python Bluetooth connection automatically

Is there any way to connect Bluetooth device automatically without manually entering the passkey and automatically trusting the device?
0
votes
1answer
124 views

Multithreading Python Raspberry Pi 3 B+

My Raspberry Pi 3 b+ is reading by Modbus the values of an irradiation sensor, processing all the data, showing it in a plot and showing some warnings (if the irradiation ramp is higher than 5%). I ...
0
votes
1answer
30 views

Serial read from arduino not working properly

I am trying to read analog read from ardunio connected to my raspberry pi. Following are my raspberry pi and arduino codes. Raspbery pi: import time import serial ser = serial.Serial('/dev/ttyACM0'...
0
votes
0answers
6 views

x.overrideredirect not working on raspberry pi

On my pi, I was trying to make a simple clock in tkinter (which works.) But, I can't use overrideredirect. The whole program works fine on windows. Any help is greatly appreciated!
0
votes
0answers
63 views

Connecting a new Bluetooth device without monitor?

We are trying to connect a Bluetooth device without a passkey and trusting default yes in Python. I am running a headless Raspberry PI 3, and I want it to automatically accept pairings from any ...
0
votes
2answers
5k views

Installing Python 2.7

I am new to the Raspberry Pi, I have a project. I would like to work on Python 2 not Python 3. By default Python 3 is installed on my Pi. I want to change or remove this version and I want to ...
0
votes
1answer
57 views

Tkinterhtml fails to run on raspbian. Python 3.7

Tkinterhtml fails to run on Raspbian. Python 3.7 _tkinter.TclError: couldn't load file "/usr/local/lib/python3.7/site-packages/tkinterhtml/tkhtml/Linux/32-bit/Tkhtml/libTkhtml3.0.so": /usr/local/lib/...
2
votes
1answer
144 views

Installation of opencv-contrib-python through pip3 fails

I typed the code pi@raspberrypi:~ $ pip3 install opencv-contrib-python it responded with "Collecting opencv-contrib-python" Could not find a version that satisfies the requirement opencv-contrib-...
0
votes
0answers
15 views

Separately python audio output and osmc output

So I'm doing a project .I am using raspberry pi 3 as a media player using osmc and is connected to my projector. I have written a python file so that it uses voice recognition (pocket Sphinx) to use ...
0
votes
2answers
25 views

Program not able to open file at start up but when running from command line, runs as expected

using a library from https://github.com/BLavery/LIBtft144 this line of code doesn't seem to run when I run the program from a systemd. I also tried calling it from a crontab call of my .py program. ...
0
votes
2answers
69 views

How to add power button to RPI 3 b+?

I want to make mini computer and I want add button for on/off power button. I will change config.txt with dtoverlay=gpio-shutdown. And then add button between GND and GPIO5. There has written that it ...
0
votes
2answers
141 views

cron not executing python3

I am running Raspbian Stretch and have a python 3 script that executes correctly when I am in the relevant directory and input it in the command line as: sudo python3 Example.py The shebang #! line ...
2
votes
1answer
70 views

Use matplotlib on Raspbberrypi

Using The following Code for saving plot locally on raspberry: from numpy import genfromtxt import matplotlib.pyplot as plt import plotly.io as pio y = range(10) x = range(10) plt.title("Adc data") ...
0
votes
0answers
66 views

ADC PCF8591 reading integrated sensors values

I have this ADC board: https://www.amazon.com/ACROBOTIC-Digital-Converter-Breakout-Raspberry/dp/B06XY7572V That has integrated thermistor and photoresistor Board connected to l2c: Pi SDA -> ...
0
votes
0answers
36 views

How to manage with background scheduled tasks

I have a python program running on RP3 B+. Raspberry has a NRF24L01, TSL2561 and YF S201 water flow sensor. Program flow should be as follows: in main loop raspberry always should listen NRF channel ...