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.

119 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
477 views

Accelerated Numpy on Pi 3 B+

I'm looking to do some work with NumPy on my Pi 3 B+, and I'm not sure what the deal is with optimization, blas, etc. I installed libatlas using: sudo apt-get install libatlas-base-dev Following ...
2
votes
0answers
52 views

Hardware controlled RTS on a Pi4 not working accurately

We need to use RS485 to talk to one of our custom tools. We need to use hardware controlled rts/cts. I've read so many articles about this but nobody ever says it works for them with fast timing and ...
2
votes
0answers
41 views

Waveshare ADDA (ADS1256) full scale input issues

My question is about a problem of full scale output with the Waveshare ADDA ADS1256 card. I use the Waveshare High-Precision AD/DA Board based on ADS1256 on a Raspberry Pi 3b and the Python3 examples....
2
votes
0answers
39 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. ...
2
votes
1answer
150 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
0answers
65 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()...
2
votes
0answers
526 views

Difference between Thonny and Python 3 (running some code)

I'm just starting with the pi and to be more clear I'm spending time working with the Raspberry Pi Workshop for Beginners series on Youtube.To write an run code we use the Python 3 IDE but I don't ...
2
votes
2answers
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 ...
2
votes
0answers
711 views

Enabling I2C resulting in error Raspberry Pi

I am trying to use MPU 6050 on raspberry pi. For that I enabled i2c on raspi. But after that whenever I am trying to check the modules on my Python 3 or 2 shell for e.g. when I run help('modules'), I ...
2
votes
0answers
2k views

Segmentation fault, running out of memory? PyQt5

I am programming code to display camera feed with my raspberry pi 3 and Raspbian. Strangely, sometimes the code shows the video and sometimes i get the Segmentation fault error. I used gdb to find ...
2
votes
0answers
6k views

Want to Read COM Port Data and Write into TKinter Text Window

Using Python3, I want to read data on a serial port and display it into a tkinter GUI text window (not only the shell). Pretend I am trying to make the equivalent of a serial port character display. ...
1
vote
0answers
23 views

Raspberry camera v1.2 results in kernel panic

Update I have found the following issues that might relate to this problem: Framerates below 1 are not supported (https://github.com/raspberrypi/userland/issues/575) Frequent sequential call hang (...
1
vote
0answers
22 views

Schedule Video Recording

The code below records video for 24 hours straight which is too much. I wanna schedule the record like from 9.00am to 3.00pm only 6 hours of video. Being a novice and newbie I don't really know how to ...
1
vote
0answers
20 views

I don't know why suddenly mjpg-streamer and webcam stop working

I have made a program that uses three webcams and three ultrasonic sensors using raspberry pi 3 and python 3. When each ultrasonic sensors detect stuff in front of them, webcam take a picture of it. ...
1
vote
0answers
32 views

softly increasing and decreasing volume with mpg123

I am using Picroft on raspberry pi 3. In picroft, every mp3 files run with mpg123. I am creating my own device using this OS. when I say it to sing a song it starts singing by playing mp3 files and ...
1
vote
0answers
37 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 ...
1
vote
0answers
20 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: [...
1
vote
0answers
67 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
92 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
78 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
123 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 -...
1
vote
1answer
199 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
40 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
436 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
70 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
0answers
77 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
123 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
0answers
72 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 ...
1
vote
0answers
68 views

PiCamera python : buff/cache memory keeps increasing

I need to take a picture in each second in an infinite loop. I've wrote 2 different python scripts: one with camera.capture() and another with camera.capture_continuous() In both cases, I see the ...
1
vote
1answer
107 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 ...
1
vote
0answers
206 views

Not able to install the latest version of Scipy(1.2.0) on Raspbian

I have Scipy version 0.18.2 on my RaspberryPi 3. However, I need the find_peaks() function which is only available on higher versions. I followed this link to install scipy. But the python3 setup.py ...
1
vote
0answers
107 views

Pi-3, Model B, SenseHat - How can I restart my code while it's active.?

I am new with python and PI. I have been looking all over for information about this but with no luck. currently it works like this: I start the program, I press the button and then it starts counting ...
1
vote
0answers
258 views

Send data BMP180 between client and server trought module socket

I would like to send data of BMP180 sensor between a client and a server with two raspberry pi 3 being that the client when executing the command get the server will give the temperature value to the ...
1
vote
3answers
1k 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
192 views

Camera pretrigger capture

Hi i want to make a program that will continually record a video and on a press of a button, it will save 2 minutes before i pressed the button is it possible to do it somehow ?
1
vote
1answer
291 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
0answers
626 views

usb.core.USBError: [Errno 13] Access denied (insufficient permissions)

I am running Rasbperry pi and have the pyusb module installed. The printer is Bus 001 Device 004: ID 0fe6:811e Kontron (Industrial Computer Source / ICS Advent) Parallel Adapter, and it's idVendor and ...
1
vote
1answer
1k 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
0answers
129 views

Python 3 Debugging Symbols for Raspbian Stretch

I am trying to track down a segfault when using Pip on my Raspberry Pi Model 3B running Raspbian Stretch. I've configured the pi to do a core dump, and I've gotten gdb to load the core. The ...
1
vote
0answers
41 views

Raspbian Python Package installtion errors, Parselmouth

I am trying to install this package, praat-parselmouth, however the installation does not move forward after getting stuck at either "Running setup.py bdist_wheel for praat-parselmouth" or if ...
1
vote
0answers
589 views

How can i emulate a ps/2 keyboard with raspberry pi3

So I am working on an medical machine which runs on microcontroller(So,No OS).It gets the input from ps/2 keyboard. I would like to automate it. I would like some basic idea and some help on how to do ...
1
vote
0answers
353 views

Block Raspberry Pi from quitting fbi fullscreen (HDMI) to command line

I'm developing a parking control system in Python 3 which runs in headless mode at the Raspberry Pi startup and uses one RFID reader, one Barcode reader and many other devices but they really don't ...
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 ...
1
vote
0answers
398 views

I keep running into missing elements with GStreamer

I have tried uninstalling and reinstalling GStreamer on the Raspberry Pi 3 and I keep finding that I have missing elements. This is the Pi on Log Level 4 (GStreamer): This is my laptop, running ...
1
vote
1answer
819 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
0answers
534 views

IR Tracking Sensor (TCRT 5000 ) always gives led off as output

I am using a Raspberry PI3 Model B and TCRT 5000 sensor to monitor movement. I am using a Python script(Python3) to read the data from the sensor. Script used - #!/usr/bin/env python import RPi.GPIO ...
0
votes
0answers
8 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
16 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
2answers
9 views

Cannot connect to Xserver during CLI boot

so i want to autorun my python script after boot in a CLI boot however it seems that its giving me an error "Cannot connect to Xserver". My python script uses a camera i used crontab to autorun my ...
0
votes
1answer
20 views

Callback parameters to GPIO.add_event_detect?

I have a button object that when pressed needs to perform something, and for this I'd need to get a property of the button. I'd like it to work like: ... GPIO.add_event_detect(button, GPIO.RISING, ...