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
4
votes
1answer
823 views

GPIO stuck in High Mode

I'm new to this whole RP world, and I'm trying to learn it. I've been trying to follow this post, and connected my Pi this image below Connection between Pi and Adafruit T-Cobbler Plus Wiring ...
4
votes
1answer
617 views

The following packages have been kept back: mopidy

After performing sudo apt-get update && sudo apt-get upgrade, I got the message The following packages have been kept back: mopidy What I usually do in this case, is sudo apt-get install ...
4
votes
3answers
2k views

How can I add an On-Off switch to my Raspberry Pi 2

I want to add a on/off switch to my pi 2 to correctly shut the pi down This is the switch I want to add: Edit: moved from a link to be included below: This guy in a Raspberry Pi kik group made this ...
4
votes
2answers
10k views

raspberry pi hangs after 2-3 days of continous use

I am using latest the Raspbian Wheezy release with kernel 3.10. I am running four Python programs 24 hours/day on the Raspberry Pi. Three programs out of four are like background services, which ...
4
votes
1answer
13k views

Pi to act as GSM voice phone

I won't know for certain until I've implemented it, but I've marked ppumkin's answer as The Answer. I will have a Huawei 3G (or GSM) dongle attached to my raspberry pi. I haven't purchased it yet, ...
4
votes
2answers
3k views

Record raw PCM from microphone

I have a small project I'm working on that will use real-time audio processing. Until now I've been able to record (via the arecord command) straight to a .wav, but like I said I need real-time ...
4
votes
1answer
811 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 ...
4
votes
1answer
16k views

Raspberry Pi Python 3 multi threading

I am trying to multi thread on a Raspberry Pi using python 3. I have one Pi acting as a server listening for multiple connections from other Pi clients and the server is also connected to relays and ...
4
votes
3answers
10k views

Raspberry Pi 3 not detecting i2c device

I've been following a tutorial to hook up an electronic compass that relays info to the Pi via i2c. The only differences between my equipment and the tutorial's is that I am using a Raspberry Pi 3 ...
4
votes
4answers
5k views

Encrypt specific directory on raspberry pi

After hard searching for a way to protect my python code on raspberry pi from strangers access, finally, I'm convinced with all answers I read "No Way to protect python code". But I still searching ...
4
votes
1answer
3k views

PWM control of motors with PHP front end

I have a dual H bridge connected to my Pi for controlling 2 brushed DC motors with. I intend to have a web interface to control the speed of the motors. I'm thinking of a HTML page submitting AJAX ...
4
votes
2answers
815 views

Python: Is there any way to get a list of IPs connected to a network

Is there any way to get a list of IPs connected to a network? I'm trying to build lots of networking tools so.
4
votes
2answers
19k views

Connecting Raspberry Pi to another device via USB port

I am trying to connect the Raspberry Pi to a microcontroller using the USB Port. I have used the device many times and I know how the protocol works. It should reply after receiving the message that I ...
4
votes
4answers
15k views

How do I download the Python libraries without a direct internet connection on my Pi?

I live in the sticks and don't have a direct internet connection on my Pi. I need to download the Python libraries and move them locally offline. How can I download them from somewhere I do have an ...
4
votes
3answers
7k views

Safely Logging Data on Raspberry Pi

Currently I am reading data from a GPS receiver through USB on a raspberry pi and I would want to log this data on the SD card. I am collecting the data through Python by using file = open("file.txt",...
4
votes
1answer
2k views

Comparison of Python Gui performances

I am building a data visualization application. It is a multithreaded Gui without user interaction. I have 24 widgets that shall be updated any 100ms. 16 widgets are PyCairo rectangles and the other 8 ...
4
votes
1answer
514 views

SMS API via Raspberry PI

I want to calculate the temperature and humidity via sense hat integrated with Raspberry Pi 3. Is there any free API for SMS available currently?
4
votes
1answer
2k views

Apache “404 not found error”

I previously posted a similar question because I used to get a 403 error message (Forbidden). So I decided to get a new micro SD card, and I installed a fresh Apache server then I re-followed this ...
4
votes
1answer
1k views

Getting started with image processing using opencv in windows and using in raspberry pi

I am learning image processing using opencv in windows. In another project that I am working on, requires the image processing to be done in raspberry pi for object recognition. Since I do not own a ...
4
votes
1answer
2k views

Counting Pulse Length Using PiGPIO

Background I am trying to get a particle sensor to work with the Raspberry Pi (model B+). I am using the Shinyei PPD42N6 (datasheet here). The sensor outputs a digital signal with pulses ranging ...
4
votes
1answer
5k views

Piezo with Python

I've found Piezo example for Rpi with specific libraries in Java and C (wiring) -- are there any for Python? I've seen PyPiezo but it seems to be for specific hardware.
4
votes
1answer
3k views

RGB LED is not lighting up

I connected an RGB LED(common anode) via the GPIO, and tried to get it to light up, but for some reason when I run the command, the LED does not light up. Here's the code I'm using import RPi.GPIO as ...
4
votes
2answers
23k views

How do I run a python program as a process in the background?

I have made a little python program that lights up some LEDs to display the current heat of the pi, but I want to run it while I'm doing other stuff. I don't want it to run in a window because I often ...
4
votes
1answer
12k views

SimpleCV installation on Raspberry Pi

I want to install SimpleCV, a Python framework for computer vision, on my Raspberry Pi. These are the steps I followed: Step 1 - install dependencies sudo apt-get install python-opencv python-scipy ...
4
votes
3answers
502 views

Python script run from crontab does not recognize USB drive mounted later

I am having a bit of a problem here, I really hope some of you can point me in the right direction: I made a python3 program running a loop and checking if the file /DATALOGGER/DATALOGUSB/SETUP.py ...
4
votes
1answer
1k views

PyCharm 2017.3.3 hangs

There is PyCharm, an IDE for programming Python. It's available in a Community edition for Linux as well. The problem affects (at least) version 2017.3.3. I installed it as a normal user with wget ...
4
votes
2answers
4k views

Why can't I return value from python script to PHP script when trying to use GPIO

I have spent two days on this and have tried nearly everything I could find. I am using an apache server (2.4.10). I have two files in a folder called testPythonPHP that is located in the root ...
4
votes
1answer
2k views

Trouble using spidev after RPi.GPIO

I'm using a Pi 3B to interface with an SPI device. My program is written in Python 2, the Pi is the SPI master and the external device is the slave. I am using both the spidev module and the RPi.GPIO ...
4
votes
1answer
2k views

Serial connection Arduino - Pi

I am having an Arduino Nano sending "48" or "49" via a serial connection to a Pi. I'd like to use this input, but for some reason the connection always cuts out after a few seconds with the following ...
4
votes
3answers
6k views

Automatically start python program at start-up

I am working on a project that needs a special GUI that takes up the full screen. I know I can make the X-Window system start up on boot (using raspi-config then changing the setting) but is it ...
4
votes
1answer
836 views

My PIR sensor seems alittle keen to sense things

Before you tell me answers for my issue already exist I'd like to mention that I have checked previous answers and where similar issues have occurred I have tried to use their approved answer. So far ...
4
votes
1answer
3k views

How do I install Tensorflow Lite on Raspbian Stretch?

Thanks for your help. I want to deploy a tensorflow neural network to a Raspberry Pi 3 B+ with the Raspbian Stretch OS, and I'd like to know the best way to install Tensorflow Lite (or Tensorflow ...
4
votes
3answers
806 views

Occasionally get “Register read error: 0xee06” when script is run with Adafruit BNO055

I'm running scripts on a Raspberry Pi 3 hooked up to an Adafruit BNO055 sensor, and occasionally when I run the test script I get this error: Traceback (most recent call last): File "...
4
votes
2answers
716 views

Thermostat for greenhouse

I want to prepare a homemade thermostat for my greenhouse project. I have enough knowledge about electronics and linux based embedded systems but I'm not skilled enough in programming, so let me ...
4
votes
1answer
441 views

getting two camera preview with raspberry pi compute module

You know raspberry pi compute module has two CSI camera inputs. I can connect two camera and activate both of them. I have a project with raspberry pi that I need to preview from both camera ...
4
votes
1answer
593 views

Picamera record video in one resolution and take stills in three other resolutions

I looked into the documentation of the picamera and wondered whether there would be a way to use the splitter option to have the picamera capture a video in 640x480 and asynchronously capture stills ...
4
votes
1answer
9k views

Python 3.6 on Rpi3 Raspbian isn't default after install

On a fresh install of Raspbian Jessie+PIXEL (1/11/17 release), I installed from the source Python 3.6.0. I downloaded the tgz file from Python.org and built from source. I used a couple of sources ...
4
votes
2answers
910 views

Can no longer send emails with Python

I was having issues with the Pi so I put a new image of Jessie on it. I reloaded a python script that has been running for a year and a half that sends a email. Now when it tries to send the email I ...
4
votes
1answer
832 views

PWM dc motor using L293D weak sound

This is the problem: using this tutorial and Adafruit_Python_GPIO libs when start pwm and step up with DutyCycle and frequency I hear a weak sound from motor but unfortunely it doesn't move. Wiring ...
4
votes
1answer
551 views

Autorun Python script with shell

Having an issue when running a particular script automatically. It requires root permission, uses bluetooth, and prints in a Python Shell. What I did: sudo nano /etc/xdg/lxsession/LXDE-pi add @...
4
votes
5answers
15k views

How do I start two different Python scripts with rc.local?

I have two different Python scripts I'd like to run at start-up on my Raspberry Pi A+. Both work perfectly if I run them via sudo python filename.py. I can get the first one to run, but not the second ...
4
votes
1answer
479 views

Why is everything a background process?

I am new to RaspberryPi, I am using RaspberryPi 2 with windows 10 core, using visual studio 15 community for development. Under C# code template and python code template why is everything a background ...
4
votes
1answer
325 views

Pi Glow programming on python

After following the steps on this page. I did everything correctly and when I try to run the test.py file it says this. Traceback (most recent call last) : File "test.py" , line 9, in <module&...
4
votes
3answers
14k views

I can't download PyCharm for Raspberry Pi 3

I have had my raspberry Pi 3b for a few months so I'm just getting used to it. I would however want to install PyCharm because I want to use my Pi to program on rather than my PC. Any ideas would be ...
4
votes
1answer
356 views

How to make sense of this Raspberry Pi project guide for building a theremin?

I have just started out using a Raspberry Pi, and for my first project, I wanted to build a pseudo theremin using an ultrasonic motion detector and other electronic components (requirements are laid ...
4
votes
0answers
771 views

/sys/class/gpio values only working if python gpio script was used before [closed]

i have a problem with the gpio sysfs files. when i use cat to get the values of a gpio pin it will always show 0. but after using a python script ( https://github.com/elParaguayo/RPI-Info-Screen/blob/...
4
votes
4answers
3k views

Speech Recognition

I'm making a project that requires the user to control the computer through speech. I've seen a couple of libraries, for python, that can do this but most of the ones that I have seen are windows only....
3
votes
4answers
1k views

Raspberry Pi run commands on boot

I thought that running commands on raspberry pi on boot was the easiest thing in my project. But it seems that it is complex enough not to work. I've searched a lot on the internet on a simple ...
3
votes
3answers
29k views

I changed my Raspberry Pi default keyboard settings. How can I reset this change?

I changed my Raspberry Pi keyboard (using command the sudo nano /etc/default/keyboardp). I set: XKBLAYOUT = 'in' Now, after reboot I just can't login! Can I somehow reset this CHANGE?
3
votes
2answers
11k views

Can't install Flask-Bcrypt: `libffi` is missing

I try to install Flask-Bcrypt on Raspbian to hash passwords in my Flask application, but I get this error: Searching for flask-bcrypt Best match: Flask-Bcrypt 0.7.1 Flask-Bcrypt 0.7.1 is already the ...

1
3 4
5
6 7
58