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.

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 ...
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 ...
0
votes
1answer
25 views

Get the default raspberry pi internet disconnection event

I'm working on a python script running on a script, which would upload some files to the server. Probably, this needs internet connectivity to be turned on. I'm seeing a log pi@raspberrypi dhcpd[5] ...
1
vote
1answer
32 views

RPI project Minecraft Server

me and a project partner are running a Minecraft server off of a RPI and connecting via its wireless feature. we wanted to create a python script which would control an LED and toggle it on/off based ...
1
vote
2answers
47 views

Permission denied using Serial

I'm using some XBee to build a mesh network and everything is working, BUT only if I run the code using sudo. Now that the code is "Finished" i want to remove this need, because i know that it isn't ...
0
votes
0answers
32 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 ...
0
votes
0answers
40 views

Segmentation Fault when running script with Python3

I have an application which should running on Python3 with Kivy and Postgresql. I had my Python3 installed according to the guide from this blog below: Install Python3 but I realize the Python 3.7 ...
0
votes
2answers
73 views

Select default Python as 3.7.2

I had installed Python 3.7 which according to tutorial in this blog(i change the Python version to 3.7.2): https://bohdan-danishevsky.blogspot.com/2017/01/building-python-360-on-raspberry-pi-3.html ...
1
vote
1answer
31 views

How Can I Determine Why My Python Script Is Terminating?

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 and made two copies of the ...
0
votes
1answer
36 views

How to send data from raspberry pi to AVR over bluetooth?

I am searching for a way to send data from raspberry pi to my AVR using HM10 or HC05, both of which are available. What I need to do is to read values from a .txt file and send it from the raspberry ...
1
vote
4answers
87 views

program my robot with python

initially my question was about how to fix my code. You informed me that usage of that python class will not work with my setup of one motor. I agree and I want to instead use the GPIO library to ...
0
votes
0answers
33 views

How to run a servo motor if a particular condition is satisfied

I have a script of python which is about object detection once a particular class is identified the servo motor should work Iam using object detection using tensorflow and opencv , basically scripts ...
1
vote
2answers
220 views

Runtime error A PWM object already exists for this GPIO channel

iam new to raspberry pi and i got an error while a running servo motor in my object detection script i need to run the servo whenever my if condition is true so the same pin run multiple times if ...
0
votes
1answer
48 views

How do I use the send_message method on a Raspberry Pi 3?

When I run this code: import datetime import smtplib import re import email from email.mime.text import MIMEText import email.message from robobrowser import RoboBrowser from bs4 import BeautifulSoup ...
2
votes
3answers
134 views

Multiple GPIO Buttons

I've seen a tutorial here that shows me how to do this: But what I want to do is like this: I want to have multiple buttons and distinguish between them. The graphic I painted depicts the desired ...
0
votes
2answers
46 views

Need help clarifying my python script to run on Rpi3b+

If it's not obvious, I'm trying to learn python, and am having a go at it. Although, I'm running into some issues. Any help would be appreciated. I'm trying to run this on a Rpi3b+ & with a ...
0
votes
1answer
36 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 ...
1
vote
1answer
133 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 ...
1
vote
0answers
35 views

Mouse Control Function in Python for Raspbian

Does anyone tried to control mouse cursor position and click in Python application for Raspbian before? I am refering to this website: https://pyautogui.readthedocs.io/en/latest/mouse.html#mouse-...
1
vote
1answer
69 views

How to toggle button on and off with gpiozero?

I can't seem to find a solution of doing this using gpiozero. I've done it using rpi.gpio with add_event_detect and call back to change state but I was under the impression gpiozero is much simpler. ...
3
votes
1answer
37 views

gpiozero import resets pullup

In order to use a GPIO connected button as a power off switch I have set a pullup for pin 23 in a dtb overlay (following http://blog.gegg.us/2017/01/setting-up-a-gpio-button-keyboard-on-a-raspberry-pi/...
1
vote
0answers
11 views

Can I use the hostname of my Smart Plug in my Python script throughout different WiFis?

I have a Python script which retrieves the measured data from a smart plug so that I can visualize it on my Rasbperry Pi. This command gets the data send_hs_command("192.168.1.26", 9999, b'{"emeter":...
2
votes
0answers
40 views

Control on-board led triggers from python

I know the trigger for on-board leds can be controlled from the command-line (or a script) I have a python program that I want to temporarily take over the system led blink it a little and return ...
0
votes
2answers
34 views

Can I setup something on my raspberry pi so that a prgram I have is always running?

I have tried adding it to the rc.local file but sometimes the program will launch on boot but won't stay open. Is there a way to have so when the program stops running that it gets relaunched?
1
vote
0answers
14 views

Running mongodb as as service increases boot time by 30 seconds

Title says it all. I have an RPi 3 with Raspbian that has a web app running at start up in chromium. It took 20-30 seconds from powering on to the app appearing before I added mongo, and after I ...
2
votes
0answers
40 views

Threading on Raspberry pi Serial Port

I have multiple Raspberry Pi(RPis) using which I have to send data (wireless,using Long Range modules connected to TX RX of RPi) on just one Rpi. All the RPis(Ones sending data) use different ...
1
vote
1answer
40 views

PyGame for Jukebox without display

I want to great a small (local) jukebox without a display. Songs are stored on the SD card and every button is more or less hardwired to one song (always to the song called "1.mp3" on the sd card ...
1
vote
0answers
99 views

Error opening USB Cam with OpenCV4: GStreamer-CRITICAL **: gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed

After installing OpenCV4.0 on my RPi, i tried a simple script below with a Logitech USB Cam (720p) but at "cam = cv2.VideoCapture(0)" it gives me an error "(python:num process): GStreamer-CRITICAL **: ...
0
votes
0answers
11 views

Is it possible to read android tag via RFID-RC522

So, I googled for two days and didn't get correct answer. Is it possible to read NDEF data from Android phone via RFID-RC522? I've tried to use couple of libs to solve this issue. Also I've tried to ...
2
votes
1answer
53 views

Got compilation error when installing plyvel

I got an error while trying to install plyvel on my raspberry (pi 3 B+) with sudo pip install plyvel : Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting plyvel ...
1
vote
0answers
61 views

Getting Error: ImportError: No module named 'cv2' in Geany python editor

I'd finally installed OpenCV 4.1.0-dev in my raspberry pi with success, I checked that in Terminal by : pi@raspberrypi:~ $ python3 Python 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6.3.0 20170516]...
2
votes
0answers
41 views

Detecting “No Mouse Movement” in python on Raspberry Pi

So this is going to be a bit confusing but using a basic loop i can detect keyboard and mouse inputs using the following: globals()['keyboardEvent'] = evdev.InputDevice('/dev/input/event0') globals()...
1
vote
0answers
28 views

How to set access rights for lighttpd using python scripts (cgi) which uses temporary files

My problem is: I have a running lighttpd web server. The files are stored in \var\www, also a python script, which can be executed to get an image from the raspi camera. Every time the script is ...
0
votes
0answers
32 views

Which language is best for Raspberry Pi Apps for better GUI and Firebase

I want to develop Raspberry Pi app which requires lots of REST API calling, GPIO controls and very best GUI. I have done research on following. Running C#.net or VB.NET apps in Raspbian OS using Mono....
2
votes
2answers
115 views

How to activate the Python Virtual Environment

I'm trying to install OpenCV in my raspberry (I'm new with it) and I followed this post. I have done all the steps from 0 to 6. All this installation it's done in a virtual environment, but now I ...
0
votes
1answer
28 views

Wireless doorbell using gpiod

Good Morning, I have a non issue that I am just curious how its working. So I have a wireless doorbell that I built. It works using the gpiod and remote gpio. So I have a chime unit that I built with ...
0
votes
1answer
50 views

Taking multiple images when Camera is triggered

I have some code that when the PIR Sensor is triggered the camera takes one single images and uploads it to Azure blob storage, taking one single photo is not sufficient but I can't get the Program to ...
0
votes
0answers
30 views

Connect 3 Raspberry pi using i2c

I'm trying to use i2c to exchange messages between 3 raspberry pi, all of them must receive a message do something and then send a response. Raspberry as an I2C SLAVE From here I came up with a ...
1
vote
0answers
62 views

Multiple channel and multiple sound card

I need to do the following (if possible in Python): output at the same time on multiple USB sound card (cheap one you can find on Amazon) on the main audio file, I need to output temporary sound if ...
1
vote
0answers
46 views

Need help with Controlling WS2812B LEDS

I have made a 5 x 5 WS2812B RGB LED matrix to work with my raspberry pi. I'm trying to figure out how to run several tests from this tutorial: https://tutorials-raspberrypi.com/connect-control-...
2
votes
1answer
54 views

Controlling LED strip from GPIO Help?

I have a ws2811 LED strip that I was powering using an arduino, but I want to do some more complicated things with it, and figured my old raspberry pi would be perfect. So I followed a tutorial online ...
1
vote
1answer
47 views

Raspberry Pi PIR motion sensor and camera script dies after loop

I have a simple code for PIR sensor to detect a movement, which works as expected. Code: from gpiozero import MotionSensor import time pir = MotionSensor(4) while True: pir.wait_for_motion()...
0
votes
1answer
47 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 ...
1
vote
1answer
37 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
0answers
47 views

MQ135 Sensor - Output ppm

So I am making a Mq135 sensor and the wiring can be found on: circuit.io/app?components=9443,200000,398790 It isn't shown but the AO is connected to channel0 via the breadboard the code is : #!/usr/...
0
votes
1answer
33 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
58 views

How can I amplify my voice in real time just like a microphone does?

I am planning to make a microphone and speaker system to amplify my voice just like a normal microphone does. I have a sound sensor and a speaker... is there any Python code that I can use?
1
vote
0answers
74 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
107 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/...
-2
votes
2answers
77 views

Python: how can a delay the repeat of my print command?

My objective is to program a print out a reading, but I want to delay the reprint so that its not spamming me with the reading constantly. try: cpuFile=open("/sys/class/thermal/thermal_zone0/temp","...