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.

Filter by
Sorted by
Tagged with
0
votes
1answer
30 views

MGR996R rotation angle

Basically I want to control the angle of the rotation of the servo motor but I don't seem to know how... From the tech sheet I know this motor shouldn't be a continuous one, any hint would be ...
0
votes
0answers
7 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
17 views

How to Volume control PAM8610 from RPI

Does anyone know how can I control PAM8610 module volume through code from RPI? Thanks.
1
vote
0answers
28 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 ...
0
votes
1answer
25 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
34 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: ...
2
votes
1answer
28 views

Reading more than 8 bits from an SI7021 sensor

I am using the Si7021-A20 sensor on a Raspberry Pi Zero WH (headless, controlled via ssh and VNC). I want to get readings using Python (version 3). However, I have a very hard time to actually get ...
0
votes
0answers
10 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 ...
1
vote
2answers
50 views

Raspberry Pi “Temporary failure in name resolution”

After many hours of googling and testing for a solution, I am stuck. I would really appreciate some advice. Situation - I have (5) Raspberry Pis 3B+ (RP) at various customer locations and I want to ...
0
votes
0answers
20 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 ...
2
votes
0answers
26 views

Pin Crosstalk Issue

I'm working on a quick project with my dad for his condo. He wanted to setup a bunch of moisture sensors around the condo near sources of water (sinks, bathtubs, toilets, etc), which, if triggered, ...
1
vote
1answer
27 views

How do I reinstall Python 3?

I cannot get pip to work and I think that reinstalling python 3.7 might help. When I try 'sudo apt install --reinstall python3' I get an error saying there are unmet dependencies. If I specify it to ...
0
votes
0answers
18 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
22 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
19 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....
2
votes
1answer
18 views

CE1 not going low for pigpio.spi_open() with flags

I'm attempting to modify joan's test script (https://raspberrypi.stackexchange.com/a/44320/42126) for an RPi SPI master to communicate with an Atmega328P slave. I cannot change which GPIO pins I have ...
0
votes
0answers
29 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 ...
1
vote
1answer
30 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
27 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
votes
0answers
22 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.
0
votes
0answers
19 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
22 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
29 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
19 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
130 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
59 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
36 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
52 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
13 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
49 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
173 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
34 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
60 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
71 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
44 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
94 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
34 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
34 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
50 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
65 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
127 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
53 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
100 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
70 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
237 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
79 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
34 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 ...