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
0answers
33 views

Python3 Error while accessing from a Particular path

I'm Getting the following errors while using python3 from a fixed location, here it is 'python' Directory (/home/pi/python) pi@rituraj:~/python $ python3 Python 3.4.2 (default, Feb 10 2019, 17:23:02) ...
0
votes
0answers
70 views

trying to rotate 28BYJ48 and 2 NEMA17 stepper motors simultaneously but the rpi reboots each time

I am trying to control a 28BYJ48 stepper(Driver ULN2003AN) and 2 stepper motors NEMA17(A4998). I wrote the code using python using PIGPIO but the rpi turns off every time I try to run the code. I ...
0
votes
0answers
201 views

Si7021 temperature & humidity reader — Python code errors

I'm new at this. I bought an Si7021 temperature and humidity sensor, and it's wired to a breadboard -- I believe correctly. I have code, here, from the book "Make: Jumpstarting the Raspberry Pi Zero ...
0
votes
0answers
264 views

Configuratión mcp 3208 en raspberry pi 3 with spi

I have a problem in the configuration of the A / D converter I am working with the Pi 3B +, in case the problem is that I do not know if the configuration is ok, since it only throws a zero value ...
0
votes
0answers
1k views

Connect Raspberry Pi to Wifi using mobile app

I have programmed Raspberry pi to execute program which primarily works using Internet at the boot up. But it works as long as Pi is in my wifi range. Now suppose, my friend wants to use that pi in ...
0
votes
0answers
96 views

piscope SPI pin activity even though the SPI device is not connected

my final goal is to use python (spidev) to communicate with a BMS chip. Until now I was quite unsuccessful, thats why I wanted to use piscope to track the activity of the SPI pins. The device is not ...
0
votes
0answers
333 views

GPIO number vs Pin number. Which to use?

I am writing a code for an ultrasonic distance sensor. The code worked fine when i used the gpio numbering system for the wires connecting to the gpios and sensor. As soon as i connected the sensor to ...
0
votes
1answer
156 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) ...
0
votes
1answer
169 views

SenseHat joystick loop consumes 100% cpu load

After messing around with the SenseHAT for the Raspberry Pi (a Model 3B in my case) and testing the LEDs and sensors, I wanted to try out the included joystick as well. Naively going after the "...
0
votes
0answers
712 views

How can I recieve data from uhf rfid reader's usb port to my raspberrypi controller

I am new to raspberry pi, currently we want to develop gate control with open/close boom-barrier so we are using an UHF RFID reader and a raspberry pi. I bought a RFID reader that has a USB connector ...
0
votes
0answers
71 views

Cannot start Deluge, Keep getting Syntax Error

pi@raspberrypi:~ $ sudo deluged pi@raspberrypi:~ $ [ERROR ] 22:51:31 main:248 invalid syntax (__init__.py, line 1) Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/deluge/...
0
votes
0answers
237 views

How to play specific video files through python script based on passed integer

I have an oddly specific problem, though aren't they all? I have a RPi 3B+ on stretch that I'm trying to boot into a python script that I've written that receives an integer and passes it to two ...
0
votes
1answer
159 views

Mute PAM8302 amp with Raspberry Pi

I'm using a PAM8302 amplifier with a Raspberry Pi Zero W and it's working great. However, I'd like to start the amp muted and then unmute it from a Python script. Per documentation, PAM8302 goes into ...
0
votes
0answers
113 views

Serial communication between RPi and PIC uC uart receiver accuracy

I am currently working on serial communication between RPi and PIC. I am new to Raspberry Pi and python world.... okay following is my code: from serial import * from time import * import RPi.GPIO as ...
0
votes
1answer
121 views

Printing Python Variables for Debugging

I'm a Python newb so please bear with me if I'm asking a stupid question. I have a RPi3 running Jessie lite. I have Apache and PHP installed. I also have netatalk installed and have mounted my pi e....
0
votes
0answers
264 views

How to toggle a push button to capture an image and insert a string in a text widget?

I have a project that involves capturing an image using a push button and after I use image processing I can convert it into a string. How do I make the string display the tkinter text widget while ...
0
votes
0answers
124 views

Multiple raspberry pi's 3 synchronized image navigation

We have 7 raspberry pi's 3, each connected to the internet and an display. On each screen / raspberry pi is geeqie (image viewer_ running with an image slideshow. The goal is to have all raspberry pi'...
0
votes
0answers
88 views

Auto-(re)start of GUI application prevents shutdown

I have a GUI program (Python + Qt) coded for my Raspberry Pi. In order to start the program after startup, I have added the following line: @/bin/bash /home/pi/start_my_program.sh into .config/...
0
votes
0answers
157 views

Multiple GPIO.add_event_detect callbacks results in incorrect expected output

I am currently working with a differential drive robot which has two wheel encoders connected to GPIO Pins 5 and 23. I managed to obtain velocity information based on the pulse time information ...
0
votes
1answer
538 views

prevent script running twice consecutively - Python

I have the following two Python scripts one sends a motor forward while the other script sends it backwards. Each script is operated by it's own button on a remote. Script A import RPi.GPIO as GPIO ...
0
votes
0answers
66 views

TDOA Estimate and Plotting results on Matlibplot

I edited the following code in order to the estimate location of sound source(drone) using four stereo microphones. The microphones are connected to Rpi 3 through a stereo to usb converter (HF0200C). ...
0
votes
1answer
57 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
1answer
81 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
0answers
71 views

Error while opening LXTerminal in Raspberry Pi

I have got a problem. I am giving power to RPI 3 B+ and waiting for starting OS. Then when I open LXTerminal there are symbols with error of /etc/inputrc(see screenshot in down). Please help me, and ...
0
votes
0answers
64 views

How can I run mediainfo with specify folder?

this is my codes: #!/usr/bin/python3 # -*- coding: utf-8 -*- import os import subprocess dirr="/home/pi/hrc2/Film-Dizi/duzenle/The Handmaiden (2016)" file="The.Handmaiden.2016.m1080p.BluRay.x264-...
0
votes
1answer
582 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
393 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
2answers
131 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 = ...
0
votes
0answers
617 views

Python script wait for button press before starting/stopping a separate python script

I've written a python script (shown below) which starts and stops another separate python script (datalogger) once a button is pressed. The datalogger script records logic levels (0 or 1) and stores ...
0
votes
1answer
553 views

RPI object tracking with multiple objects

I have been reading a tutorial on creating a Rpi colour based object tracking system but have been unable to test it due to me being a away from my Rpi. However I have read through the code and it ...
0
votes
0answers
253 views

Run Python code from PHP

This is probably a Linux question, but concerns specific Pi code. I am using the DHT11 class from http://abyz.me.uk/rpi/pigpio/download.html and have written a program which uses this. #!/usr/bin/env ...
0
votes
3answers
92 views

Pi Zero Button pressed detected incorrectly

simulate this circuit – Schematic created using CircuitLab I have a script that sends me a firebase notification when the doorbell is pressed. It was working fine when it was on the breadboard. ...
0
votes
2answers
301 views

Problem with RFID-RC522 and Raspberry PI Background script

I am working a project to read an RFID tag, and make the buzzer sound. It works correctly in foreground. I call the python script via /etc/rc.local and it is triggered when I execute /etc/rc.local via ...
0
votes
3answers
4k views

OpenCV 4 error?

When I run the command python faceDetection.py I get the error- VIDEOIO ERROR: V4L: can't open camera by index 0 Traceback (most recent call last): File "faceDetection.py", line 21, in <module&...
0
votes
1answer
305 views

running python script as service and calling functions from another program

I have a python script to control some LEDS. In a compiled c++ program I have been calling python scripts like so in various places: system("python /home/pi/leds_flash.py") system("python /home/pi/...
0
votes
1answer
591 views

using iso 15693 NFC tags on Raspberry with rc522

Is it possible to read/write ISO 15693 NFC tags using an RC522 chip? So far I do not have much experience with the chip, I downloaded this https://github.com/mxgxw/MFRC522-python library but ...
0
votes
1answer
2k views

serial errno 25 inappropriate ioctl for device

I have raspberry pi 3 B+ running latest raspbian-strech lite. i have a max485 ic connected to uart on the gpio. import serial,fcntl, struct ser = serial.Serial( port='/dev/serial0', ...
0
votes
1answer
624 views

Using the HMC5883L on the GY87

This was touched on in this question, but I was unable to get the solution to work: (Not all devices that are connection via I2C are showing) I have a GY-87 multi-sensor module and can get the IMU (...
0
votes
1answer
1k views

Executing multiple scripts on startup in a particular order

I am running Raspbian GNU Linux (9) Stretch, on my Raspberry Pi 3. Project Overview Python script which makes use of 2 inputs to the Pi. Calculations are performed based on these inputs, and values ...
0
votes
2answers
151 views

Writing to GPS HAT on Raspberry Pi Zero W Never Returns Anything

I have attached a GPS HAT to a Raspberry Pi Zero W running RASPBIAN STRETCH WITH DESKTOP. When I SSH in to run a simple Python script that writes to the HAT serial port, nothing happens and I am not ...
0
votes
1answer
331 views

feh can't display image

I have written a python script that displays the image from the URL. def image_func(link_image): img_cmd = "feh -F %s" %(link_image) os.system(img_cmd) os.system("pkill feh") If I ...
0
votes
1answer
47 views

SSH showing “connection failed” after installing “pip”

Python3, pip3 and python was installed before on my Raspberry Pi. Today I've successfully installed pip using below command: sudo apt-get install python-pip After few hours later I'm not able to ...
0
votes
1answer
153 views

Not able to send GPS data (lat, lon and alt) to journal (systemd)

Working on a data acquisition project where I am trying to send GPS data to cloud. Board: Customised board based on the schematics of Raspberry Pi Compute Module 3 Lite and I/O baord. Have added GSM ...
0
votes
1answer
55 views

Control Motor via Raspberry Pi connected to a Laptop (running code via PyCham)

currently working on a project with detecting objects via a Camera Module and controlling motors based on the camera detection (if object is in sector A, move motor B down, etc.) using Python. The ...
0
votes
1answer
364 views

error trying to set up RFIDIOT on raspberry

I am new to raspberry and python in general. I followed different guides to set up RFIDIOT (even the documentation and the installation guide on the repository on Github). So far, when I run pcsc_scan ...
0
votes
2answers
2k views

How to properly implement threading within a function toggled by a button [closed]

I need a little help if possible. I'm trying to make a threaded function which will make my LEDs blink randomly as long as the button is pushed. when it is released it should exit the function and ...
0
votes
1answer
700 views

WHY my Python BLE device discover codes don't catch as many devices as Raspberry Pi OS panel does?

I developed some BLE device discovery python codes from the example given in https://github.com/pybluez/pybluez/blob/master/examples/ble/scan.py which are run on a Google AIY Raspberry pi. from ...
0
votes
0answers
5k views

Problem with subprocess.Popen, Permission denied

I was trying write a simple script to open the Arduino IDE. import subprocess arduino = "/usr/share/applications/arduino-ardunoide.desktop" subprocess.Popen(arduino) But i recieve the following ...
0
votes
1answer
132 views

Flask server blog question

I am about to embark on my first experience with Rasb Pi and I want to utilize the code from this blog on how to stream motion JPEG thru a Python Flask server, Flask Video Streaming Revisited. The ...
0
votes
1answer
308 views

gps.next() hangs, NMEA data may be bad?

I've got a few RPi's (0W's) running GPS. All have worked with the same install steps and code except the latest I just assembled yesterday. Now when I run my GPS code, I get the following prints and ...

1
44 45
46
47 48
54