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
0answers
33 views

Can't send UDP packets

I am trying to send a 4-digit number, that is a result of two HC-SR04 sensors'measured distance, through UDP and according to almost every command and wireshark on my computer, the Raspberry isn't ...
1
vote
0answers
13 views

Launch a python script in a lxterminal window using supervisord

I'm trying to launch a python script in a lxterminal window using supervisord. I'm stuck on using supervisord than a .desktop file. I'd like to keep the process running on loop Below is my config: [...
-1
votes
1answer
44 views

Creating a Day Counter

Does any one know the best way for me to make my PI count the days since an action was performed and display the value every day, I basically want my pi display to tell me how many days have passed ...
0
votes
1answer
125 views

Run a python script when start up and SSH not log in

I am new to programming and doing a simple academic project with Raspberry Pi, I have a script which will monitor the changes of database and output the change with 2 different color LED. I want it ...
2
votes
3answers
390 views

Connecting multiple load cells Pi Zero W to read individual values

I have a project in mind where I want to measure the weight and position of an item on a shelf. The idea was to mount the shelf on a load cell in each end and then get the weight and ratio between ...
2
votes
2answers
5k views

Problems installing lxml

I'm trying to install lxml (I need version 3.3.4) but when I try to pip install --upgrade lxml I keep getting build errors: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-...
0
votes
1answer
215 views

running python script as service and calling functions from another program

I have a python script to control some LEDS. In a compiled c++ program I have been calling python scripts like so in various places: system("python /home/pi/leds_flash.py") system("python /home/pi/...
0
votes
1answer
203 views

Can´t run 192.168.45.34/cgi-bin/script.py from another pc

I can run my python script locally from console terminal, but when I try to run it from another pc I get Internal Server Error-500, This is the script I tried to use os, commands and subprocess and ...
4
votes
1answer
265 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 ...
0
votes
0answers
17 views

How to send data across usb0 to use in pygame?

So i have a pi3b+ and a zero hooked up to a tft ili9341 display. I can run pygame on boot and it works fine. I have also started using python sockets and successfully sent data (my wlan0 ip) from my ...
0
votes
2answers
2k views

Raspberry Streaming using VLC picamera python

I am trying to stream Raspberry Pi camera video using VLC. The code is as follows: import subprocess import picamera camera = picamera.PiCamera() camera.resolution = (640,480) cmdline = ['cvlc','-vvv'...
0
votes
1answer
243 views

camer.start_preview() not working?

When I run my python script the contains: import picamera from time import sleep camera = picamera.PiCamera() camera.start_preview() sleep(10) camera.stop_preview() The script just runs and shows no ...
0
votes
1answer
30 views

L298N H-Bridge motor control code issue

I am learning how to build a basic robot using a raspberry pi and an L298N h-bridge. I have followed this tutorial successfully i:e the single DC motor I have connected does work in response to the ...
1
vote
1answer
222 views

reverse-geocoder on Raspberry Pi

In a project I am currently working on, I use Python to display my current location, speed, etc. I now wanted to implement the reverse_geocoder library (https://github.com/thampiman/reverse-geocoder) ...
1
vote
1answer
75 views

Why is SPI not working on any of my Raspis?

I tried it on both Raspi 3 and 2 using the SpiDev python library. I've never even seen any kind of output on MOSI or CS lines with my oscilloscope. Controlling an SH1106 OLED display via the luma....
1
vote
2answers
280 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 ...
1
vote
1answer
96 views

How to install PyCharm on Ubuntu Mate (Raspberry Pi3)?

I'm trying to install PyCharm on my Raspberry Pi running Ubuntu Mate. But I don't understand the error message I get. First I followed this tutorial : https://linuxize.com/post/how-to-install-pycharm-...
0
votes
1answer
171 views

GPIO modes without breaking serial

I am using and Adafruit BNO055 IMU and using their provided modules to read the data, i have been able to do so. However i want to be able to turn some of the GPIO pins to high as i want to control ...
0
votes
1answer
246 views

Text overlay over video stream when saving to file system

I'am using raspberry pi zero as controller which communicate over UART with external board with five sensors. What I need is a way to save video stream from raspicam to filesystem with embedded text (...
0
votes
1answer
256 views

How can I stop this script (date an time with I2C LCD)

I found this script to show date an time on this site: http://www.circuitbasics.com/raspberry-pi-i2c-lcd-set-up-and-programming/ Once is running how can be it stoped? I like the idea of showing the ...
1
vote
3answers
2k 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
2answers
672 views

How do I Install Kivy for python 3.4 on my raspberry? Is that possible?

The question is on the title XD How do I Install Kivy for python 3.4 on my raspberry? Is that possible? I tried using the https://kivy.org/docs/installation/installation-rpi.html guide but thats only ...
0
votes
1answer
263 views

feh can't display image

I have written a python script that displays the image from the URL. def image_func(link_image): img_cmd = "feh -F %s" %(link_image) os.system(img_cmd) os.system("pkill feh") If I ...
2
votes
1answer
195 views

Stepper Motor Not Responding. Wiring Issue?

I am following the tutorial: But I am using a pi t-cobbler and a Pi 2. I am also using the ULN2803 driver. When plugging a button into the appropriate gpio spots on the breadboard, I am able to run a ...
1
vote
1answer
69 views

apt-get python error ImportError No module named io

I can no longer install or remove any software using apt-get. When I try I get the error: Could not find platform independent libraries <prefix> Consider setting $PYTHONHOME to <prefix>[:...
-1
votes
1answer
359 views

Use Pi 3 With Waveshare 3.5" and MFRC522

This message showed up when I was using MFRC522 along with Waveshare LCD 3.5"(A) on Raspberry Pi 3: python Read.py can't open device: No such file or directory Aborted I think it's because SPI is ...
0
votes
0answers
26 views

Python program crashed on RPI compute. syslog contains message “INFO: task python3:724 blocked for more than 120 seconds.”

I am working on a project with a PI compute module set up on a custom PCB. The project has to reliably run ideally indefinitely while logging sensor data and writing video and audio to a usb when the ...
2
votes
1answer
237 views

Button isn't triggering in python script

Software guy here, first time doing hardware. Here is my breadboard setup (yellow is GPIO-8, green is ground): Here is my Python: import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO....
1
vote
0answers
13 views

PICamera white balance difference between preview and capture

Below is a screen shot of the preview and the captured image of the same scene taken from a single PICamera at the same time. As you can see the one on the left (the capture) is noticeably bluer than ...
1
vote
1answer
44 views

PIGPIO bit banging UART - SLR to plaintext

I've managed to read UART input by SLRO and SLR commands from pgpiod, however, SLR returns UART bit-banged data in the following format: [number of read bytes] [bytes] http://abyz.me.uk/rpi/pigpio/...
0
votes
1answer
291 views

How to save images taken from dslr into the raspberry pi's sd card

I'm working on a project which I need to take images automatically from a DSLR camera and should save it in the raspberry pi's SD card. There was a tutorial it shows how to save the image into sd ...
2
votes
1answer
298 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
19 views

RPlidar could not be launch

I am now doing a project using RPLidar in ubuntu 16.04. However, I am facing some problem with running the RPLidar. I have checked that my userid is inside the dialout group. The below code is what I ...
3
votes
2answers
6k views

PIL.Image from picamera.capture()

I want to get an image from the pi camera module and use the pillow imaging library to modify the image. The way I have been doing it up to now is to take a picture with the camera and then open that ...
1
vote
0answers
28 views

efficiency of python sleep function to set a raspi pin HIGH and pause the script

I am continuously measuring some parameters using Raspberry Pi. I am using Python. When the measured value is higher than a particular value, I want to set a GPIO pin high (for some LED indicator) and ...
0
votes
1answer
298 views

Tkinter application window in front of Chromium in Kiosk mode

On my Raspberry Pi I have created a tkinter application with one button and configured Chromium to start in kiosk mode. In my python application I set the following: root.lift() root.wm_attributes("...
0
votes
1answer
38 views

measuring phase difference in 3 phase power

For my ceramics oven I had 3 phase power installed. But power consumption according to the meter is way higher than the nominal 7KW the oven consumes. A friend told me that if the phase (or sinus) is ...
0
votes
1answer
52 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
0answers
16 views

How to prevent the automatic execution of script in IDLE?

I have a python script which I can work on with nano and start without problems via SSH. Opening the with IDLE in the GUI on the raspberry opens a terminal prompt and the script is executed after a ...
1
vote
1answer
274 views

Parallax RFID Serial Not reading tags

I am a complete newbie with Raspberry Pi and any type of hardware prototyping. I have been trying to get a Parallax RFID working with my Pi 3. I currently have it wired to the GPIO using BCM and the ...
1
vote
1answer
75 views

Reading Temp/Pressure with a single Raspberry Pi

I would like to be able to read values of two thermal couples and a pressure gauge using my raspberry pi. Recording the data and then sending it to a server at the end of the day. I am using dual t/...
0
votes
1answer
331 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 ...
0
votes
1answer
247 views

Pi Camera recording function needs to loop each hour

I have made good use of this forum over the past year as I have been creating a birdbox with camera for my mother. Until now I have been able to find an answer to all of my questions but this time I ...
0
votes
2answers
389 views

Cannot connect to USB GSM Modem using Python

I am having trouble connecting to a 3G usb modem using python. when I try, in python interpreter: import serial ser = serial.Serial("/dev/ttyUSB1", timeout=2) I get: Traceback (most recent call ...
0
votes
1answer
144 views

Raspberry Pi error when connecting to Firebase

When I tried from firebase import firebase running in the Python 3 (IDLE) and Thonny Python IDE, it gives an error likes this at the first line: Traceback (most recent call last): File "/home/pi/...
0
votes
2answers
2k views

cannot import name picamera

I bought raspberry pi camera and it works, but when i use python to use the camera return Error: cannot import name picamera. I have install python3-picamera.and this is python programming: from ...
0
votes
0answers
121 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-...
0
votes
1answer
315 views

/dev/ttyusb0 cannot be find while starting script on boot for raspberrry pi

(Currently using Raspbian Jessie latest) So currently I am trying to start a script that reads from the rf receiver and gathers the data and sends it over to the cloud... I am trying to start this ...
1
vote
1answer
242 views

Asterisk and Python communicate in Raspberry Pi?

I'm currently working on a project which is based on RPi and Asterisk. What I Want In my project, I need to get incoming call details like caller ID into python and perform some functions connected ...
1
vote
1answer
20 views

how to implement a video stream unto a webpage using a Raspberry Pi and being able to see the terminal without connecting HDMI cables

i am quite conversant with Raspberry Pi and python language which i love very much that i was looking at videos on Youtube about Raspberry pi and i came cross this video which got me really intrigued ...