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.

-1
votes
1answer
49 views

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

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
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
25 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 ...
1
vote
3answers
789 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
votes
2answers
182 views

Reverse DNS on internal LAN

Writing a Python program for my PiZeroW to scan and inventory my home local, internal network. I can easily iterate though the 256 internal DHCP available IP addresses (some assigned, some not), but ...
2
votes
1answer
33 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 ...
0
votes
2answers
321 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
2answers
29 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
vote
3answers
87 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 ...
1
vote
2answers
255 views

Why does my raspberry pi zero w crashes when controlling a DC motor with an L9232D and a 9g Servo motor?

I use this simple circuit to control a DC motor with an L293D, and a 9g servo motor with a Raspberry PI Zero W: I use the simple following code to test the circuit: from time import sleep import RPi....
-1
votes
1answer
168 views

IR sensor program will not run

When I run it nothing happens either in command prompt or the shell. I think I am missing some code line but I got it from a online project and cant ferret out the problem This code is supposed to ...
1
vote
2answers
36 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 ...
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
162 views

Need assistance hooking up Sharp GP2Y0A41SK0F IR sensor

So I have this... Infrared Proximity Sensor Short Range - Sharp GP2Y0A41SK0F & 1 MCP3002. I have been scouring the web for hours, trying all code examples and I still get 0 as a reading no matter ...
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
1answer
240 views

How to programmatically check bluetooth speaker is connected to rpi3?

I am trying to detect if my bluetooth speaker is connected to my rpi3 with my python code, executing this command status = subprocess.call('ls /dev/input/event0 2>/dev/null', shell=True) if the ...
1
vote
1answer
48 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 ...
4
votes
3answers
92 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 ...
0
votes
1answer
196 views

I'm wanting to get user input from a screen, but I can't have any buttons

I'm developing an python3 application that only uses a handheld scanner for input. I need to prompt the user for input and want to use a nice window to do it. When I look at tkinter, it appears that ...
0
votes
1answer
774 views

Stream Deck Using PI 2

I have a RPi2 1gb. I've recently got a touch screen for it and have decided that I actually should use it for what it was intended for. Programming! So my adventure starts here. I want to make a ...
0
votes
1answer
40 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
572 views

Help with choosing a GUI library for RPI developpement

I am currently coding an app for Raspberry Pi, the app is very GUI dependent. During my research i saw online that tktinker is good for small/simple apps. I got really excited for PyQt but found out ...
1
vote
0answers
25 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 ...
0
votes
1answer
325 views

Why does a communication over SPI returns garbage?

I am trying to read from a gps module NEO-6M using Raspbery Pi 3 B over SPI. It nicely works with Arduino but it doesn't want to work with Raspberry. I have used different libraries in Pyhon, even ...
1
vote
0answers
46 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 ...
1
vote
1answer
49 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....
0
votes
1answer
41 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 ...
0
votes
2answers
664 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 ...
1
vote
1answer
28 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 ...
2
votes
0answers
28 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
46 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
41 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 ...
0
votes
1answer
274 views

Segmentation fault error while installing opencv on raspberry pi 3. Any reason for that?

Hi everyone I hope someone could help solve this issue,I'm trying to install openCV 3.3.0 with python 3.5 on the raspberry pi 3 for the second time ( first time I got no module named cv2 ) but this ...
1
vote
0answers
38 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
53 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 ...
2
votes
2answers
230 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
308 views

Dependencies fail to install, cannot install picamera on pi3

When I run apt-get install python3-picamera it fails with different dependency issues like: files list file for package 'libparams-util-perl' is missing final newline or files list file for package '...
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 ...
0
votes
0answers
32 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
1answer
1k views

No module named PiCamera

Trying to run a python program in a vm (virtual environment) with the picamera module, i'm running it in the vm because i have other modules there like OpenCV. When running the program i get the error:...
2
votes
1answer
58 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
64 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 ?
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 ...
1
vote
1answer
1k views

After installing python 3.6 most modules don't work

I'm new with RPi and also Linux, so my question might be stupid but I tried to get Python 3.6 running with different ways (compiling, pyenv, berryconda). In general I think python is running on all ...
2
votes
0answers
38 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()...
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 ...
0
votes
0answers
22 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
177 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 ...
1
vote
1answer
56 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....
0
votes
0answers
18 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. ...