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]

Python is a general-purpose, dynamically typed, object-oriented high-level programming language. Interpreters for versions 3.x and 2.x come installed on the Raspberry Pi's most popular operating system distributions.

0
votes
1answer
51 views

Running a Python script as a service file on boot [on hold]

I have a Python script (that works) set up and I want to run it automatically every time the Raspberry Pi is on. I have read that I need to create a unit file and I have done so, but whenever I try ...
0
votes
0answers
19 views

Play a sound with python

I am trying to play a sound at a certain altitude with my raspberry pi. I would use import winsound but I have no idea what I would use if it was on the pi. Would it remain the same?
0
votes
2answers
45 views

Camera with speed sensor on raspberry pi?

im useing raspberry pi 3 with ultrasonic sensor and normal usb camera . so i will connect the raspberry pi to AZURE IOT HUB so ive setted the ultrasonic sensor in a place so if any car pass that place ...
2
votes
1answer
269 views

Raspberry Pi 3 & Arduino: [bluetooth.btcommon.BluetoothError: (112, 'Host is down')]

I am trying to send informations from Raspberry Pi 3 to Arduino Uno with bluetooth. I managed to connect the Arduino's bluetooth module with the Raspberry Pi. But I have this error when I execute my ...
1
vote
2answers
154 views

Reliable way to play sound (ogg, mp3) in Python, on Pi Zero W

I have been trying to find a reliable method to play sound on my Pi Zero W, in Python. By default, Zero does not have audio output, but I have set up an I2S amp and speaker, following this guide: http:...
0
votes
0answers
14 views

2 way Socket communication over bluetooth using python

Is there any way to make communication with 2 RBI over bluetooth using python Socket? Do you have some tips how can i do it? Should i use multithreading? Right now i'm using this lib -> https://...
0
votes
1answer
27 views

Use Python flask or NodeJS for controlling stepper motors via Web?

Im planing a project where I need to controll some stepper motors with my RaspberryPI. I'd like to controll those motors interactively via a web GUI. This server should run on my Py. Now I found a ...
0
votes
1answer
29 views

How to copy file to USB Mounted on Pi from SSH Server

I am writing a python script that checks the files in a folder on my Android, and will copy .jpg files to a USB I have mounted on my RPi. (My Android is running as an SSH server). I am able to ...
0
votes
0answers
12 views

RPi camera OCR,and save output in variable (pyhton with tesseract)

I want to make a python code for the raspberry pi, with the tesseract OCR engine, that it keeps reading text from the camera in realtime, saves in a variable, and sends output to Arduino. Is there a ...
-3
votes
0answers
16 views

phython program to display the data received over raspberry pi over monitor [on hold]

I'm working on project, I want to display the input data which is image, text msg, video. Input data is send using an Android app over IP address of raspberry pi3. I want a program for data receiving ...
-1
votes
0answers
22 views

Python Error code (TypeError: __init__() got an unexpected keyword argument 'vf')

Here is the full code can you please fix the error for me # USAGE # python detect_faces_video.py --prototxt deploy.prototxt.txt --model res10_300x300_ssd_iter_140000.caffemodel # import the ...
0
votes
1answer
27 views

problem when running the python application in /etc/rc.local in console mode

I'm coding an application to run when starting raspberry, however when trying to run this error is returned: QXcbConnection: Could not connect to display My application is done in python with qt ...
0
votes
0answers
8 views

specifying baud rate when using PyBluez Bluetooth library

I'm trying to establish Bluetooth connection for a hc-05 Bluetooth module. When using the "serial library" to setup the connections, you can specify the baud rate using "serial.Serial("*******", baud ...
-4
votes
2answers
3k views

How to develop a Plugin to read the status of the Power-LED of the Raspberry Pi 3 B by PHP [closed]

I need to develop a plugin that reads the status of the Power-LED of the Raspberry Pi 3 B and print the status of the LED on the Web-page. Please Help !!!
0
votes
0answers
6 views

python - add overload __add__ to imported DotNet function

Let's say e.g. I have a dotnet module MyDotNet, containing a class 'Numbers'. The class Numbers has a function NumbersAdd to add two numbers. I use the dotnet module by use clr, with AddReference. ...
0
votes
0answers
20 views

How to access Tx Rx of UART to TTL converter on RPi 3B?

I accessed the hardware by connecting it to GPIO pins (TX-RX) and wrote a code that that could send instructions to that hardware and receive outputs from it successfully. The first few lines of code ...
0
votes
1answer
24 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
1answer
54 views

Ultrasonic sensor stops working a few minutes later

I want to get distance continuously using while loop but a few minutes later my code suddenly stops working and doesn't get distance (there is None value in distance variable) I have changed first ...
0
votes
0answers
12 views

How to code using python, displaying the total number of page of a document [closed]

How to code using python to display the total number of page in a docx and display it in a text box?
0
votes
0answers
12 views

Installing Qiskit on Raspberry Pi 3 B+

I’m trying to install qiskit on my raspberry pi 3+ and I’m getting the following error: “Could not find a version that satisfies the requirement qiskit (from versions: ) No matching distribution ...
0
votes
2answers
82 views

What is the fastest way to send commands to Raspberry Pi over ethernet?

I'm working on a IoT project. The idea is basically: I have a notebook running a Python program that get frames from an IP camera, process it, and based on the result change a Raspberry Pi GPIO pin ...
0
votes
3answers
2k views

Problem on installing Pyaudio on Raspberry Pi

I was trying to install pyaudio following the steps: 1) sudo apt-get install python-dev 2) sudo apt-get install portaudio19-dev 3) sudo pip install pyaudio Couldn't get through step 2. Error ...
5
votes
2answers
24k views

ImportError: No module named RPi

I am trying to run a package on my Raspberry Pi: At the terminal, I typed in “sudo apt-get install picap” followed by enter. I get it installed but cannot execute "picap-setup" – instead an error ...
0
votes
1answer
28 views

How to display a tkinter window while using a push hardware button to capture images?

I have a project in which involves capturing of images. I have to display a UI while capturing an image if a button is pressed. This is the code. def create_window(self): t = tk.Toplevel(self) ...
3
votes
1answer
45 views

Alternatives to Matlab - Running Matlab code in Raspberry Pi [duplicate]

I have to run some Matlab scripts on Raspberry Pi. As per my understanding, Matlab is quite heavy and cannot be installed on Raspberry Pi. Are there any other safe alternatives? My Matlab code does ...
1
vote
0answers
16 views

Interrupts with MCP23017 using the mcp23017 dtoverlay

I'm at my wits end with this one. Okay, so we've got an MCP23017 with its INTA wired to the Pi gpio12 (bcm) in /boot/config.txt dtoverlay=mcp23017,addr=0x20,gpiopin=12 so far so good. I'm looking ...
-1
votes
2answers
35 views

Control motors and servos simultaneously (Python)

I have a Raspberry Pi 2B+ and some knowledge of Python. I need to control a DC motor, two servos and a LED simultaneously. The requirements are: Must control two servos, a LED and at least 1 DC ...
0
votes
2answers
164 views

Python script not running on start up

I have edited ~/.config/lxsession/LXDE-pi/autostart using nano (without sudo) to open a lxterminal and run a simple python script that contains an infinite while loop with a print statement. In my ...
0
votes
0answers
35 views

Raspberry Pi IR camera light sensor access

I am trying to use the light sensors on the the raspberry pi IR camera as a light sensor to determine if light is exposed or not. Is there a python picamera command that could access these light ...
0
votes
1answer
62 views

Multithreading Python Raspberry Pi 3 B+

My Raspberry Pi 3 b+ is reading by Modbus the values of an irradiation sensor, processing all the data, showing it in a plot and showing some warnings (if the irradiation ramp is higher than 5%). I ...
0
votes
0answers
9 views

Not receiving any data via Bluetooth connection

I'm trying to send data from a ps3 controller to my Raspberry Pi, but the code I'm using does not pick up any data sent from the controller. The controller is connected yet nothing happens when I ...
1
vote
3answers
1k views

No audio output using raspberry pi and pygame.midi

I have a Raspberry Pi 2 and a set of speakers connected to the 3.5mm headphone jack. I've got most audio coming out of my speakers by running amixer set name='PCM Playback Route' 1. pygame.mixer ...
1
vote
1answer
40 views

Turn off onboard LEDs at boot

I know very little about Raspberry Pi and Python. I've been able to turn off the LEDs in the terminal using the following command: sudo su - echo none > /sys/class/leds/led0/trigger However, I ...
0
votes
0answers
10 views

Windows IoT Core Python Compatibility

Does Microsoft still support Python on the Windows IoT Core because most of Microsoft's resource no longer detail how to create python applications for the IoT Core? If Python is still supported, how ...
0
votes
2answers
3k views

Installing RPi.GPIO on Ubuntu Core

I have Ubuntu Core installed on a Raspberry Pi 3. The purpose is to use the Pi as the brains of a robotic system I am building so executing Python code which interacts with the Pis' pins through GPIO ...
0
votes
2answers
414 views

Sending and Receiving data with RPi wifi Access Point

So, I have a project where I need to send and receive data from multiple devices (phones and a laptop) over a wifi network created by my raspberry pi. I have successfully created the wifi network by ...
0
votes
0answers
4 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!
3
votes
4answers
1k views

How to know when the pi finished shutting down

I wrote a python program that boots with pi, do it's job, and shutdown pi when finished working. It works fine, and when I'm connecting an lcd to the pi, I can know whether the pi finished shutting ...
0
votes
1answer
66 views

MPU 6050 Accelorometer Gyroscope code is giving me an angle of 75 degrees when it's suppose to be 90 degrees

I used a bubble level and Angle apps to verify that my MPU 6050 is actually rotated 90 degrees. Even so, my code tells me that the MPU 6050 is rotated ~75 degrees when it is in fact rotated around 90 ...
0
votes
0answers
6 views

Using Cakephp running python tensorflow

The program is work in Raspberry Pi using Rasbian Stretch. I have python script with TensorFlow object detection. Now I am using CakePHP to implement the website. In the CakePHP, I want to run the ...
0
votes
0answers
10 views

Invalid MIT-MAGIC-COOKIE-1 keyQXcbConnection: Could not connect to display localhost:10.0

I have RPi 3 B+ and 5" HDMI touch screen. I wrote this little GUI application in Python: import sys import os from PyQt5 import QtWidgets class Test(QtWidgets.QDialog): def __init__(self): ...
0
votes
1answer
26 views

At what instances do we use the Board mode and BCN mode in Raspberry Pi?

I know about the two modes of working in Pi using python, Board and BCN. However, I am really confused as to the instances or situations where I should use them. An example demonstrating their use ...
0
votes
1answer
27 views

Camera feed sent through TCP socket gets stuck sometimes

I am getting the camera feed from a camera on a Raspberry PI to the computer using a TCP socket to use it for openCV. It works well with minimal delay. However, sometimes the frame gets stuck(freeze) ...
0
votes
2answers
3k views

Installing Python 2.7

I am new to the Raspberry Pi, I have a project. I would like to work on Python 2 not Python 3. By default Python 3 is installed on my Pi. I want to change or remove this version and I want to ...
4
votes
1answer
3k views

smbus Import Error

I'm trying to use the module 'smbus' on python3. I've downloaded it - when I try to download smbus, it says that smbus is up to date and installed. However, when I try to use it, it says the module is ...
1
vote
2answers
39 views

Cronjobs sometimes fail to run fully when launching many Python scripts

I have about 30 Python scripts that I have scheduled to run via cron. Usually, I can run cronjobs on a Raspberry Pi just fine but I usually also only do a handful only. These scripts are essentially ...
1
vote
1answer
68 views

Feh in startup script only displaying images on reboot, not startup?

I have a Python script running on a Raspberry Pi Zero W that calls the image program feh in order to loop through some directories and display the enclosed images. The script is supposed to run on ...
3
votes
2answers
20k views

How do I pass a variable to a python script run from crontab? [closed]

I am running a python script using the following command: 0,30 * * * * python /home/pi/pythonscripts/script.py & and I would like to pass a variable 'test' to the script in the crontab, ...
0
votes
1answer
22 views

Raspberry PI UART doesn't work all the time

I am trying to communicate to a UART device using Raspberry Pi (Raspberry Pi 3B with Raspbian stretch) Header pins with pyserial. I have followed all the steps mentioned in https://www.raspberrypi.org/...
0
votes
2answers
39 views

Adding Averages to my Data Logger

I am using this Python program to log data from a serial device, and want to add a second document that logs hourly averages of the data. Anyone have an idea on how to add hourly averages? #!/usr/bin/...