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
327 views

Lighttpd running FastCGI script hangs and give 500 internal error

I'm attempting to use lighttpd and fastcgi to run a small flask application. When I try to start lighttpd, it starts the server just fine, but when I try to connect in the browser, it hangs without ...
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
2answers
75 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 ...
3
votes
3answers
7k views

5v Relay will not close (unless using GPIO cleanup)

This seems like it should be really simple, so maybe I am missing something. I am just trying to open and close my relay but all it does it open's and doesnt close. I can use GPIO.cleanup() to make it ...
0
votes
1answer
268 views

webiopi write to log when button is pushed

Trying to learn the webiopi and python. I have a simple button to turn off and on a relay. Here is the HTML <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/...
0
votes
1answer
243 views

gamepad/joystick-> raspberryPi->nrf24l01->arduino; variable confusion between cpp and python

I'm trying to operate an r/c robot with joystick and a raspberry pi running Debian and an nrf24l01 to communicate the joystick commands to the arduino on the robot. I only really need forward/back ...
1
vote
1answer
69 views

Two stepper motors with python

I want to make a motorized rc paddle boat type machine for fun. I plan to use two stepper motors to spin two wheels on either side of the boat. I am controlling it with python. I have a master script ...
0
votes
1answer
389 views

Controlling High voltage devices with Raspberry Pi

Can I control high voltage (here 5V) to power a led lamp and a fan(both operating at 5v) from Raspberry Pi GPIO only using a transistor . Or should I isolate both the circuits using a relay or octo-...
0
votes
1answer
231 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 ...
0
votes
2answers
246 views

Pigpio belt speed encoder

I'm trying to read pulses from an encoder to measure belt speed. My encoder is 500 ppr. I have approx 2400 pulses per meter and I need to measure speeds upto 450 meters per minute. Can anyone help ...
0
votes
1answer
382 views

Properly installed Kivy on Pi3B won't exit or show mouse/cursor moves

I have set up kivy to where I can successfully launch the demos and even my own hello-world apps on a Raspberry Pi 3B. I have two problems that do not seem to have any good answers on the web at this ...
0
votes
0answers
48 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
45 views

Play a defined set of MP3's on defined days

am new to Python and have been struggling to create a workable script for a friends project - am hoping someone can point me in the right direction! The script is to control playback of mp3 files ...
0
votes
1answer
286 views

Keypad matrix 4x4 Python code error

Below is my code The code doesn't work because have this error: :NameError: name 'processKey' is not defined How do I fix this?
0
votes
1answer
371 views

How to keep script running even after session timeout

I have a python script I want to keep running for most of a day. I have tried the following; -- Screen. I SSH to the Raspberry Pi,and they type "screen bash", I then start my script and then "control-...
0
votes
2answers
341 views

Control Raspberry Pi to control an Arduino over Apache

I want to control a Raspberry pi to control an arduino which is controlled by a webpage hosted by apache. I do not know how I would attempt this and if it is even possible. Can anyone please guide me ...
0
votes
0answers
51 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 ...
2
votes
1answer
393 views

prevent GUI notification for Bluetooth Pairing

Currently, I am trying to control Bluetooth (pairing - connecting - removing ...) with my python code (by accessing to bluetoothctl through pexpect). It actually works fine but I have a problem with ...
0
votes
1answer
839 views

serial errno 25 inappropriate ioctl for device

I have raspberry pi 3 B+ running latest raspbian-strech lite. i have a max485 ic connected to uart on the gpio. import serial,fcntl, struct ser = serial.Serial( port='/dev/serial0', ...
1
vote
3answers
279 views

How to display gpsd.utc using paint or similar method

I am receiving reliable gps data from my Adafruit gps sensor. I would like to to show the gpsd.utc data across the screen so that it appears like a regular clock. I have the following code which shows ...
0
votes
2answers
2k views

How to drive two stepper motors simultaneously

I am using a raspberry pi model B to drive one stepper motor with the L293D chip and python. Now I would like to control two stepper motors simultaneously with two different L293D chips and python. I ...
1
vote
1answer
370 views

Python's raw_input() function causes problems in systemctl service

I am attempting to create a safe reset switch according to these instructions. I have implemented the interrupt-based solution (listing 1) which runs fine if I start the script from the command line, ...
0
votes
2answers
127 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
34 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
3answers
2k views

OpenCV 4 error?

When I run the command python faceDetection.py I get the error- VIDEOIO ERROR: V4L: can't open camera by index 0 Traceback (most recent call last): File "faceDetection.py", line 21, in <module&...
0
votes
1answer
345 views

Running openCV C++ file from python in Raspberrypi

I'm creating a object and color detection robot. Here in this case, I'm using C++ to run the camera and process the image with openCV in C++, but before I run the Camera, I want the robot to move and ...
3
votes
1answer
40 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/...
0
votes
1answer
419 views

NameError:Function not defined

I have a class RelayChannel and I want to call the function RelayChannelOn() to this code but I get error : NameError: name 'RelayChannelOn' is not defined. Here is the code where am calling the ...
0
votes
1answer
39 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
96 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 ...
2
votes
1answer
337 views

Raspberry pi freezes after 20 minutes of use

using tkinter i have made a GUI in which a video plays continuously in a loop until the ultrasonic sensor detects a person in front of it. when a person is detected it displays a messages"hi..welcome"....
0
votes
2answers
317 views

PIR Module False Positivesq

All I am working with a PIR Module and a camera for a project to provide text messaging when motion is detected as well as taking a picture. I am seeing a large number of false positives from the PIR. ...
2
votes
1answer
685 views

Configuring NRF24l01 Radio using TMRh20 library takes no effect

I got a Raspberry Pi B 512MB RAM and hooked up a NRF24l01. Now using the TMRh20 library I wanted to configure the radio as followed: #!/usr/bin/env python from __future__ import print_function ...
1
vote
1answer
2k views

Issues with Kivy on Raspberry Pi 3 with 3.5 in Touchscreen

I followed every guide I could find on installing Kivy to Raspberry Pi. My touchscreen works totally fine. Trying to launch various Kivy demos will result in what seems to be a partial launch, but ...
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
161 views

Connecting 4 HX711 to one Raspberry Pi

I have four individual scales that are each connected to a HX711, those HX711s are each connected to the Raspberry Pi. I'm a beginner in python as well as this Rasberry Pi. how do i properly code this ...
0
votes
1answer
299 views

Setting up the Raspberry Pi as a client on a sever

I'm attempting to give my Raspberry Pi a static IP address on an ethernet network that I am controlling from a Windows machine. I want to be able to send my PI UDP packets directly from my server via ...
0
votes
0answers
36 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 ...
2
votes
1answer
66 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 ...
0
votes
2answers
9k views

Installing Python 2.7

I am new to the Raspberry Pi, I have a project. I would like to work on Python 2 not Python 3. By default Python 3 is installed on my Pi. I want to change or remove this version and I want to ...
0
votes
1answer
100 views

Python code to use Adafruit motor shield v1 with Pi 3

It is dangerous to run motors directly from the Pi, hence we need a motor shield. I own an Adafruit arduino motor shield clone: https://learn.adafruit.com/adafruit-motor-shield Note: I'm aware about ...
2
votes
3answers
245 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
1answer
76 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 ...
0
votes
2answers
641 views

Python MCP23017 16 ch. I2C input loosing a bit

I bought a MCP23017 and doing some small test with it. I've made a simple Python script to make read_out of pin state. Can anyove explain to me, why i'm loosing a bit when GPIO_A7 is triggered? I've ...
2
votes
1answer
433 views

USB audio from Pygame

I am running Raspbian Stretch. I've connected a USB sound device and selected it through the graphic interface. This sends the sound out fine from youtube in Chrome but is silent with a Python ...
0
votes
1answer
869 views

Wiegand GPIO read not working all the time. Works most times but hangs on some reads

I'm extremely new to Python, I've been learning a bit over the last couple weeks. This is what I've managed to come up with. I'm pretty over the moon the code works most of the time but it doesnt work ...
3
votes
1answer
329 views

Is it possible to connect a Minecraft Pi Edition Python script to a specific active game window?

Is it possible to connect a Minecraft Python script to a specific active game window when multiple game windows are currently open? For example, I have three different open games on one Raspberry Pi ...
1
vote
1answer
430 views

Bluetoothctl connect TIMEOUT exception

This is the error I am getting when I connect to my mobile phone using the connect method in this documentation: https://gist.github.com/egorf/66d88056a9d703928f93, raise TIMEOUT(msg) pexpect....
1
vote
0answers
41 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-...
0
votes
1answer
572 views

Sense Hat RGB Code

I am a new programmer, trying to learn python. I am using the sense hat to mess around with, I want to make it like rotate RGB colors. I am using the sense.set_pixel and passing in the x,y and r,g,b ...