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.

Filter by
Sorted by
Tagged with
1
vote
3answers
1k views

Controlling Raspberry Pi GPIO with c and Python

I was searching for C and Python Libraries which support Pi4.
0
votes
1answer
24 views

My desktop shortcut won´t execute

I created a GUI that tells me the temperature based on the temperature sensor I connected to the raspberry pi, that works fine, but then, I tried to do a desktop shortcut, and when I click on it, the ...
0
votes
2answers
123 views

How to use Config file between multiple pis

I have multiple pi's running a program where they listen for a broadcast message and trigger a python script. My python script that's triggered has config details that is same for all pi's. Whenever ...
0
votes
1answer
1k 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
1answer
146 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/...
1
vote
1answer
47 views

Pi Zero - GPIO Lag

Summary: I have been trying to write a robot tank using a Raspberry Pi Zero W in Python and am running into an issue wrt to lag. The left motor moves 100-500ms before the right motor (or vice versa), ...
-1
votes
1answer
41 views

Can my Raspberry Pi Zero W python program be duplicated and resold?

I have a Raspberry Pi Zero W that runs a program under the main username, Pi. I'm going to give this Pi to someone for their own use, however I expect them to use the Pi for their application without ...
0
votes
1answer
32 views

Controlling a rotary encoder through a Tkinter interface (letting RPI control the dial instead of the dial controlling a function on the RPI)

EDIT*** I have a "STEC11B03 ALPS" rotary encoder and I want a python script to output the same signal to the circuit as the rotary encoder does when turning. I want the script to do the same ...
3
votes
2answers
269 views

Do most GPIO sketches revolve around processing operating system support (not direct support like arduino)?

I am relatively new to the Raspberry PI platform and more experienced with Arduino. I have noticed in the examples for Infrared Receiving and 1-Wire protocol that the Python sketches to interact with ...
0
votes
1answer
754 views

Can't use my Raspberry Pi 3 B+ for I2C in high speed mode

I've been trying to use a Raspberry Pi 3 B+ to get data from an accelerometer, namely an ADXL 357, via I2C but the problem is that the data rate is about 200 Hz or even less. I tried to set the ...
1
vote
5answers
3k views

from pubnub import Pubsub ImportError: cannot import name Pubnub

This might be a possible duplicate, but I wasn't able to find a solution in the link here. I am new to raspberry Pi I wish to use Pubnub to communicate with an android application and a Raspberry Pi. ...
0
votes
1answer
22 views

Raspberry Pi H264 to HLS Stream

We need to use Raspberry Pi camera for 2 tasks. One is getting image, the other is watching camera remotely. Ways are getting RTSP from Raspberry Pi camera (which when I did it become difficult to ...
1
vote
1answer
603 views

Installing Jasper runs on several errors

I'm trying to install Jasper with this guide. Now i'm hanging with the following problem: i try to use the command sudo apt-get -t experimental install phonetisaurus m2m-aligner mitlm libfst-tools, ...
0
votes
0answers
21 views

Error "usb_hid module not found" on Raspberry Pi Pico

I'm trying to create a USB Rubber Ducky as seen in NetworkChuck's video, and the very first line of dbisu's script includes an import usb_hid, but when the script is run, I get an error stating ...
0
votes
2answers
174 views

Small pulses - DHT11 relay triger

I'd like to trigger my relay to turn on my lamp when the humidity level measured is greater than 85. Here's the code I've been using. import Adafruit_DHT import RPi.GPIO as GPIO import time sensor = ...
1
vote
1answer
51 views

L298N motor driver either keeps running or slows down the motor with RPi3

So, according to this video which I had followed, my motors should be constantly running as per the program and should stop running after the program is executed. Instead, when I first ran the script, ...
-1
votes
3answers
19k views

Ser.write() function input

I am trying to to send a number from serial ports on my Pi 3 to a motor driver, (RoboLCaw) by using Python. I have read lots of articles on the internet about how to to do very simple number sending ...
1
vote
1answer
36 views

Raspbery Pi GPIO Hat

I've got this Raspberry PI GPIO [expansion hat][1] attached to a Raspberry PI 3b and have a question. Even though the terminal blocks are well labeled, I don't think I understand what pin numbers of ...
0
votes
3answers
3k views

Raspberry Streaming using VLC picamera python

I am trying to stream Raspberry Pi camera video using VLC. The code is as follows: import subprocess import picamera camera = picamera.PiCamera() camera.resolution = (640,480) cmdline = ['cvlc','-vvv'...
0
votes
1answer
115 views

encoding problem: unable to find the match text only during reboot

I have a python file that is running ok if i run it in a terminal in raspberry pi. But if i set it to automatically run after it reboots (using crontab), the file runs ok until it reaches the line ...
2
votes
4answers
1k views

Running multiple scripts from different languages

This is mostly a conceptual question. Is it possible to have two scripts running on a Raspberry Pi, where one is a Julia script, and one is a Python script? In the most general case of this, is there ...
0
votes
1answer
21 views

Autostart random video script throws IndexError

I am trying to autoplay a random video from an attached usb volume upon boot on my Pi 4 Model B Rev 1.2. The following Python 3 script works within Thonny, popping a Tk message box with the randomly ...
0
votes
1answer
98 views

How can I get the set attribute of each "device" in an array

What I am wondering is how I can loop through paired_devices and get the "name" attribute for each device. This is only a short amount of the code, if more is needed, feel free to comment below. def ...
0
votes
1answer
116 views

Raspberry Pi + NRF24L01 timeout after a period of time

I am using a Raspberry Pi 2 with a NRF24L01 module... to communicate with several Arduinos. It is working very well ... until some point... after days or weeks. Then I get only timeouts. Not even a ...
0
votes
1answer
535 views

I am on the search for a X2Go solution for RASPI

I am on the search for a X2Go solution for RASPI I have had a quick lookup here at: http://wiki.x2go.org/doku.php/wiki:repositories:debian and https://wiki.x2go.org/doku.php/wiki:development:build-...
0
votes
3answers
545 views

How can I stream the pi camera stream from my raspberry with python?

How can I have a stream like rtsp, that is accesible in a program on another computer?
1
vote
1answer
643 views

Fade screen on sleep and brighten on wake

I'm looking for a way to control the screen brightness from code. I saw this post but this just turns the screen on and off. How can I dim the screen before it goes to sleep instead of just turning it ...
0
votes
1answer
895 views

How can Rpi Python control motor drivers L293D or L298N?

It is dangerous to run motors directly from the Pi, hence we need a motor shield. I own an Adafruit arduino motor shield clone: https://learn.adafruit.com/adafruit-motor-shield Note: I'm aware about ...
0
votes
1answer
37 views

PiCamera V2 NoIR and AMG8833 thermal sensor mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPC

Hardware used: Raspberry pi 4b, 4 gb ram, AMG8833 thermal camera, PiCamera V2 noir, ALL brand new, i just bought them few weeks ago. Im trying to do finish a project and i ran into a not that good ...
-1
votes
1answer
4k views

Pyaudio record audio using non-blocking callback

I am currently trying to make a simple script which records while a key is being pressed. I need to generate some data, so the intention with the script was to prompt the terminal with an sentence, ...
1
vote
1answer
131 views

I cannot install opencv

I just bought a new camera for my pi so I installed it and then I wanted to test it out so I got a simple python program to test it: import cv2 as cv def testDevice(source): cap = cv.VideoCapture(...
0
votes
1answer
216 views

Remote I/O error 121 with using ADS1115 for long time.sleep()

Hello together, I'm currently trying to read values from a pH-probe via an ADS1115 and the Adafruit_Circuitpython_ADS1x15 library connected to my Raspberry Pi 4. Using the instructions on https://...
0
votes
1answer
1k views

Run chromium with kiosk with auto-refreshing webpage (Spotify Jukebox)

I know I can run Chromium full screen based off of this tutorial, in kiosk mode, but I'm wondering what would I need to do to set up my pi up so that instead of just running one webpage on startup, it ...
1
vote
4answers
952 views

Start Python Script on Startup

I am having trouble getting what seems like a simple task to work. I have created a python file that I want to begin on startup. I have followed the steps for rc.local and init.d found here. To test ...
2
votes
1answer
80 views

fork() Process Issue on Channel Switching via Rotary Encoder

I have KY040 rotary switcher(encoder) as shown below picture. It is the scenario that there are 5 radio stations(simple html url) in urls.txt which are read into stations list in radyoCS.py, at every ...
0
votes
0answers
39 views

How to send a string from RaspberryPi to Arduino via serial interface?

I want my HomeAssistant being able to send out RF433. HomeAssistant is hosted on RaspberryPi while the RF433-module is on ArduinoNano. I am referencing this article with some modification. How to send ...
0
votes
0answers
10 views

Raspberry omv python script

I have installed omv and I have create a public file which inside I have put a python script. How I can run this script with ssh to see if is all okay? thank you in advance
0
votes
2answers
669 views

How to save images taken from dslr into the raspberry pi's sd card

I'm working on a project which I need to take images automatically from a DSLR camera and should save it in the raspberry pi's SD card. There was a tutorial it shows how to save the image into sd ...
0
votes
1answer
82 views

Different modules

What are the things to be considered when connecting 3-4 different modules to raspberry pi3? Ex: i am using 4 modules namely RFID reader, hall effect sensor, gps and some push buttons. Need to ...
1
vote
1answer
459 views

how to use MCP23S17 pin expander via SPI

I'm working on a custom sensor that is wired to a couple of MCP23S17 gpio expanders, which are in term connected to a Raspberry Pi 4 via the SPI pins i.e. SPI_MOSI, SPI_MISO, SPI_SCLK and CE0 pin. I'm ...
0
votes
1answer
43 views

RPI4 Camara module v1 - Slow FPS in python script

I'm doing a project that needs a python script to capture and process an image at 3-5 FPS. I'm doing some initial tests and my Camera Module v1 can only capture at 0.85 FPS @ 320 * 240 (also tested at ...
0
votes
1answer
268 views

Python ide for remote debugging/coding on Raspberry pi 4

Is there any Python Ide available from which we can remotely connect to pi (using ssh) and can write python script or debug from windows. I have already done this using eclipse here but this ...
0
votes
1answer
40 views

can't get audio to play from python, on raspberry pi

I have a Raspberry Pi 3B+ For speaker, I have some ear phones plugged into the 3.5mm audio jack. If I try pi@raspberrypi:~ $ omxplayer ./mario1.mp3 Audio codec mp3float channels 2 samplerate 44100 ...
0
votes
1answer
544 views

/dev/ttyusb0 cannot be find while starting script on boot for raspberrry pi

(Currently using Raspbian Jessie latest) So currently I am trying to start a script that reads from the rf receiver and gathers the data and sends it over to the cloud... I am trying to start this ...
0
votes
1answer
117 views

Rasperry Pi 4B LXterminal only runs python after python3.8 installed

I installed python 3.8 on raspberry pi 4b, now every time I open LXterminal, python 3.8 starts up, and using ctrl-D to exit only starts python up again. I am in a catch 22!
1
vote
1answer
6k views

Alsa lib error pyaudio on raspberry pi 3

I'm getting these ALSA lib errors when trying to use pyaudio. I know my mic works as I can live stream audio through gstreamer. Can anybody explain to me why i'm getting these issues: ALSA lib ...
0
votes
1answer
27 views

How to run a python script that plays an audio using php?

recently I'm doing a small project, and a part of it involves running a python script using PHP. to explain further: Python: from playsound import playsound playsound("path/of/the/audio") ...
1
vote
1answer
158 views

Cannot Load Library "./pxcore.so" to autorun a python script on boot using systemd

I want to run a code at startup but I am getting this error below. The script works when running in python, but I am unsure how to allocate permissions or where to make a path to the pxcore.so file so ...
0
votes
1answer
487 views

Two stepper motors with python

I want to make a motorized rc paddle boat type machine for fun. I plan to use two stepper motors to spin two wheels on either side of the boat. I am controlling it with python. I have a master script ...
152
votes
1answer
411k views

What is the difference between BOARD and BCM for GPIO pin numbering?

When using the RPi.GPIO library in Python you have to call import RPi.GPIO as GPIO and then GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM) What is the difference between these two options?

1
2 3 4 5
59