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
75 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 ...
2
votes
0answers
22 views

Adafruit OLED (128x64) display very dimmed?

I bought the Adafruit 128x64 OLED Bonnet and tested it with the demo program. Unfortunately the luminosity is very low and it is not satisfying: I have tried to adjust the contrast from 0 to 255 but ...
0
votes
1answer
73 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
830 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 ...
28
votes
3answers
8k views

How can I use the GPIO pins as digital outputs?

I've read that the Raspberry Pi has a number of input and output pins. How can I switch them? (from Python?) What voltage logic? Do I need pull-up or pull-down resistors? Do I need to switch the pins ...
0
votes
1answer
226 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
0answers
119 views

Read data from RPLidar and getting “Wrong body size”

I'm trying to read response from a Slamtech RPLidar connected to my Raspberry PI 3 via USB and I'm getting the following error: Traceback (most recent call last): File "app.py", line 70, in main ...
1
vote
1answer
187 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
1answer
142 views

Selenium won't run on my raspberry pi 3 Model B+

Today I recieved my Raspberry pi 3 Model B+. I downloaded NOOBS and installed it on my raspberry pi. However, I cannot run a selenium browser on it. I have tried to install iceweasel but it says that ...
1
vote
1answer
345 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
120 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
26 views

Setting application screen display layer

I am displaying a video onscreen with omxplayer using '--l 0' Is it possible to run a python program and set it's screen layer to > 0 Expanded info :- I am running omxplayer from within a python ...
0
votes
2answers
96 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 ...
2
votes
2answers
51 views

LIRC could not connect to socket

After installing on Raspberry lirc-0.10.1 according to this instruction (Setup IR Remote Control Using LIRC for the Raspberry PI (RPi)), when you try to send data from any config file, the irsend -d /...
0
votes
2answers
761 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 ...
6
votes
2answers
2k views

Impossible to scan RFID tags using libnfc, PN532, and RPi3

I recently bought this NFC/RFID reader PN532 module V3 I want to use it with my raspberry pi 3. I have install and configured the library libnfc. The PN532 is connected with I2C. I have well enabled ...
0
votes
1answer
173 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
1answer
271 views

Run chromium with kiosk with auto-refreshing webpage (Spotify Jukebox)

I know I can run Chromium full screen based off of this tutorial, in kiosk mode, but I'm wondering what would I need to do to set up my pi up so that instead of just running one webpage on startup, it ...
2
votes
1answer
65 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
198 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
2answers
209 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 ...
1
vote
1answer
18 views

Installing netcdf4 on raspberry 3b+

I am trying to install NetCDF4 on Rp 3B+. This is the command I used: sudo pip3 install netcdf4 But the error message is: Collecting netcdf4 Using cached https://files.pythonhosted.org/packages/...
1
vote
2answers
46 views

Callback parameters to GPIO.add_event_detect?

I have a button object that when pressed needs to perform something, and for this I'd need to get a property of the button. I'd like it to work like: ... GPIO.add_event_detect(button, GPIO.RISING, ...
0
votes
1answer
61 views

Raspberrypi unable to read 2000 ppm encoder

I am using a DC motor attached with a 2000 ppm incremental encoder. I am using RPI to count the number of ticks, my code works fine but I am not able to calculate all the 2000 ticks. Any help would be ...
0
votes
1answer
71 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
2answers
144 views

File transfer between raspberry pis via GPIO pins

I'm trying to send image(3MB) captured by one pi to another pi, external WIFI or setting up one pi as AP is not possible due to strict regulations, all I can use are the two wires. Currently I'm ...
0
votes
1answer
256 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
63 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 ...
2
votes
1answer
82 views

Rpi3B+ and Audio Amplifier HAT GPIO Pin Push Button False Detection/Triggering Problem

I'm currently having trouble with my project. I'm using a Raspberry Pi 3B+ with an InnoMaker Hifi Amp Hat and some push buttons. import time import signal import os import RPi.GPIO as GPIO GPIO....
0
votes
1answer
60 views

Problem with i2c communication between arduino and raspberrypi

I have connected Rpi with Arduino using i2c communication. Pin Configuration: Rpi ---- Arduino Mega SDA SDA SCL SCL GND GND I also have an encoder attached to Rpi. Encoder `------ Rpi 5V 5V Gnd Gnd ...
0
votes
2answers
861 views

How to install Numpy in Anaconda on Raspberry Pi 3B with Raspbian Stretch OS?

My goal is to use Numpy inside of Anaconda on the Raspberry Pi 3B. I downloaded Anaconda by following the instructions: https://stackoverflow.com/questions/49170125/cannot-install-anaconda-in-...
1
vote
1answer
3k views

Alsa lib error pyaudio on raspberry pi 3

I'm getting these ALSA lib errors when trying to use pyaudio. I know my mic works as I can live stream audio through gstreamer. Can anybody explain to me why i'm getting these issues: ALSA lib ...
1
vote
1answer
92 views

Cannot Load Library “./pxcore.so” to autorun a python script on boot using systemd

I want to run a code at startup but I am getting this error below. The script works when running in python, but I am unsure how to allocate permissions or where to make a path to the pxcore.so file so ...
0
votes
0answers
20 views

bind event from evdev to GUI wxpython

I have buttons and joystick as in the image below and I am reading events from these inputs on raspbian with the evdev library, I am also running a GUI using wxpython. My question is how can I bind ...
0
votes
2answers
255 views

Python on raspberry pi with proxy

I can config my Pi3 to connect to internet via proxy settings but I can not connect my python script to internet with socket lib Return result always fail Is there any lib can support this ? Note: I ...
4
votes
2answers
8k views

How to Connect 6 ultrasonic sensors to a raspberry pi?

I need to connect 6 ultrasonic sensors to one raspberry pi and all six sensors should take the distance measurement same time. I have written the code and made the thread also but only two sensors ...
1
vote
1answer
651 views

Why is PIR motion Sensor always on?

I'm trying to make an alarm system but the motion sensor is always on as soon as the script is run. I've posted a question about a different problem i was having with this project so it'll confusing ...
4
votes
5answers
17k views

gpio library on windows while developing

I am new to Python so maybe this is not an appropriate question. I am working on a project on Python that will use GPIO functionalities of the raspberry Pi. Right now, I am developing the python code ...
-2
votes
0answers
32 views

Refresh Tkinter GUI

I'm using tkinter and trying to make a gui that will display data and refresh, however the master.after function is not working as intended. Wondering if anyone can tell me why. My goal is to have the ...
0
votes
1answer
121 views

Problem with LED blink program on Pi

I am completely new to RPi and stuck unexpectedly. I am trying to create a simple python program to make my LED blink. Here are the two programs which are giving same outputs on terminal when I ...
-1
votes
0answers
43 views

speedtest-cli: download speed 0 Mbit/s

I used a small python script to monitor download speeds at different times. I deactivated it for some weeks and wanted to start again today. Before I run my script I wanted to test if everything is ...
-1
votes
1answer
142 views

Piezo sensor to pick up acoustic instrument signal using Rpi and ADC

I want to read analog inputs from piezo sensors like these on Raspberry using python, which ADC do you advise me with 8 or more channels and how to wire and program it to get digital values?
0
votes
1answer
91 views

Piface Digital Master and PiFace Relay Plus Slave

I wish to control four state reconfigurable antennas in a propagation measurements using RPis at both ends of the propagation channel. The headless master RPi has a PiFace digital to control the start ...
2
votes
1answer
220 views

Barcodes: Problem with OpenCV

I'm an absolute beginner with Python, but unfortunately I have to reach in a RPI project within 20 days. My task is to build a Barcode-Scanner. This is the code I want to use: github: loleg/iotcam.py,...
0
votes
1answer
431 views

Lego EV3 infrared sensor to raspberry pi 3 direct connection via UART?

I connected this sensor with raspberry via UART( I have found that this IR sensor is one of few Lego sensors that connects via UART), and make serial_read and serial_write python scripts, just to test ...
0
votes
0answers
10 views

Pi Camera v2 Capture Photo without warm-up

I want to a project that capture some photos at a time. After taking photos i will send theese pictures to a windows platform to encoding. I saw so many examples about taking photos but i every code ...
-1
votes
1answer
49 views

Stepper motor vibrates, does not turn

I´m working on a simple project for school now and I have to use a stepper motor, but it doesn´t turn. The LEDs go on, the motor gets hot and the motor vibrates. When I adjust the sleep/function, the ...
1
vote
1answer
537 views

Running a Python Telegram bot at startup and 24/7

I would like to use my Raspberrry Pi (Raspbian Stretch) for running a Telegram bot. I already wrote the script and it works perfectly, when run in the 'Thonny Python IDE', because there it doesn't ...
24
votes
2answers
40k views

How to get Python to work with Lighttpd?

I've got Lighttpd setup on my Raspberry Pi, but I'd like to get server-side code working now. I'm familiar with PHP, but I figure I should try Python as it's supposed to be the "go to" language for ...
0
votes
1answer
97 views

Error With Taking Time Lapse Photos

I'm trying to take a time lapse using my pi camera but whenever I try and run the code using python the following error pops up: mmal: mmal_vc_component_create: failed to create component 'vc.ril....