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
1answer
14 views

interface bmc280 & tsl2561 together

I am trying to interface bmc280 & tsl2561 together with Pi Zero. I have connected bmc280 to Pi Zero and able to read the data over i2c. Now I want to add tsl2561 t read LUX. Is it possible ?
0
votes
1answer
25 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
17 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
15 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
58 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
21 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
28 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 ...
0
votes
0answers
12 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
33 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 (...
0
votes
0answers
34 views

DHT22 bad readings on long cable [migrated]

I'm preparing a setup with a long wire separating the sensors and the rpi. Wire is a cat6 RJ45 (ethernet) cable of 100ft (30m), that i'm using 6/8 wires. I randomly choose the wires, I figured as long ...
0
votes
1answer
25 views

Is in Python anything like in Java platform.exit() to leave the program [closed]

I got a Button and when the Button was tapped it runs a function. Till here I got everything ready. And now my question I will close the program correct like in the title. Is in Python anything like ...
0
votes
0answers
21 views

How can I connect the Raspberry Pi to IFTTT without using webhooks?

I know you could use webhooks if the RPI is publicly accessible, but I would like to avoid that. My objective would be asking google assistant to turn on a GPIO pin, then that info magically ...
-1
votes
0answers
19 views

How do I link my gesture recognition system wirelessly with an IP Camera? [on hold]

I am currently building a hand gesture recognition system using gloves equipped with flex sensors. Along side that,I am also building an image recognition system that recognises hand gestures using ...
0
votes
0answers
16 views

Start and stop saved putty session with python script

Could anybody please help me with the Linux equivalent of this python script? import os, time, subprocess a=0 while True: p=subprocess.Popen('C:\Program Files\PuTTY\putty.exe -load "TEST"') ...
0
votes
0answers
11 views

Define the RFID reader port

I have 2 RFID and I would like to test it by there ports.. here's my code: import RPi.GPIO as GPIO rfid_reader_in = "/dev/hidraw0" #for RFID time in rfid_reader_out = "/dev/hidraw1" #for ...
-2
votes
0answers
32 views

Three image processing on one Raspberry Pi [on hold]

Is it possible to use a single Raspberry Pi 3 for three camera inputs and do different image processing per camera? Please explain to me whether yes or no.
1
vote
1answer
32 views

Trouble accessing Sensirion sht21 though multiplexer tca9548a using i2c and python

I can't reach my sht21 sensor throughout the Multiplexer tca9548a (adafruit). When I run it with python3 in the raspberry pi's terminal, I get this error report: Traceback (most recent call last): ...
0
votes
0answers
15 views

Raspberry Pi define the USB port currently plugin to apply on Python

How to define the USB port that currently plugins on Raspberry Pi, because the currently plugins on Raspberry Pi is the 2 current RFID, keyboard and mouse. I would like to get the ports of RFIDs to ...
0
votes
1answer
32 views

How can you power on and off devices via GPIO

I have a humidity sensor monitoring but I only want it to monitor for a short time and then I want to power it off. It is 3.3v. I am using CRON to call a script.py When the script finishes I would ...
0
votes
0answers
16 views

Python - Microphone recognition problem

I'm recording sound perfectly via arecord command. I use MEMS microphone with i2s interface and works well. But also I installed soundmeter program from https://pypi.org/project/soundmeter/, and it ...
0
votes
0answers
9 views

Use the “enable” pin on the avoid sensor with PiFaceDigitalIO (Python)?

Im using a Raspberry with a Piface Digital2 and writing the code with Python3, using the PiFaceDigitalIO module. Im having a fully functional avoid sensor so far, but i cant figure out how to use the "...
0
votes
0answers
14 views

LQR Controller in Raspberry Pi C++ [on hold]

I am a newbie in Raspberry Pi and I don't know anything about Ubuntu, or ARM, etc. so please be patient in answering me and please, please guide me step by step. But I know how to run codes in C++ ...
0
votes
1answer
19 views

Using `gpiozero` on `raspberry pi` to control pins, but output pins are reset upon script exit, even though state is remembered between runs

I am using gpiozero to control devices on the Raspberry Pi. When I create a reference to (for example) an LED device, there is a parameter for creating the object without effecting it's current state:...
0
votes
2answers
41 views

Run Python script from HTML input button [closed]

I have some HTML form code: <form action="proses.php" method="post"> Nomor Polisi : <br><input type="text" name="nopol"><br> <input type="submit" id ="submitButton" ...
0
votes
0answers
12 views

Probleme with motion and command (on_envent_start) when deamon on

I'm new on linux and I'm experiencing some issue with motion. I'm trying to execute a simple python script from motion when an event start . So I have in the motion.conf file the line : ...
0
votes
0answers
13 views

Recording Audio from Logitech C110 Webcam Fails [on hold]

I'm working on a security intelligence program using the Pi and a webcam, (the Logitech C110). I tried to run the camera using OpenCV and Python, and at the same time I tried to record the audio, ...
0
votes
2answers
99 views

Installing Python 2.7

I am new to the Raspberry Pi, I have a project. I would like to work on Python 2 not Python 3. By default Python 3 is installed on my Pi. I want to change or remove this version and I want to ...
0
votes
1answer
26 views

Invalid syntax in while loop [on hold]

cat = True while cat = True: print("cat") else: print("Kitten") I tried to run this program but it says invalid syntax for the while loop.I don't know what to do and I can't find the answer ...
0
votes
1answer
13 views

Camera errors when running Python script at boot from rc.local

I have a Python file that calls the camera to take video when a motion sensor is triggered. I am running it at startup using rc.local (I have the '&' at the end). When I run it normally, it works ...
0
votes
2answers
31 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
1answer
36 views

Automatic shortcut execution on boot

I want to achieve following: run my GUI (made in Tkinter interface) application automatically as I boot the RPi (i.e. no desktop screen loading). But I want to be able kill the application so I can ...
0
votes
0answers
39 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
26 views

How can I attach a BTS7960 43A motor controller circuit and control it from a keyboard wirelessly through the Raspberry pi [closed]

I need to attach a BTS7960 43A motor control circuit to the Raspberry Pi. Could anyone please tell me the connections and provide me with a link to a python code to drive motors forward and reverse ...
-2
votes
1answer
36 views

Run a fan 5scs long GPIO

def fan_on(): GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) FAN_PIN = 23 GPIO.setup(FAN_PIN,GPIO.OUT) GPIO.output(FAN_PIN,True) This is my code to run a fan on my rpi via GPIO ...
1
vote
3answers
66 views

Serial to USB, no ttyUSB0

I'm trying to open a Serial communication between a Raspberry Pi 3 (model B, running on Raspbian) and a device (a traffic counter to be precise). I've a USB to Serial cable, using the rs232 standard. ...
0
votes
1answer
43 views

What are some common software design patterns, when it comes to raspberry pi programming? [closed]

I am kind of confused when I see raspberry pi code for reading sensor inputs, opening lights e.t.c. I am not experienced with python, but I would expect that code is much like in ui programming. ...
0
votes
0answers
19 views

fetching images from firebase storage and displaying in Pi 3

I have sent images to firebase storage from web and now i want to read and display images in my Pi using python for further image processing. But i am confused how to do it? Is the google cloud ...
0
votes
0answers
9 views

Can I have Matlab Engine from my host computer to communicate with the Python I'm executing on RasPi?

In short, I need to use my host computer as an API to control the 3 cameras driven by Raspberry Pi. Just basic stuff like when to stop recording and when to start recording. Change video resolution, ...
0
votes
1answer
15 views

PWM and Output Voltages at High[er] Frequencies

I am attempting to set an analog voltage control signal with a Rasberry Pi 3 B+. My Python 3 script uses RPi.GPIO to output PWM across a range of duty cycles to simulate analog output---without the ...
0
votes
0answers
26 views

LCD Pulsing message

I've hooked up a LCD display to a project I'm working on. I have many inputs/outputs and I want to display different messages depending on the state of the inputs. Now before I start to complicate / ...
1
vote
0answers
36 views

How can I pause a video of omxplayer with out using keyboard?

I am working on my project that can display video when a magnet (signal ) is detected using a hall-effect sensor. Then after, if the magnet is removed from the sensor the video has to pause (not to ...
0
votes
0answers
18 views

Building an electronic lock box connected to a Raspberry-Pi+keyboard,

I've been kicking around an xmas idea for my young nieces and nephews. I'd like to connect a small, electronically controlled lock box to a raspberry-pi + small display device + keyboard configuration....
1
vote
1answer
41 views

Install futures for Python 2.7 (pip install futures)

I'm having some problems related to MagicMirror and OpenCV ("No module named builtins"). I think it is because I haven't been able to install futures in the correct version of Python. When I run pip ...
0
votes
0answers
18 views

TK app startup when initial boot

I have two programs I need to start as soon as the windows manager launches but I'm having problems. I added the startup commands to: ~/.config/lxsession/LXDE-pi/autostart /etc/xdg/lxsession/LXDE/...
1
vote
0answers
51 views

How can I pause video of omxplayer using python script?

I am using omxplayer to play videos. The video played very well. But I can't pause the video using the commands below. Can any one help me how to pause my video using python script? Here, is the ...
0
votes
1answer
43 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
24 views

MobileNet classifier (not SSD) with Keras inference time slow on Raspberry Pi

I trained a MobileNet classifier (not an SSD object detector) using Keras with the TensorFlow backend. When I deployed it to my Pi, I was surprised that it takes 20 seconds to make a single inference....
0
votes
0answers
12 views

Sending Sensor readings from Raspberry pi 3 to Android App using wan/localhost connection [closed]

I'm a 5th year Computer Engineering student. We're creating an application that will monitor the position of the baby. We use Raspberry pi 3 because we will also use a Picam. But I already got the ...
0
votes
2answers
54 views

Python script not running on start up

I have edited ~/.config/lxsession/LXDE-pi/autostart using nano (without sudo) to open a lxterminal and run a simple python script that contains an infinite while loop with a print statement. In my ...
1
vote
1answer
68 views

Is it possible to install a higher version of python-numpy than 1.8.2 on a Raspberry Pi Zero?

I successfully installed most of the python data science packages on my RPi Zero using Geoff Boing's excellent guide. However, the versions of some of the packages seem quite old. E.g. numpy....