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.

1
vote
1answer
18 views

Timeout function for user input on 4x4 membrane keypad with pad4pi

I'm making a python script for a 4x4 keypad that's connected to a raspberry pi where the user enters a 4 pin code and the program tells the user whether or not it's correct. In order to take in the ...
1
vote
0answers
25 views

Making Python3 default on command line

I have been trying to run the Jupyter notebook on my Pi but the Kernels will not install into Jupiter even though I downloaded them through the Pi's Software download window. A little bit stumped and ...
0
votes
0answers
32 views

Python nested if statements [on hold]

I'm currently learning Python and playing around with some projects on a couple of Pi's I bought. I wrote a nested IF statement script that activated LEDs if switches were open or closed. For example ...
-1
votes
0answers
18 views

About Pi Camera show in Canvas at GUI Python (Thonny Python)

I'm a newbie with raspi. Can someone help me with pi camera? My goal is that the pi camera image is shown in the Canvas of GUI (Tkinter) from Python (thonny python). I'm very confused here.
-3
votes
1answer
43 views

SenseHat python roll [closed]

I´m thinking about getting an Sensehat and im praticing but had an like issue, I use the emulator and print the roll into the console when I turn the rollof the raspi to say 60° everythink is fine but ...
-1
votes
0answers
15 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
20 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
0answers
12 views

Caputing data from BluetoothLE sensors

I have been trying to grab data from BLE sensors using python. While the commandline tools worked flawlessly I couldn't get it to work with any other python framwork available for BLE. A collegue ...
2
votes
1answer
28 views

Why no result from os.popen() when script is run from crontab?

When I run this Python3 script from the command line or from Thonny I get correct results. When I run it through crontab the variables ipaddress an ssid stay empty. Can anyone tell me why? Any ...
1
vote
1answer
14 views

RC522 modules stop working when more than 2 are connected

So, here's a synopsis of what I am trying to do. I want to put 3 RC522 readers side by side inside of a book, facing the cover, that will be constantly on, using a Rpi zero W. When an RFID chip gets ...
2
votes
2answers
68 views

Python3.7 with Numpy on Raspbian

Goal: Install Python3.7 on the Raspberry Pi. Then install Numpy for Python3.7 Found this very useful Github Gist: https://gist.github.com/SeppPenner/6a5a30ebc8f79936fa136c524417761d Ran the ...
2
votes
1answer
38 views

Raspberry pi 3 RFID RC522 Card UID is not same with USB RFID Reader

I'm working with RFID RC522 using Raspberrypi 3B+. I'm following https://github.com/mxgxw/MFRC522-python this package and works like a charm. I can able to read the data from the card, able to write ...
1
vote
2answers
30 views

Can't exit my apllication in a clean way

Not sure if my problem is related to RaspberryPi, GPIO or just my understanding of Python but since I'm detecting my problem while playing with a button attached to my PI I ask it here. I have a ...
-1
votes
1answer
49 views

Segmentation fault error. Trying to loop a python program [closed]

I'm using AT commands to send data over http, but the problem is that sometimes the program has an error and wont run again until I reboot and the GSM. Im using a crontab and also running the file as ...
1
vote
0answers
11 views

Launch a python script in a lxterminal window using supervisord

I'm trying to launch a python script in a lxterminal window using supervisord. I'm stuck on using supervisord than a .desktop file. I'd like to keep the process running on loop Below is my config: [...
0
votes
1answer
37 views

hc-sr04 stops on python after a very short while. F5 (run) and it works again, but only for a very short time again

Here's the code, it communicates with Sonic Pi, don't know if that matters: import RPi.GPIO as GPIO import time import signal import sys from pythonosc import udp_client from pythonosc import ...
1
vote
2answers
44 views

Detecting device path for USB scanner

I'm currently exploring ways to detect the correct device path (for ex: /dev/input/event0) for an USB scanner. With the following code in Python using the evdev package, I am able to filter down to a ...
4
votes
3answers
116 views

Launch a GUI Tkinter program on boot

I am trying to auto launch a Tkinter/Python program when the Raspberry Pi boots up. Ideally I would like to boot the Pi into the console and then launch a GUI Tkinter Python program. In testing – not ...
1
vote
0answers
26 views

How do I access pixel values from a raspberry pi camera?

I am writing an AI program in Python on a raspberry pi, where I need to access raw individual pixel values from a raspberry pi camera. I really don't want to save the picture, I want to process the ...
1
vote
0answers
49 views

A PWM object already exists for this GPIO channel

I have a bit of a dilemma. I am currently using BCM GPIO 14, 15 and 18 to control an RGB status LED using PWM. I have configured my raspberry pi 3 to pull down pin 14 (red) on boot, to indicate the ...
0
votes
1answer
46 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
1answer
42 views

Run many scripts with different commands from bluetooth [closed]

I have 3 scripts and I want them to be listening to a bluetooth command. When the Raspberry receive a command from the bluetooth, one of the three scripts must run. For example if the Raspb recieve ...
1
vote
1answer
64 views

Seeed ADC (ADS1115) with Raspberry Pi 3 B+to read voltage values using python3

I'm using a Seeed 4-Channel 16-Bit ADC (ADS1115) for Raspberry Pi with a Stretch installed Raspberry Pi 3 B+ and successfully configured following below guidelines & GitHub. http://wiki....
2
votes
0answers
30 views

How to run 3 Input scripts from 1 script

I've got an alarm system with 3 inputs and 3 outputs. But so far each input is controlling the outputs from it's own script. I did this because I wanted to get one thing at a time working on its own. ...
1
vote
1answer
32 views

RPI project Minecraft Server

me and a project partner are running a Minecraft server off of a RPI and connecting via its wireless feature. we wanted to create a python script which would control an LED and toggle it on/off based ...
1
vote
1answer
46 views

Allowing a venv instance of Python access to I2C

I'm trying to run a python script using the adafruit_bme280 library to read a couple of sensors and display the data on a flask-generated page. I've gotten it to work outside of a venv virtual ...
1
vote
0answers
50 views

Raspberry Pi Touchscreen Screen Control (Python)

I want to create a script that will turn off my Raspberry Pi Touchscreen if nobody touched the screen in 30 seconds. (In the future I want the option to reset this 30 second timer with other programs -...
0
votes
2answers
73 views

Select default Python as 3.7.2

I had installed Python 3.7 which according to tutorial in this blog(i change the Python version to 3.7.2): https://bohdan-danishevsky.blogspot.com/2017/01/building-python-360-on-raspberry-pi-3.html ...
0
votes
0answers
37 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
2answers
30 views

Communicate with computers on external networks

I'm trying to build an application with my RPi 3B that get some data from connected sensors. Once I got the data, I'd like to send them to a computer that is on an external network via a script in ...
1
vote
3answers
89 views

How to stop LEDs blinking when button is pressed

I've got 4 LEDs, a buzzer and a button. There's an add_event_detect to switch the LEDs and buzzer on and off. The callback methods works find when the outputs are just on continuously until another ...
2
votes
1answer
63 views

GY-291 / ADXL345 weird sensor reading for x, y, z

I've two identical GY-291 / ADXL345 sensors. To read the data I use the python-module (https://pypi.org/project/adxl345/). i2cdetect detects the sensors at address x53 correctly. Unfortunately, data ...
1
vote
1answer
91 views

how to install protobuf in raspberrypi3 b+ stretch?

Anyone can suggest me how to install protobuf in raspberrypi 3 b+. if I directly install using the command pip install protobuf it is install but I am not able to import ?
1
vote
1answer
59 views

Pigpio not calling Callback for first rising or falling edge

I have some sample code (taken out of my larger program) that regularly (but not always) missing the first rising edge: #!/usr/bin/python import pigpio, time def callback(g, l, t): print("Callback ...
2
votes
1answer
29 views

While reading RC522 RFID reader keypad won't work

I am using pimylifeup library to read RFId card. But after id, text = reader.read(), I don't get reading from 4×4 keypad. I tried with both BOARD and BCM numbering to read keypad. I have to exit the ...
2
votes
0answers
41 views

Detecting “No Mouse Movement” in python on Raspberry Pi

So this is going to be a bit confusing but using a basic loop i can detect keyboard and mouse inputs using the following: globals()['keyboardEvent'] = evdev.InputDevice('/dev/input/event0') globals()...
0
votes
0answers
24 views

Add Touch Mode feature to Minecraft Pi

I have Raspberry Pi 3 Model B+ with 5 inches Display with touchscreen for my challenge [Display works successful!]. I am using Debian Raspberry OS. I am on the file in /home/pi/mcpi/api/python/mcpi/...
1
vote
0answers
31 views

Cant read both SPI Buses of Raspberry Pi 3B+

I want to read 3 analogue sensors simultaneously. I have successfully connected 2 sensors using a MCP 3002 A/D converter which is connected to CS0 of SPI 0 of raspberry pi and I have activated 3 more ...
1
vote
0answers
200 views

Installing scipy on python 3.7 with raspbian

I followed the guides for installing python 3.7 and the installation went without issue, and code I write can run just fine. Installing other modules like numpy and matplotlib doesn't result in any ...
0
votes
0answers
20 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. ...
1
vote
1answer
39 views

Python button double press

I'm about to start building a wireless custom doorbell system using pigpio. It is a three piece system that I will be making. The front doorbell which will communicate via two scripts to two different ...
3
votes
2answers
401 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
47 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 ...
2
votes
1answer
97 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
vote
1answer
70 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
37 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/') ...
0
votes
0answers
21 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 ...
2
votes
2answers
276 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....
0
votes
1answer
47 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 ...
0
votes
0answers
24 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 ...