We’re rewarding the question askers & reputations are being recalculated! Read more.

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.

118 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
27 views

Raspberry Pi 0 W spontaneous event triggering for an input pin

I have two "Cylewet 25Pcs AC 1A 125V 3Pin SPDT Limit Micro Switch"-es that are normally open and connected to two of the Pi pins with internal pull up resistors. Left unattended, they call ...
0
votes
0answers
29 views

Awful Color Saturation in Datlight using pi-camera

I decided to finally post this after no avail and several videos that are unusable. I made a python script to record and convert video from a raspberry pi running in the nosecone of my rocket. However ...
0
votes
0answers
23 views

Starting python script at startup fails after some down time

EDIT: it seems that it starts randomly I have python script and I've created in lxsession/LXDE-pi/autostart file following command: sudo /usr/bin/python3.7 /home/pi/script.py If I type this command ...
0
votes
0answers
18 views

mbus to modbus protocol

Im trying to convert mbus protocol to modbus IP protocol with a raspberry. Im new on this, just doing bcs my boss asked. I´ve been searching on all google, but I found nothing. Any help would be ...
0
votes
0answers
55 views

Speed drops in for-loops python on rpi

I am working with python 3.5 on rpi 3B+ and making a led matrix project. For that I would like to know at what speed my code is running each cycle. I will take the minimum and use that as a refresh ...
0
votes
0answers
34 views

HC-SR04 Ultrasonic Rangefinder readings are off by a large margin

I'm making a robot that should avoid obstacles and im using a HC-SR04 to measure distances. My problem is that my readings are off by a large margin. when there is no obstacle in the way I get a ...
0
votes
2answers
20 views

Generating Stereo Audio in PI programmatically

I want a stereo output form the PI. The sound being played will not be a recorded sound rather it would be generated using a code (preferably python). For example, the program's input will be (x,y,z) ...
0
votes
0answers
23 views

Could I use Processing.py to display text and shapes on a Waveshare ePaper display?

I am new to Raspberry Pi and programming in general. I have very basic knowledge on Processing.py and I would like to know is it possible I could use this library to display shapes and text on a ...
0
votes
0answers
48 views

Packages are correctly installed using pip3 in my virtual environment but are not being imported, I get ModuleNotFoundError

I am using a raspberry pi 3 with raspbian buster and python 3.7.3. I can install packages fine in my virtual environment using pip3 install. This can be seen when I use the command pip list, all my ...
0
votes
0answers
8 views

Can I save and open multiple videos with OpenCV or any other module/package/method

So, I have been working on a project which requires me to open an animation/video if the user gives an input of a recognized string mentioned in my code. Basically if the word entered by the user is ...
0
votes
0answers
46 views

How to Volume control PAM8610 from RPI

Does anyone know how can I control PAM8610 module volume through code from RPI? Thanks.
0
votes
1answer
71 views

Simulating OpenCL on a Raspberry Pi using Python

Is it possible to run code on a Raspberry Pi which simulates the use of OpenCL? I am developing code on a computer which is capable of using OpenCL, and am testing this code remotely on a Raspberry ...
0
votes
0answers
692 views

ALSA Errors on Pi 3B+ using SpeechRecognition and PyAudio (Original Post missing stuff)

Using PyAudio I simply ran this piece of code: import pyaudio p = pyaudio.PyAudio() for x in range(p.get_device_count()): print(p.get_device_info_by_index(x).get('name')) Getting these Errors: ...
0
votes
0answers
32 views

Binding PiCamera stream to GstWidget

Well, today I began to program in Python and I'm doing a graphical app with PyGtk in Anjuta. My first objective is to get the stream of the PiCamera in a window. But I'm getting problems to manage the ...
0
votes
0answers
37 views

Detect fire with pi cam module

I have a python script that uses a usb cam to detect fire with opencv, it worked well until changed to the picamera and now i get this error when i run the code: File "seeFire.py", line 23, in ...
0
votes
0answers
25 views

error while opening the default python3 install in raspbian

well, i have been using python3.4.2 for sometime on my raspbian os however recently i tried to change the default to 3.7.2. unfortunately i failed to do so... i downloaded it but i couldn't make it ...
0
votes
0answers
35 views

php file not executing python script when called through browser

I have an apache2 webserver running on the pi. I have a php file that uses exec() to run a python script. Everything works well from the command line. when loaded through the browser, the exec() ...
0
votes
0answers
159 views

Simulate a mouse click in python tkinter

I have a tkinter GUI running on a Pi 3B+ with a 5" tft touch screen display. I am writing my own touch screen driver. The GUI works when I mouse click on a button that is bound to Button-1. self....
0
votes
0answers
32 views

My Relay suddenly turns on and off, and this happens in a second

Well, I had written a code for Automatic Cooling with DHT 11, but I did not get any successful result in it, I want the Relay turn on when the humidity rises up, and I did not have any errors in my ...
0
votes
0answers
31 views

Cannot turn web streaming into a function

I'm working on a project with my Raspberry Pi 0 and a camera. I'm writing my code in Python using the PiCamera module. This file handles setting up the camera and Starting Web streaming. I had no clue ...
0
votes
0answers
31 views

Start python server and Vue front end at boot

I'm trying to have my raspberry pi start a python server with connected Vue.js frontend at startup. Right now i'm using crontab with the following configuration: @reboot sh /home/pi/Desktop/server-...
0
votes
1answer
166 views

Failed to load a keras model to my raspberry pi3 b+

I am trying to load a keras model to do classification task using my raspberry. But after running this code: import keras from keras.models import load_model model = load_model("mobilenet_v2_3(...
0
votes
0answers
164 views

grab_set issue with tkinter toplevel window

I'm having an issue with the grab_set command when opening a toplevel window on my Pi. I'm using a grab_set to disable the screen below the toplevel and releasing it on close of the window. I doesn't ...
0
votes
0answers
57 views

Adafruit CircuitPython DHT22 reading exceptions

I am using the program from Adafruit's Circuit Python to read the values from DHT22/AM2302 sensor. At the start of the program, I often get the exception A full buffer was not returned. Try again. ...
0
votes
0answers
28 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
0answers
25 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 ...
0
votes
0answers
144 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 ...
0
votes
0answers
71 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 ...
0
votes
0answers
58 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
0answers
167 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
15 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
99 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
0answers
22 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
0answers
244 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
82 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 ...
0
votes
0answers
470 views

interfacing sen0189 turbidity sensor with raspberry pi 3 via mcp3008?

I am working withe the turbidity sensor SEN0189 and I am using mcp3008 A to D converter but I am not able to get the values for it, as I am not able to download the adafruit mcp3008 libraries in my ...
0
votes
0answers
42 views

Python keyboard package not responding through VNC

I have a simple python program that responds to keyboard presses using the package keyboard: import keyboard import time def catch_key( event ): print( "Key pressed:" + event.name ) def propel()...
0
votes
1answer
518 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
0answers
23 views

webserver to use if web app have both internet and non-internet dependent tasks

I was working on an application where i have two tasks and which are interdependent Fetch some data from external server. Even if the internet gets disconnected can the same webpage call my flask ...
0
votes
0answers
121 views

Raspberry Pi shows 100% CPU usage then crashes when I run a python script

Hi I've been working an opencv and python project which the raspi should detect and recognize a face and detect a motion. It works fine with my laptop but after I run it on my raspi the raspi crashes. ...
0
votes
1answer
83 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
36 views

gpiozero ImportError in virtual environment

I've been trying to use the gpiozero library lately with one of my opencv projects. Installed gpiozero using pip. Sample code works fine, no issues. The problem is, my opencv installation is in a ...
0
votes
0answers
741 views

SSLError while trying to install pip for python3.4 on Raspbian-Stretch (Armv7l)

The issue is that I have a tensorflow .whl targeted towards python3.4 but by default on raspbian-stretch python3.5 is installed so I installed python3.4 python3.4-dev using apt-get. After that i ...
0
votes
0answers
145 views

Pygame initalisation for TFT on /dev/fb1 only succeeds as root

I connected a 320x240 TFT to my Raspberry Pi A+ running Raspbian stretch via SPI and set it up as fbtft_device. It shows up in /dev/fb1 and I can write images to it via pygame. I initialize it like ...
0
votes
0answers
258 views

How can I install/use smptlib in Python 3.x with Thonny

I have got this response. I have no idea how to avoid it: Traceback (most recent call last): File "/home/pi/Franz/email3.py", line 2, in <module> import smtplib File "/usr/lib/python3/...
0
votes
0answers
218 views

MQTT connection to broker

Hello I would like to configure paho mqtt but I am having trouble to get it to work properly. I am trying to connect my raspberry to external server where broker is up and running. Port and IP are ...
0
votes
0answers
31 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
784 views

Installing gstreamer on raspian

I am trying to compile gstreamer 1.14.4 to take advantage of the webrtc module. I was able to successfully compile it using cerbero on my raspberry pi but I have an issue where when testing my webrtc ...
0
votes
0answers
100 views

problem connecting with port serial0 for serial comm

I am facing this issue that I can't solve, I've been on this like 3 days and it is really frustrating! I'm trying to test AT commands through port serial0, I've tried it in a python file and when i ...
0
votes
0answers
216 views

pigpio python serial wave output not correct

I am trying to use joan's pigpio to write a serial command on my Rpi 3 gpio 14(UART0TX).My goal is to write a command from the pi to another device. When i send the command i do not see the ...