Stack Exchange Network

Stack Exchange network consists of 174 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
0answers
10 views

No response of rasperry while using selenium with python - code works fine on other device

i wrote a python code using selenium to interact with a headless browser. Now I'm trying to transfer the program to my raspberry so I don't have to keep my Laptop online all the time. I altered the ...
-1
votes
0answers
10 views

Open 2 chromium Windows 1 on each screen

I have a dual screen setup (fb0, fb1) and was wondering what's the best way to open a web-browser window in full mode one on each screen at boot. Each will have a diff url. Using latest raspbian on a ...
0
votes
0answers
10 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
0answers
14 views

Python PiCamera V2 won't take bmp images, why the errors?

from picamera import PiCamera import time camera = PiCamera() camera.resolution = (3280,2464) time.sleep(2) camera.capture("test1.bmp") # This code doesn't work #camera.capture("test1.jpg") # This ...
-3
votes
0answers
23 views

Code for stepper motor 28BYJ-48 to work with a pibrella

I have already attached the wires to the outputs (Red - E+, Orange - E-, yellow - F-, pink - G-, Blue - H-) but am not sure how to program it.
2
votes
2answers
38 views

I'm trying to run a python script at boot but keep getting “socket.error: [Errno 111] Connection refused” error

I've bought my first Raspberry Pi 3B+ last week and started working on my project but I seem to be stuck at this point. I've looked through a hundred different posts but none of the solutions seem to ...
0
votes
0answers
13 views

lxml package freezing during install

I'm trying to install the pyquery module, which requires lxml. Whenever I try to install the lxml module, though, it gets exactly this far: $ sudo python3.7 -m pip install lxml Looking in indexes: ...
1
vote
3answers
42 views

can't install opencv on my pi

I'm an absolute Raspberry Pi newbie. My intention is to get some camera vision project working for which I need OpenCV3.3's dnn Python module. I've found here a description of how OpenCV can be ...
2
votes
0answers
27 views

Programming bluetooth module of RPi 3 B

I'm trying to scan the invironment of the Pi for active bluetooth devices. I'd like to have MACs, names and signal strength. Of course I can run bluetoothctl in the shell and then use scan on command ...
0
votes
2answers
40 views

Python button script stopped working

I have this script which runs a motor until a button is released. It was working fine up until making some changes to the setup earlier but now the motor doesn't stop when the button is released - ...
0
votes
1answer
41 views

Terminal and program run on boot-up

I am trying to find a way to open a terminal and run a program on boot using Raspberry Pi's newest Raspbian Jessie. I have tried to use the following: /home/pi/.config/autostart/whatever.desktop [...
0
votes
1answer
51 views

On boot open tmux session and start continuous python script

I've spent days going in circles with this one, my google skills have failed me... I am using a systemd service to run a shell script on boot which should open a new tmux session and start a python ...
1
vote
0answers
44 views

Raspberry Pi jammed after few days of continuous work? size full?

I made a project on raspberry pi 3+ and left it on over a weekend. After 4 days, when I came back, the program was not working. When I try to connect it with Remote Desktop, it was not working. I ...
0
votes
2answers
39 views

How do I write data to a file, and not just print to console window [closed]

I'm trying to write this print dt(), socket.gethostname(), " at ", getIP('eth0') print "---------------------------------------------------------" print "Temperature: ", CPU_temp,"F" print "CPU ...
1
vote
1answer
32 views

JSON not working with LIRC

I have the following script which is meant to write/read a json file. The problem is it will only write/read the file from the command line and not when using a remote via LIRC. import RPi.GPIO as ...
0
votes
2answers
32 views

how to remotely control raspberry pi gpio

I'm doing a face recognition project that uses opencv and python to recognize a person's face on a pc. Now, my goal is to use a raspberry pi to access one of my gpio ports, and when One face was ...
0
votes
1answer
62 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
9 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
21 views

Best way to stream footage

I'm looking for the simplest possible way to stream footage from my raspberry pi camera to my computer using a python program. I will also be using this on multiple networks so if there's an easy way ...
0
votes
1answer
61 views

trying to run 6 USB cameras simultaneously on a single Raspberry Pi 3B+ with add-on 4 port USB hub with external power

We are trying to simultaneously run 6 cameras on a Raspberry Pi 3B+ with an add-on 4 port USB hub that has an external power supply. The cameras are set at 15 FPS with a colour image size of 640 X 480....
0
votes
0answers
13 views

Is it possible to install a graphical python script as a desktop/panel widget?

I have written a simple Python program in Tkinter with a Scale which I can use to control the screen brightness. Is there a way to install this as a part of the panel and use it from there like all ...
0
votes
1answer
15 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
0answers
21 views

GUI lag using Tkinter to update a dynamic label counter [on hold]

I've created a simple program to change the LED blink rate (using a Raspberry Pi 2B running Raspbian) based on a GUI button input. The code works, but the problem I'm having is that there is a ...
0
votes
0answers
20 views

Touching on display does not work?

i got an Raspberry Pi with a display on it. The display is a WaveShare SpotPear LCD (A) V3 and connected through the pins on the Raspberry. It works great and also when I move the USB mouse, it works ...
2
votes
1answer
37 views

read variable and trigger event - python

I have the following script which increases the counter variable every time a button is pressed. When counter reaches a certain number i.e. 10 lets say I want an event to trigger. from time import ...
1
vote
2answers
37 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
77 views

How do I run a python script as root [duplicate]

I'm try running a Python script that uses the GPIO pins but I get an error telling me that it doesn't have access to dev/mem and I should try running as root. I don't know how to run a Python script ...
0
votes
1answer
50 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
25 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
1answer
35 views

Unplug ethernet seems to freeze connectivity-check script

I'm working on a raspberry project with a RPi B+, running Debian stretch. I've included a LED which should turn on when the Pi establishes an internet connection, and should turn off when this ...
0
votes
4answers
446 views

How can I make my LED flashing while executing the rest of the code?

How can I make my LED flashing while executing the rest of the code? I want to make some LEDs flash while my program executes the rest of the code.
0
votes
0answers
14 views

Scan search USB port and manipulate the data received from wireless modem

Any example which helps me to search the automatic USB port availability in raspberry pi and sends the information of wireless sensor network, which uses the wireless modem as a gateway receiver. I ...
1
vote
1answer
37 views

How do I run a service (Darkice) in the background?

I am trying to build a one-button Darkice streaming box, I'm using a Pi 3 B+ with Stretch from NOOBS. I have everything set up but my Python script hangs up as soon as the button is pressed and ...
0
votes
0answers
19 views

Christmas Present Help - Raspberry Pi 3 - Run Interactive Python Program in Console on Login

So, I'm using the Pi 3 as a soundboard using the code found here: What I am looking to accomplish here is to have the Pi automatically run the code upon boot. So far, I have changed the default ...
1
vote
1answer
16 views

Changing FeatherWing Address via Solder Jumpers [closed]

I'm connecting two 7-segment LED's to the SDA and SCL lines of a Pi and controlling the display using the example Python code. Currently both displays show the same number. I want them two show ...
-4
votes
1answer
35 views

Everytime I run my code it says that y is not defined [closed]

Everytime I run my code it says that y is not defined. Why? def main(): x=str(input("enter first number : ")) ab=(input("enter operator : ")) z=str(input("enter second number : ")) ...
0
votes
0answers
14 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-...
2
votes
0answers
55 views

Bash or python, what is the most efficient to use pi's `GPIO`s? [closed]

TL;DR EDIT: to clarify this question and why it's relevant to the PI: what is the most efficient way in term of absolute time and energy (which I guess is more related to clock cycle) to now the ...
0
votes
0answers
19 views

'Inappropriate ioctl for device' Error at a TX/RX connection with a thermal printer

I want to connect my Rasperry Pi3 with a thermal Printer I've bought and I checked all tutorials I could find and after trying one out I get this error: Inappropriate ioctl for device I get this ...
0
votes
0answers
31 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 ...
1
vote
0answers
51 views

Sense HAT LED matrix displays incorrectly

When I try to light up one pixel at a time, the whole column lights up. This happens no matter what color I set it to. The rainbow when the pi boots up is also distorted since the columns are lighting ...
0
votes
1answer
27 views

interface bmc280 & tsl2561 together [closed]

I am trying to interface bmc280 & tsl2561 together with Pi Zero. I have connected bmc280 to Pi Zero on Pin 3-I2C.1 SDA & Pin 5-I2C.1 SCL and was able to read the data over i2c. Also want to ...
0
votes
1answer
30 views

GPIO pin remains high

Upon running the following script my relay stays open when the GPIO pin is set to output. In all my attempts. there has not been any way for me to alter this behaviour. The code I've ran: import ...
0
votes
1answer
55 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 ...
2
votes
0answers
20 views

ADXL345. Bits, resolution and g's

I have a Kistler type 8921 which produces 1g (10m/s2) RMS (at 159 Hz). The ADXL345/Raspberry Pi 3 setup should produce similar g's, but currently doesn't. As can be seen, it is not just about a ...
0
votes
2answers
67 views

Help running Python script from terminal as easily as I can with IDLE

I have a long script that runs several GPIO devices using both SMBus and pigpio. It starts a thread to cycle through a series of screens on an OLED display, and then connects to Paho MQTT, and keeps ...
0
votes
1answer
26 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
1answer
42 views

3 PWM pins for RGB LED

I got an RGB LED, one mass and one for blue, red, green. So I got a list there are only two PWM compatible pins listed. Pin 32(GPIO 12) and pin 33(GPIO 13). But for my RBG LED I need three pins with ...
-1
votes
0answers
32 views

Bluetooth Xbox One Input Raspberry Pi

I'm trying to build a robot using a Raspberry Pi 3, and I would like to control it using a Bluetooth Xbox One controller. I am able to get the controller connected to my pi. I've verified this by ...
2
votes
3answers
70 views

gpiozero Button.when_pressed

I'm learning python and gpio using the examples here: https://gpiozero.readthedocs.io/en/stable/recipes.html I wanted to extend the code to more than one button and pass a parameter to a function (...