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
0
votes
2answers
16 views

User right problem while python script and git during boot up

I'm running a Raspberry that executes on the startup from the rc.local the following command: sudo /usr/bin/python3 /home/pi/skript.py >> log.txt 2>&1 & I need the sudo rights ...
0
votes
1answer
16 views

OpenGL 2 slowness

The Raspberry Pi 3b+ runs my OpenGL 2.1 program very slowly, with a frame rate of around 2 fps. How is this possible, when Python/Pyglet can render (using OpenGL, I suppose) much faster than this? And ...
1
vote
2answers
43 views

Remote write to file via ssh

I have 2 raspberry, and I want to have python script on pi1 that will open file and write something into it. That works on pi1. But when i try to run script from pi2 via ssh, it wont write to file. ...
1
vote
0answers
11 views

Is it possible to run django app on raspberry pi 0 w

As per above, considering no calculations are done on the app side, and it just displays templates with some javascript, would it work on Pi0w? Is it safe to assume that as long as it is capable of ...
0
votes
1answer
20 views

Idle 3.6 fails to install

I'm trying to install IDLE however I get this error message - $ sudo apt-get install idle-python3.6 Reading package lists... Done Building dependency tree Reading state information... Done ...
1
vote
1answer
24 views

How can you use pigpio's set_servo_pulsewidth with an i2c address?

I've tried to use hexadecimal for the GPIO address to see if it would work with GPA0 on the MCP23017 import pigpio import time pi = pigpio.pi() gpio_num = 0x21 while True: pi....
1
vote
0answers
14 views

Python script to search and get files from NAS [closed]

I am trying to use my RaspberryPi as a photoviewer, using the thousands of photo's from my NAS. I've build python scripts to show a random selection of the photo's. The NAS is not allways up, so my ...
3
votes
0answers
58 views

Problem sending analog read values over serial

Ok I apologize as I have edited this quite a bit, but I have narrowed down the problem a bit more. For some reason I can't transfer values from my arduino analog pins?? I am trying to send values ...
1
vote
2answers
20 views

Rpi zero w serial code python

So i set up my rpi zero w to comunicate at 11500 serial with an arduino... the arduino sends over serial lines such as "~1 11443". My idea is that the ~ character tells the pi when to look for data, ...
0
votes
1answer
45 views

Problem running the serial module with Python

I am trying to use the serial port on the Raspberry but when I run the example below I have the message: TypeError: 'module' object is not callable import time import serial ser = serial.serial( ...
0
votes
0answers
23 views

Error when creating Python GUI using Tkinter: “no display name and no $DISPLAY environment variable”

last few days I've been working to create a GUI using Tkinter This morning my code still worked, but now it crashed with said error: Traceback (most recent call last): File "TKtest.py", line 3, in &...
1
vote
0answers
21 views

Communication between computer with Labview and Raspberry Pi

I would like to use a computer with Labview to send commands to a Raspberry Pi, for the moment I am just trying to get a LED to blink. What would be the best way to proceed ? I have thought of two ...
1
vote
1answer
53 views

Why does my python script work in Thonny but not from the console?

Why does my python script work in Thonny but not from the console? (And yes I've tried running it from the console using python3.) Does Thonny run it in a loop that the console doesn't? Thank you. # ...
0
votes
0answers
13 views

Can't find my android phone via bluetoothctl scan on

I am currently working on a project that fetches the RSSI of my Samsung Galaxy S8 phone via bluetooth on a Raspberry Pi Zero W. I am running Raspbian and have successfully found other devices via ...
0
votes
0answers
27 views

How to create a person or head (not face) detection using open CV that are not too slow when run in Raspberry Pi 3B+?

Hello guys my problem is creating a program that can detect the head(not face) or human detection for my project One of the program that i see is too slow for raspberry pi 3B+ which is this : https:/...
0
votes
0answers
42 views

Raspberry Pi 3B+ successfully connect and pair but can't receive data from OBD II

Hello guys my problem is i cant recieve any data from OBD II to Raspberry Pi 3B+ Here the materials that i use: Raspberry pi 3B+ ELM327 -> OBD II Operating System of Raspberry Pi -> https://medium....
1
vote
2answers
107 views

python start on boot

i am trying to get my WS2812 NeoPixel python sketch to run at boot, i used a tutorial https://tutorials-raspberrypi.com/connect-control-raspberry-pi-ws2812-rgb-led-strips/ it install the correct files ...
0
votes
0answers
28 views

Unable to stop motor through GPIO in Python

I'm using an rPi to send a GPIO signal to a servo motor. When I run the program, the motor starts turning, and then continues without stopping, even if the program has terminated through the use of a ...
1
vote
1answer
66 views

PCF8591 with Analog Joystick I/O error when reading input PYTHON

I have been trying to create a retropie unit, and I'm in the midst of writing a script to inject uinput events for the analog axis values. This is the code I've written so far, but the issue is that I ...
3
votes
1answer
51 views

Sending a binary data stream to a GPIO at a certain frequency

I would like to send a random binary data sequence to a rpi GPIO at a particular frequency and then read the data stream off a scope. Is there a way of implementing this through python?
1
vote
0answers
146 views

How to connect ST7789 LCD to Raspberry Pi

I'm trying to connect to this LCD ( sry 4 japanese page:( use translate plz ) This monitor driver is ST7789, 7pins.[GND VCC SCL SDA RES DC BLK] And now I'm connecting to pi like this https://imgur....
0
votes
1answer
36 views

Is this a Python quirk or an imperfection in the Raspberry Pi input?

I am running out of ideas to get this Python code working the way I want it to. Please take a look at my code and help me figure out what's wrong, or if it's a hardware issue with the Pi causing my ...
0
votes
0answers
22 views

How to make more efficient reading of GPIO

My (python) program (on Raspberry Pi zero W) turns on/off a GPIO pin (connected to a relay module) depending on the RSSI signal of my phone (connected via bluetooth) and the status of one more GPIO ...
0
votes
1answer
38 views

SimpleMFRC522 stop reading after some time

My code stack after some time (example 1 day) after reading MFRC522 in loop mode. At the beginning it works without problems, after some time is not working anymore. I can't figure out why. Can you ...
0
votes
0answers
13 views

How to record and save an ongoing stream from picamera?

I am currently doing this project of streaming a live video into a localhost and then capturing an image after button click using a picamera. Here is my code: For streaming: import io import ...
0
votes
2answers
62 views

How to run a program after reboot

RASPBERRY PI 4 Hello there, I have this script that should shut off a power outlet when it detects a movement. The rpi-rf_send code is from this repo. The question is: if the current goes away, ...
2
votes
0answers
24 views

Permanent Arduino usb address on RPi!

So my project is using to Arduinos slaves to RPI that is master. They communicate through USB. Each time I remove one of the Arduinos I need to modify the .Py script to add the new USB alocated. Is ...
0
votes
0answers
25 views

Timed trigger for GPIO input

I'm running a raspberry pi system that records fish as they swim passed an IR break beam sensor at a fish ladder. So far the system works well but I'm trying to cut down some of the false triggers. ...
0
votes
0answers
28 views

How do I control a GPIO pin with a HTML button?

I am trying to send a temporary signal through one of the GPIO pins on my Pi 4, like to light up an LED for 1 second then turn off. Is there are way to do this by clicking on a button on my HTML web ...
0
votes
0answers
15 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
2answers
101 views

AdaFruit ServoKit CircuitPython Blinka Library Installation Problem

I'm follow along with a tutorial to get started with using CircuitPython to control servos on my RaspberryPi (https://learn.adafruit.com/adafruit-16-channel-pwm-servo-hat-for-raspberry-pi/using-the-...
1
vote
0answers
64 views

Raspberry Pi always reboots when trying to shutdown

I've been facing this issue for a long time and I haven't been able to find a working solution for it. I've found a few different posts online of people having the same issue but none of the solutions ...
2
votes
0answers
23 views

PWM on pump not working as expected

I am attempting to run a PWM on a pump using rpi.GPIO using the following code: def run_PWM_on_pump(): gpio.setmode(gpio.BOARD) gpio.setup(8, gpio.OUT) p = gpio.PWM(8, 0.5) #also works at ...
1
vote
0answers
42 views

picamera incorrect buffer length

I am currently using a pi camera module to stream video using flask and at some point, it randomly crashes. I found a similar question over here and they say that clearing the stream helped them sort ...
0
votes
2answers
46 views

433mhz Status sockets project

I've been working on getting a Home automation project going for a while, using a Rasp pi 1b (26 pin header). This is a well trodden path by others, as it is a project to control status remote sockets:...
0
votes
2answers
92 views

I2C MPU9250 Gyro/Accelero/Magneto 9-DOF Sensor MicroPython Programming Problem

so I've recently set up my raspberry pi. Am following a tutorial for the MPU9250, from https://github.com/tuupola/micropython-mpu9250. I have did a install of the micropython-mpu9250, and tried the ...
0
votes
1answer
22 views

pigpio.error: 'no permission to update GPIO' Only on some pins

I am having an issue where I get this error 'no permission to update GPIO'. whenever I try to address certain gpio pins. I looked at other posts that had similar issues but they seemed to have either ...
3
votes
1answer
99 views

How to get curent cpu mhz on a raspberry pi with python?

I need a sample program that will put the current CPU MHz in a variable with python. I prefer a short compact program. Thanks in advance.
1
vote
2answers
75 views

Unable to Install NumPy on Raspberry Pi 3

I'm installing NumPy on a Raspberry Pi 3 using pip. When I type in pip install numpy into the SSH bash terminal, pip starts collecting and downloading NumPy. But when it runs the setup.py file, it ...
2
votes
0answers
26 views

Adafruit OLED (128x64) display very dimmed?

I bought the Adafruit 128x64 OLED Bonnet and tested it with the demo program. Unfortunately the luminosity is very low and it is not satisfying: I have tried to adjust the contrast from 0 to 255 but ...
1
vote
0answers
29 views

Setting application screen display layer

I am displaying a video onscreen with omxplayer using '--l 0' Is it possible to run a python program and set it's screen layer to > 0 Expanded info :- I am running omxplayer from within a python ...
3
votes
2answers
239 views

How to connect ST7789 LCD to SPI Bus 1 as 2nd screen?

I've been trying to get this ST7789 library working with the 240x240 1.3" display on the rpi0w Python lib https://github.com/solinnovay/Python_ST7789 So far I've set all the screen pins to the bcm ...
2
votes
2answers
81 views

LIRC could not connect to socket

After installing on Raspberry lirc-0.10.1 according to this instruction (Setup IR Remote Control Using LIRC for the Raspberry PI (RPi)), when you try to send data from any config file, the irsend -d /...
1
vote
1answer
24 views

Installing netcdf4 on raspberry 3b+

I am trying to install NetCDF4 on Rp 3B+. This is the command I used: sudo pip3 install netcdf4 But the error message is: Collecting netcdf4 Using cached https://files.pythonhosted.org/packages/...
0
votes
0answers
21 views

bind event from evdev to GUI wxpython

I have buttons and joystick as in the image below and I am reading events from these inputs on raspbian with the evdev library, I am also running a GUI using wxpython. My question is how can I bind ...
2
votes
1answer
85 views

Rpi3B+ and Audio Amplifier HAT GPIO Pin Push Button False Detection/Triggering Problem

I'm currently having trouble with my project. I'm using a Raspberry Pi 3B+ with an InnoMaker Hifi Amp Hat and some push buttons. import time import signal import os import RPi.GPIO as GPIO GPIO....
0
votes
0answers
13 views

Pi Camera v2 Capture Photo without warm-up

I want to a project that capture some photos at a time. After taking photos i will send theese pictures to a windows platform to encoding. I saw so many examples about taking photos but i every code ...
-1
votes
1answer
54 views

Stepper motor vibrates, does not turn

I´m working on a simple project for school now and I have to use a stepper motor, but it doesn´t turn. The LEDs go on, the motor gets hot and the motor vibrates. When I adjust the sleep/function, the ...
1
vote
1answer
50 views

PIGPIO problem with delay on scripts

I am trying to run an old Raspberry Pi 2011.12 as a server to control a RGB LED strip. To this I am using PIGPIO since this is the best solution (RPi.GPIO is software based, which creates flickering). ...
1
vote
1answer
59 views

upgrade B+ to python 3.7

I have a B+ running rasp stretch and I am attempting to follow this tutorial to upgrade to 3.7 but I have an issue at the this step: ./configure –prefix=/usr/local/opt/python-3.7.0 make -j 4 Any ...