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

Passing data from output of a function to be used in a function python

I have a few parts of a weather station together and am running into an issue with functions. the humair fuction returns two values hum and airtemp. The problem is when the sendpost function runs it ...
0
votes
1answer
89 views

How to send and read a string from Raspberry pi to Arduino via serial interface?

I was trying to send and receive data between Raspberry pi and Arduino UNO. I'm able to send and receive a string from Arduino to Pi using Serial.println. I spent hours searching a better tutorial or ...
0
votes
1answer
34 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
114 views

Eclipse PyDev remote debugger Raspberry Pi

I have just created a SSH connection between my Raspberry Pi 3 b+ and my computer using WiFi. I have downloaded Eclipse and the PyDev and RSE plugins so I can use Eclipse as IDE for my Python scriptss ...
0
votes
0answers
22 views

Error mounting system-managed device /dev/sdb1

I'm making a zip file with Python, but the process is interrupted. dev/sdb1 is already mounted but this error: Error mounting system-managed device /dev/sdb1: Command-line `mount "/home/pi/hrc2"' ...
0
votes
1answer
65 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:...
1
vote
1answer
256 views

Installing Jasper runs on several errors

I'm trying to install Jasper with this guide. Now i'm hanging with the following problem: i try to use the command sudo apt-get -t experimental install phonetisaurus m2m-aligner mitlm libfst-tools, ...
4
votes
1answer
55 views

How to Monitor GPIO Input Indefinitely Without Recursion

I actually joined StackOverflow to ask this question because I wasn't sure it was RPi specific, but as I was thinking about how to form the question, I realized it might be GPIO specific (for some ...
1
vote
1answer
51 views

False Contact Closures - Do I Need Physical Pull Up Resistors to Resolve?

I'm running Raspbian Jessie 4.9.35-v7+ on a Pi 3 Model B. I cobbled together a basic python script to monitor a GPIO pin and send a network signal to a remote application, made two copies of the ...
1
vote
1answer
46 views

Startup files on raspberry pi 3

I have 4 python scripts running continuously. How I can open them in separate windows on startup? I need see the terminals when it's booting up. I tried rc.local: it's working but I can't see the ...
1
vote
1answer
36 views

a python GUI application to display some measured value (with Raspberry Pi)

I am developing a GUI (with python tkinter) application for a measurement system with Raspberry pi. I made the GUI and the code to do the measurement. But my question is how to link them together. ...
0
votes
2answers
85 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 = ...
1
vote
0answers
22 views

picamera error the second time I run camera.capture(output,'yuv')

I'm getting an error the second time I run camera.capture(output,'yuv'), what am I doing wrong? my code: from time import sleep from picamera import PiCamera from picamera.array import PiYUVArray ...
0
votes
0answers
19 views

is there a way to minimise the effect of the Pi on the Sense HAT's temperature sensor?

Is there a way to minimise the effect of the Pi on the Sense HAT's temperature sensor? I cannot seem to reduce it from mid to high 30s deg. C. Or do I really need a sensor that is external to the ...
0
votes
1answer
29 views

Having a sound clip play and be looped as long as the button is pressed down and stops as soon as it is released

I am able to have the script running when I have the code set to pygame.mixer.music.play but if I do pygame.mixer.music.play(loops=-1) I get an error stating CallbackSetToNone: The ...
0
votes
0answers
111 views

illegal instruction when importing opencv in python 3.5

illegal instruction when importing opencv into python compiled opencv3 for python 3 by using these commands $ cd ~/opencv-3.3.0/ $ mkdir build $ cd build $ cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D ...
0
votes
1answer
91 views

encoding problem: unable to find the match text only during reboot

I have a python file that is running ok if i run it in a terminal in raspberry pi. But if i set it to automatically run after it reboots (using crontab), the file runs ok until it reaches the line ...
8
votes
3answers
33k views

ImportError: No module named RPi

I am trying to run a package on my Raspberry Pi: At the terminal, I typed in “sudo apt-get install picap” followed by enter. I get it installed but cannot execute "picap-setup" – instead an error ...
0
votes
1answer
62 views

How can I get the set attribute of each “device” in an array

What I am wondering is how I can loop through paired_devices and get the "name" attribute for each device. This is only a short amount of the code, if more is needed, feel free to comment below. def ...
4
votes
2answers
2k views

Miniconda for ARMv6 (Zero W)

I want to install miniconda on my Zero W, but it has ARMv6 architecture and that does not seem to be supported by Continuum Analytics. See https://repo.continuum.io/miniconda/ (just one outdated ARMv6 ...
0
votes
0answers
25 views

Input/output error using Python ADS1115, and a Raspberry Pi

I am trying to read an analog signal using ADS1115 and a raspberry pi. Sometimes it reads and some time result into error. Following is the code snippet response = {} adc = Adafruit_ADS1x15.ADS1115(...
0
votes
0answers
25 views

Execute Python-Script on MotionEyeOS

I've recently created a Card with MotionEyeOS for the Raspberry Pi. I've tested motioneyeos already on DietPi and the normal Raspbian, but it didnt worked with the original Raspberry Pi-Camera. In a ...
0
votes
1answer
65 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 ...
2
votes
1answer
782 views

CWiiD doesn't detect wii remote but hcitool and blueman do

I have a raspberry pi 2 model B version 1 running raspbian that I am trying to get a Wii remote to work with. I have an Inateck Bluetooth 4.0 adapter plugged in to it and have CWiiD installed. When I ...
2
votes
0answers
28 views

Safe cut power supply from raspberry

I want to cut safe the power supply from the raspberry with a relay connected to the gpio. I know how to connect to relay to the board but.. When the relay turn off the power line will be cut off to ...
0
votes
1answer
117 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
101 views

How to find available space and free space if low [closed]

I need to programmatically be able to see how much space is left on the SD card and if it is low delete some files. I'm not sure how to go about getting the value of the SD card space and then saving ...
1
vote
1answer
26 views

Pausing code execution till a button is pressed

I'm trying to pause code execution till a button is pressed and this is what I came up with. I have not tested this but can anyone tell me if this is the right way to go about it? Button 'pressed' is ...
2
votes
1answer
1k views

Measure ac power with invasive ct sensor 30A

I am measuring power(watt) with a non invasive sensor SF-SEN-11005 30A. After calibrating on 150 watt it works fine. When I disconnect the sensor I expect a zero value, which is not the case. The ...
1
vote
0answers
14 views

LED Strip on Raspberry Pi Check if its On - Neopixel

How can I check if the one pixel is on or not? Is there any function for that. I've googled but couldn't find anything helpful. import board import neopixel pixels = neopixel.NeoPixel(board.D18, 17) ...
2
votes
3answers
908 views

SPI (file based) from Rasp Pi to Arduino

I am trying to use file-based SPI communication from my Raspberry Pi to an Arduino (328p based). The weird thing is that when I write it out one byte at a time and flush the buffer between each write ...
5
votes
1answer
155 views

Login to Raspberry Pi Via Python Script

I am trying to make a system to login to the Raspberry Pi with an RFID tag. I successfully connected the RFID reader RC522 module to the Raspberry Pi and I can retrieve the number of the tag and write ...
1
vote
1answer
132 views

python pointing to wrong ssl version

For a project i need to be using ssl 1.0.2. For some reason though python seems to be pointing to a wrong version. i have installed pip pyOpenSSL and upgraded libssl-dev and python3-openssl, but ...
1
vote
0answers
16 views

Is raspberry able to retrieve/store some n time prior a trigger with multiple cameras?

I came across a project idea which I think would demand a lot from a raspberry pi and arduino hardware capabilities. From my understanding, a master raspberry could be used to trigger n slaves through ...
-1
votes
1answer
42 views

Newbie python issue

I'm trying to write some code to drive a Sense Hat ' I want to use an LED line to indicate the temperature, then scroll it up over time. The sense.set_pixels function expects a list of 64 RGB lists, ...
3
votes
1answer
294 views

Can the Raspberry Pi 4 better distribute Python scripts to all four cores?

This relates to previous questions regarding the GIL (Global Interpreter Lock) for Python on the Raspberry Pi. My question has to do with the new processor on the Pi 4 - does it still have the same ...
0
votes
0answers
31 views

Sending data between PC and Raspberry Pi

I have been trying to send data from my Windows PC to my Raspberry Pi 3 for a python controlled speaker project. I am using TCP sockets which I don't know much about. Client code (PC): import ...
0
votes
0answers
13 views

If I get Anaconda for Raspbian, how will it affect the existing Python installations?

In Raspian, I got Python 2(IDLE) and Python 3(IDLE) already installed. I'm more used to working with Anaconda with all its included packages. I'm just not clear if I install Anaconda, will I get an ...
1
vote
1answer
275 views

Fade screen on sleep and brighten on wake

I'm looking for a way to control the screen brightness from code. I saw this post but this just turns the screen on and off. How can I dim the screen before it goes to sleep instead of just turning it ...
0
votes
1answer
86 views

Printing Serial Port Not Advancing Line

I have a project in which an Arduino is reading a sensor and printing that value to the serial port. When connected to the serial monitor in the Arduino IDE on my PC, the data is printed flawlessly. ...
1
vote
0answers
23 views

Use OBDII over WiFi

I think i've tried everything at this point, and nothing seems to work. I'm using an ELM327 WiFi Dongle, connected it to the Pi, created a socat using: sudo socat pty,link=/dev/ttyUSB0,waitslave tcp:...
0
votes
2answers
87 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 ...
1
vote
1answer
30 views

Timeout function for user input on 4x4 membrane keypad with pad4pi

I'm making a python script for a 4x4 keypad that's connected to a raspberry pi where the user enters a 4 pin code and the program tells the user whether or not it's correct. In order to take in the ...
0
votes
2answers
677 views

Some Kivy apps not running in Raspberry Pi - Python

Currently I have a Raspberry Pi 1 Rev2 model B and a Raspberry Pi 3, I'm developing an app that could check dynamic values from several screens, I'm using a 7inch LCD Screen to look the graphics ...
0
votes
1answer
99 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 ...
2
votes
1answer
59 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
1answer
137 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
1answer
66 views

Different modules

What are the things to be considered when connecting 3-4 different modules to raspberry pi3? Ex: i am using 4 modules namely RFID reader, hall effect sensor, gps and some push buttons. Need to ...
0
votes
1answer
54 views

Xbee-API python

I'm trying to use my Raspberry Pi B+ as a gateway so others sensors, also with xbee, can send data and get a few kind of commands by it. The problem is that i can only read the data with the simplest ...
0
votes
2answers
59 views

how to identify if ultrasonic pin is removed from circuit using python code

this is the simple code to measure distance using ultrasoinic sensor attached to reapberry-pi and by writing python script-- import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) TRIG = 16 ...