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
92 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
115 views

USB RS232 turn on/off beamer

I'm streaming a video to a beamer. But I want it too turn it off after office hours. I found /opt/vc/bin/tvservice -o and /opt/vc/bin/tvservice -p to turn off the screen. But that does not turn off ...
0
votes
1answer
28 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
1k views

python error: “ImportError: No module named encodings”

I'm in a bit of a python death spiral, here, with the "ImportError: No module named encodings" error when I try using python. I've read a dozen or so different posts on the problem, and none of them ...
1
vote
1answer
33 views

YA Cron Question

I have a python script called mediacircus.py that works when run manually (using Idle) in /home/pi. I have a Cron schedule to run it every minute that looks like this: * * * * * /usr/bin/python /home/...
0
votes
0answers
38 views

listen for sensor continuously when using django as a server

I have developed a smart bulb using relay to switch the bulb on and off when I clap. This works with a simple python script but that i want to use django as a server for handling this use case. I ...
0
votes
0answers
40 views

Is full FOV in rpi-cam V2 possible at 640x480 @60fps?

I have a video recording system developed using RPi 2 Model B and Cam v1 and plan upgrading to RPi 3 Model B and Cam v2. My application is such that I need higher frame-rates (60fps +) at Full FoV, ...
0
votes
1answer
35 views

small sound sensor not detected

The usecase of my project is when I hear the sound of clap then only the relay channel should get triggered. But in my case, the GPIO.input(SOUND_INPUT_PIN) is only giving me value 1(HIGH). The ...
0
votes
1answer
38 views

Help in understanding how to use Raspberry Pi's “official” 7 in. LCD from Python script [closed]

Let's say I have a Python script that receives an IR signal and lights up an LED. We'll call it a "hit" indicator. In the IR transmission, let's say a person's name was embedded in the signal. How ...
0
votes
0answers
50 views

downloading google sheet as csv using python script on raspberry pi

Tried the script from this tutorial. I was able to successfully do his other tutorial on listing(printing) files in google drive by a python script but not this one. So I think I'm getting ...
0
votes
1answer
65 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 ...
2
votes
2answers
569 views

How did I launch this Python script at boot?

I have a Python script running at boot, on a Raspberry Pi, and of course I didn't write down how I set it up. Now I need to change it, and I can't for the life of me figure out how it's getting ...
0
votes
2answers
225 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 ...
1
vote
1answer
43 views

GPIO Pins Stay Active

On my Raspberry Pi B+ I have a standard program to blink a LED. I run it using the terminal command python blinky.py, and when I do, the LED lights up, but does not blink, as it should. I then cancel ...
2
votes
3answers
1k views

Reinstalling Python3

I purged all the python3 packages and when I try to install python3 again on my raspbian I get this: Setting up python3.5-minimal (3.5.3-1) ... # Empty sitecustomize.py to avoid a dangling symlink ...
-1
votes
1answer
32 views

Python script not accepting import function

I've been writing a simple python script, and I import the GPIO library, and the time library. I have the following code. print()'Importing GPIO library' import RPi.GPIO as GPIO print()"Importing ...
0
votes
1answer
35 views

Unable to SSH after modifying /etc/rc.local

I am attempting to have a program load on boot and have successfully achieved my desired function by modifying the /etc/rc.local file and adding the following line - (sleep 15; python /home/pi/...
0
votes
1answer
47 views

Service won't run python srcipt with privileges RASPBIAN JEESIE

I have script in python that need to be run with "sudo" keyword. Everything because I'm accessing "/dev/mem". Now I need to start this python script on RPi startup. So I create simple service that ...
0
votes
2answers
479 views

Python pigpio 'no permission to update GPIO'

I am trying to run the following code on my Raspberry: import pigpio import fileinput pi = pigpio.pi() ### Define constants pwm_range = 255 pwm_clock_div = 8 left_motor_dir_pin = 35 ...
0
votes
1answer
99 views

VNC: how to manage a fleet of RPi?

I've to manage 50 Raspberry Pis remotely, e.g. via VNC over the web. The RPis are behind a router, so I can't access them by IP. I'm looking for something like a self-hosted TeamViewer. The desired ...
1
vote
2answers
97 views

Raspberry Pi DC Motor Not Working

So, I am attempting to control a DC motor using a RPi Model 2B. I am using a l293d motor driver to try to control the motor and a 4 AA battery holder. The diagram is supposed to look like this ...
1
vote
1answer
165 views

SPI only returning zeros with Raspbian (It works with IoT core)

I am using this ADC connected to the channel 0 of my Pi3 board for reading values from a sensor. In IoT core, I was using a very simple code for testing the my device, and it worked fine. The C# code ...
0
votes
0answers
24 views

How to create installer files in Raspberry pi

I have created a program in Raspberry pi and I am running it using the command python myprogram.py . Is it possible to create the installer file of this program? that means after installing this ...
0
votes
0answers
100 views

RFM69 Radio Transceiver: Arduino is not registering acknowledgement for transmission sent by Raspberry Pi

I am building a system in which an Arduino Uno with an RFM69 radio chip transmits data to a Raspberry Pi running a script in Python. I am using the RFM69 library for both scripts: Arduino: https:/...
0
votes
0answers
136 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 ...
1
vote
2answers
126 views

Can't blink a LED using SPI interface on Raspberry Pi v3

As a part of my PoC project, I'm using single 5050 LED made by Adafruit. I wired it like this (LED - RPi): DI (Data Input) - SPI0 MOSI CI (Clock Input) - SPI0 SCLK GND (Ground) - GND VCC (5V) - 5V ...
0
votes
0answers
1k 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 ...
1
vote
0answers
60 views

Send data BMP180 between client and server trought module socket

I would like to send data of BMP180 sensor between a client and a server with two raspberry pi 3 being that the client when executing the command get the server will give the temperature value to the ...
0
votes
0answers
44 views

Any way to keep mplayer window open

I am making a project in which my device is receiving a video URL, which plays the video using Mplayer. Once the video is played completely, Mplayer window closes. Is there any way to keep the window ...
0
votes
0answers
104 views

No reading for the LDR using MCP3008 with SPI on raspberry pi in python 3

I'm a beginner to RPi and trying to learn how to use SPI & MCP3008 to read analog signal in Python3. The output displays 0.0V all the times despite the change in the light intensity. Light: 0 (0....
0
votes
0answers
101 views

python: bluetootherror: (111, 'connection refused')

There seems to be a problem with connecting the Arduino + HC-05 to the raspberry pi 3 Here is my code from bluetooth import * import threading import bluetooth from pprint import pprint host = '98:...
0
votes
1answer
182 views

Get measured value of gpio vibration sensor (SW420)

I've managed to connect 2 SW420 vibration sensors to my rpi3 and can identify a vibration event on callback. However, I'd like to get the measured value (voltage change?) from the sensors, to see ...
1
vote
0answers
103 views

Permission Denied as root when connecting BluetoothSocket with Bluez 5.43

I've been trying to get bluetooth working on my Raspberry Pi 1 Model B+ running Raspbian Stretch Lite 4.14 with a 3rd party USB bluetooth dongle. I installed Bluez 5.43 for python 2.7, and was able ...
2
votes
1answer
254 views

Python 3 interpreter not recognizing a new installed package(python 3.5.3)

I'm new to this RPI world and also to python although I completed the basic courses I'm still getting used to this so I will appreciate your patience I'll try to express my self the best way. I ...
0
votes
2answers
31 views

What does setmode, setup, output and cleanup do in the RPi.GPIO library?

I have been working on a project and everything is working. I just want a bit more insight on what every line of code does. It's one thing to write it, it's completely different to understand it. ...
0
votes
1answer
65 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
167 views

What causes this (strange?) CPU usage on Raspberry Pi 3?

I am running two python scripts from two different terminals like so: python3 one.py and python3 two.py one.py Waits for an input on GPIO 27, and then starts counting in seconds how long the ...
0
votes
0answers
42 views

Execute “render_template” and keep while loop checking if button was pressed?

I manage to read the button, but my render_template is never executed as the while look is checking the button. How can I solve that problem? @app.route("/") def main(): # For each pin, read the ...
1
vote
1answer
525 views

turn screen on and off with motion sensor

I'm working on a project which will use a PIR motion sensor to turn on a connected HDMI monitor when there's someone in the room, and turn it off when they leave. I'm new to Linux, but not to Python. ...
0
votes
1answer
82 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 ...
0
votes
2answers
205 views

Transfer files from Raspberry Pi Zero W to PC over USB

I would like to transfer files from Raspberry Pi Zero W to PC over USB interface. Is it possible? My idea is to first use Pi Zero standalone to run an application, which generates some files on the ...
0
votes
1answer
55 views

Cron Job turns off the matrix MAX7219 after finishing the script

I have a script in python3 which executes and shows information in an 8x8 MAX7219 matrix and works perfectly. When I run the script directly from the .py file, the matrix does not turn off (and that's ...
0
votes
0answers
27 views

printing info from weather utility [duplicate]

I've download the weather-util on raspberry pi. Is there a way to print the info from a python script? Say you want the weather info for jfk, so the command is weather jfk.
0
votes
0answers
86 views

Unable to install vim plugin in Paspberry Pi

I am trying to install plugin for python in vim, but I am unable to do that. I removed vi tiny from Raspberry Pi and installed vi 8.0 I followed the instructions from this site: VIM and Python – A ...
2
votes
1answer
46 views

fork() Process Issue on Channel Switching via Rotary Encoder

I have KY040 rotary switcher(encoder) as shown below picture. It is the scenario that there are 5 radio stations(simple html url) in urls.txt which are read into stations list in radyoCS.py, at every ...
0
votes
0answers
25 views

Rpi -3 fail to run `esptool`

In order to communicate with ESP32 to run miropython code, I needed to install esptool on my RPI ( done successfully )- using this guide . When executing, I got an error message that it doesnot exit- ...
0
votes
1answer
84 views

Besides WebIOPi, what can I use to control the GPIO's(http.server library,Flask PHP)?

I used WebIOPi to test (and debugging) the RPi ports, it is easy and hepful. But now I want to create a webpage (as I can use html/css e create a nice modern interface). I don't know how to use ...
0
votes
3answers
45 views

Raspberry Pi 3 breadboard momentary switch not being recognized (using breakout T Cobbler)

Here is an image of what I've been trying to achieve, which is that when the momentary switch is being pressed, it'll print out "Button Pressed" in Python using a little script. The problem is that ...
0
votes
1answer
17 views

At what instances do we use the Board mode and BCN mode in Raspberry Pi?

I know about the two modes of working in Pi using python, Board and BCN. However, I am really confused as to the instances or situations where I should use them. An example demonstrating their use ...
0
votes
2answers
30 views

Unable to detect the button press

I am trying to execute the code where the LED will be blinking until the button is pressed. Once the button is pressed, the LED should be 'On' without blinking. The issue is that the LED keeps ...