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
2
votes
1answer
427 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 ...
0
votes
1answer
62 views

Pigpio on callback get value

I currently have some code that I found that constantly outputs a value from a digital caliper. However, I want to modify this so that it is inside a function that can return that is returned from ...
1
vote
0answers
5 views

Raspberry PI random connection interruptions

i am running a raspberry pi B+ headless and losing network connection irregulary. I am living with that since a few years, but now want to fix the problem. What would be a good approach to find out ...
0
votes
0answers
16 views

Stuttering audio with PyAudio on raspberry pi zero

I'm writing some code that plays audio on a Raspberry Pi Zero while a button is pressed. When I test the code on my laptop, using mock pins to simulate button presses, the code below runs fine with no ...
1
vote
1answer
1k views

“404 not found” error when requesting Python with Lighttpd through CGI

I've installed lighttpd and gotten it to serve /var/www/index.html just fine, but I haven't gotten it to run a Python script yet. I enabled CGI and set it's match case and directory as instructed in ...
0
votes
0answers
13 views

High Pass Filter - Image Processing - Python

I want to make python program that apply High pass filter to make the image appear sharper but i want to make this code working Sequentially and parallel (using MPIs Library (i.e: reduce , reduce_all ,...
0
votes
1answer
501 views

Listen for certain keyboard input and insert to SQL Server DB

I have a USB NFC reader (acts as an emulated keyboard that types out the 10 digit ID number on the card when scanned). I want an app to listen for this input and when it sees 10 digits, I want it to ...
1
vote
1answer
419 views

Access the display from a python app running as a service

Problem: The code below can't access the display when running as a service. I have my raspi hooked up to a touch screen monitor in the kitchen and I've attached a Passive Infrared sensor to the GPIO ...
0
votes
1answer
629 views

How can I run a Python script on boot with display support?

I need to run a Python script on boot with display support I have tried using rc.local, cron and a couple of other methods. All of them start the program and it runs as it should but I have a blank ...
0
votes
1answer
3k views

Scan Distance from Eddystone Beacons

I would like to read an Eddystone Beacon using my Raspberry Pi 3 to calculate distance from the beacon. I can't find any resources to do this from the official Eddystone documentation. How should I go ...
3
votes
1answer
58 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?
0
votes
1answer
1k views

Play different videos with omxplayer depending on reported sonar distance

I am a new to Python. What I want to do is that playing different videos depends on distance using Ultrasonic sensor. For example, if the distance <= 20, play movie1. if the distance > 20, play ...
1
vote
1answer
1k views

Kivy on Raspberry Pi: Mouse cursor not showing

I'm running kivy on a Raspberry Pi. I accepted that apparently you can't get around the fullscreen, but I can't get the cursor to show either. I tried by adding touchring = show_cursor=true to the [...
0
votes
1answer
69 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 ...
3
votes
1answer
837 views

Not getting a response from a connected PIR sensor

I have a PIR sensor which I'm using connected to a Raspberry Pi 3 Model B as part of a Magic Mirror project. I'm running this module for the sensor. I've had the Motion Sensor working before, but now ...
0
votes
2answers
1k views

How to identify the MAC address of built-in wifi in python

I'm experiencing some difficulties when I attempt to identify the MAC address of the built-in wifi in my raspberry pi 3 model B. My application requires the built-in wifi to always be identified as ...
0
votes
1answer
44 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 ...
3
votes
2answers
292 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 ...
0
votes
1answer
619 views

Using gpio from CLI to trigger a rising or falling event detection

I have a python system script with various functions. I have multiple buttons hooked up to the Pi and I am using this code: import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.IN, ...
2
votes
3answers
100 views

Python script won't load on startup

I have tried like 5 methods to get this script loaded after raspi3 load. #!/usr/bin/python3.7 #sudo python /home/pi/masterBaseInterface.py import socket # Import socket module import ...
1
vote
1answer
2k views

RFID RC522 Reader & Chromium Web Page

I'm having a bit of difficulty locating a specific example, however I have found people referencing that they have accomplished what I am looking for. At a basic level, I have a webpage being served ...
1
vote
1answer
4k views

Error trying to install python-firebase on Raspberry Pi 3

I have installed requests but I'm unable to install the python-firebase package. I want to fetch data from firebase on my Raspberry Pi 3. I have used the following code to do the same on my PC. from ...
1
vote
2answers
1k views

Raspberry pi 3 reading serial port

I have a python code that reads the serial port of the raspberry pi 3to obtain GPS positions from a fona808. The code works for some time and then throws this error. Traceback (most recent call last):...
1
vote
2answers
857 views

How can Rpi move a servo motor using a GPIO pin in PWM mode?

iam new to raspberry pi and i got an error while a running servo motor in my object detection script i need to run the servo whenever my if condition is true so the same pin run multiple times if ...
0
votes
1answer
47 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 ...
1
vote
2answers
49 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. ...
0
votes
2answers
2k views

function button.is_pressed from gpiozero do not work

Im working on a university project with raspberry and gpiozero. I need to manage the button response to take diferent actions. The problem is that de function button.is_pressed its always true (even ...
0
votes
1answer
562 views

Understanding struct.unpack code

Hello great community of helpers! We new programmers greatly appreciate your continuous help. Thank You! Can you explain this 1 line of code below... - Or break it down into separate chunks. I ...
0
votes
0answers
104 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 ...
1
vote
3answers
798 views

Crontab task not running script - Permissions?

I've got a python script on my Pi 3 to read a value from an ultra-sonic sensor then write to a db - that alls grand. I've tried to make a crontab task scheduler for it, but it's not working. First, ...
0
votes
1answer
37 views

Modifying what is shown in the uART

I am working on establishing user communication (one may say a basic UI) from the user's PC to my Raspberry Pi, where the RPI would accept pre-defined commands from the user via uART and then process ...
0
votes
2answers
17 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 ...
1
vote
1answer
26 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 ...
0
votes
1answer
694 views

ultrasonic sensor stops after giving some reading when running in thread on tornado websocket python

I am using Ultrasonic sensor to get reading and am using python program for getting reading. And am using Raspberry pi for this. when am running python program independently its giving me reading ...
0
votes
2answers
2k views

Kivy won't listen to “fulllscreen” setting

Working on a Raspberry Pi Model 3 B, running raspbian. Running Kivy v1.9.2-dev0 and Python v2.7.3 Trying out one of the Kivy examples but for some reason the application won't come up in "Windowed ...
0
votes
1answer
26 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 ...
0
votes
1answer
79 views

I think I fried my Raspberry Pi, but I'm not sure

I was making connections from my Raspberry Pi to a relay module. While I was running some sample code, I noticed that after I had terminated the program I was still getting a high CPU usage (around 60%...
1
vote
5answers
2k 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. ...
1
vote
0answers
16 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 ...
1
vote
1answer
1k views

Problem with GPS module and Python

I copied a program from the Adafruit webpage to test my GPS module and before running it I installed the Python gps with sudo apt-get install python-gps but when I run the program I get this error: ...
0
votes
1answer
503 views

Kumantech 3.5" LCD Touch Display, Python Library

I've a Kumantech 3,5" LCD Touch Display in front of me. I'm trying to find a python library to controll the LCD, because i don't want to use x or just to console. I couldn't find any. And I couldn't ...
1
vote
1answer
529 views

sudo pip install packagename not working

sudo pip install packagename not working... I am not able to install python package using pip.
0
votes
1answer
871 views

How can I turn on/off LED of RPi.GPIO in the same number key?

I am trying to write the following program (8Relay.py) using python on the Raspberry Pi. I want to use the input from a GPIO pin to turn an LED on or off, depending on what input was pressed (1~8). ...
1
vote
1answer
30 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....
0
votes
1answer
184 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
1answer
49 views

How to trigger a capture using Picamera when a particular event occurs (for eg, whenever a specific object appears in front of the camera)

I want to trigger an image capture every time a tyre of a set of moving vehicles appears just in front of the picamera. Is there any way to get this done automatically every time a tyre appears in ...
0
votes
1answer
2k views

Displaying a continuously updating time stamp on a 10 minute video

My objective is to print a continuously updating time stamp on every second of a ten-minute video recording instead of one that updates every minute. I'm running the picamera module of python version ...
1
vote
0answers
15 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 ...
0
votes
1answer
823 views

Audio Processing Issues in PyAudio in RPi

Basically, I want to analyse the spectrum of the input audio stream to my Raspberry Pi. I have configured my Audio USB Adapter and ran sample tests on Play and Record. I am using PyAudio to take ...
3
votes
0answers
87 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 ...