Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Use this tag when referring to the Python 3 language. This can include discussions about specific features unique to the language or perhaps when referring to software that requires Python 3 in order to function. Note that general programming questions are often better suited to Stack Overflow; use ...

0
votes
0answers
13 views

Python Autorun Import Error

so I've set up my Pi (Zero W) to automatically run my python script on startup. The problem comes when it tries to import BeautifulSoup, but throws an ImportError saying there's no module named that. ...
0
votes
0answers
7 views

Flask/Apache running @app.before_first_request twice

I have my raspberry pi running flask/Apache. I have a background task that I run using multiprocessing. (I know celery does this, but I just wanted something simple). My issue is that the background ...
0
votes
0answers
12 views

video not saving at boot up

I am working on a project which a part of which is to capture a 5 second video in .h264 format and then convert it to .mp4 (I'm using subprocess for that). I have coded to see the preview of the video ...
0
votes
0answers
19 views

how to add timestamp in both sender and receiver end for a message?

I was working to develop a Client-server application in Python over UDP. Both the client and server are connected through a wireless link (in ad-hoc mode wifi) and I was interested in calculating the ...
0
votes
1answer
21 views

Installing library to raspberry pi problems

I'm trying to install a library to my RPi 3 B, but for some reason when I try to import it in my script, it won't recognize the library. This is the library: https://github.com/widgetlords/...
0
votes
1answer
26 views

Reading Real-Time Temperature of Raspberry Pi in Guizero

Is there an option to display Raspberry Pi's internal temperature value to be able to display it into Guizero UI? I saw this source code on GitHub, but this only displays random float numbers in the ...
0
votes
1answer
41 views

Stream Deck Using PI 2

I have a RPi2 1gb. I've recently got a touch screen for it and have decided that I actually should use it for what it was intended for. Programming! So my adventure starts here. I want to make a ...
0
votes
0answers
13 views

Recieving serial data from multiple Xbee s

I'm doing a project for my uni....I want a sample code in python that differentiates serial data from different xbees in AT mode so i can upload individual data onto the GUI in real time. I researched ...
0
votes
0answers
31 views

GSM/GPRS SIM800L working in England,UK

I am from England and I am using SIM800L Module for sending the SMS. My module is not connecting with the network. I don't know what's the issue, I wanna know whether this module (SIM800L) works in ...
0
votes
0answers
29 views

AttributeError: ge_add_event_data

I get this error when i try to import pynput to control my motor using keyboard: Traceback (most recent call last): File "/home/pi/.local/lib/python3.5/site-packages/Xlib/display.py", line 224, in ...
1
vote
0answers
30 views

Pi-3, Model B, SenseHat - How can I restart my code while it's active.?

I am new with python and PI. I have been looking all over for information about this but with no luck. currently it works like this: I start the program, I press the button and then it starts counting ...
0
votes
1answer
27 views

Tkinterhtml fails to run on raspbian. Python 3.7

Tkinterhtml fails to run on Raspbian. Python 3.7 _tkinter.TclError: couldn't load file "/usr/local/lib/python3.7/site-packages/tkinterhtml/tkhtml/Linux/32-bit/Tkhtml/libTkhtml3.0.so": /usr/local/lib/...
0
votes
2answers
25 views

Is it possible to find the current sampling rate of MCP3008? [closed]

I am using MCP3008 with Raspberrypi Model B. MCP3008 is sampling the analog signal. But is there any way through which I can verify if it is correct or not. For example, I need a sampling rate of 1.5 ...
0
votes
0answers
18 views

Is it possible to use half the screen as touch screen and the other half as a waveform display pane?

I am using waveshare 3.5 inch RPi LCD (A). Is it possible to use it as just a display for waveforms and half the screen of it responsive to the touch?
0
votes
0answers
38 views

Running python in PHP shows error. -sudo: no tty present and no askpass program specified

I want to run a python script to turn an led on from PHP. The script did not run. I used echo to print the error. It said "sudo: no tty present and no askpass program specified". What should I do? ...
1
vote
2answers
75 views

crontab schedule .py file

I am attempting to run a scheduled .py file every 5 minutes with crontab but I don't think it's working. I'm following this post with the instructions: Can't run python script from cron I opened ...
1
vote
2answers
94 views

open a terminal on boot and auto-run a looping python script

When my RPI3 is booted, I would like it to automatically have the terminal open with my python script already running. Note that it loops endlessly. I want to open the terminal so I check the output ...
1
vote
1answer
54 views

Python script not running when added to crontab

I have an on_reboot.sh file that contains the following: #!/bin/bash source /home/pi/.profile workon cv cd /home/pi/reboot python pi_test.py After that I made the file executable using $ chmod +x ...
0
votes
1answer
197 views

How to fix Remote I/O Error Whilst Using i2c OLED

I was using my i2c OLED perfectly well when seemingly for no reason I started getting the Remote I/O Error when I ran my Python program. For some reason this was fixed by installing i2c tools again. ...
0
votes
1answer
35 views

Picamera (in Terminal and Python 3) just does nothing

I have a Picamera V2, a brand new Flex Cable (so that's not the problem) and a Pi 3B. I am using VNC from Ubuntu. The Pi connects OK. But in the terminal (raspistill - o hi.jpg) and in Python 3 ( ...
-1
votes
1answer
32 views

python basic problem in developing raspberry pi 3 GPIO skill

this is a part of a code for picroft skill: def handle_command_intent(self, message): if message.data["command"].upper() == "BLINK": self.speak_dialog("ledblink") the "data" and "...
0
votes
1answer
28 views

Run python function once usb is mounted [closed]

I'm currently having a problem on how can I run a python function once the user mounts a flash drive. I have a GUI that's in idle mode and the user can start using when he/she plugs a flash drive. ...
3
votes
0answers
101 views

Accelerated Numpy on Pi 3 B+

I'm looking to do some work with NumPy on my Pi 3 B+, and I'm not sure what the deal is with optimization, blas, etc. I installed libatlas using: sudo apt-get install libatlas-base-dev Following ...
0
votes
0answers
16 views

Rpi stops giving encoder data

I am again reposting my question. I am working on a hobby project and I have written the code to take encoder data and calculate the motor RPM which works fine. But sometimes it is very strange that ...
1
vote
1answer
63 views

Why does my raspberry pi zero w crashes when controlling a DC motor with an L9232D and a 9g Servo motor?

I use this simple circuit to control a DC motor with an L293D, and a 9g servo motor with a Raspberry PI Zero W: I use the simple following code to test the circuit: from time import sleep import RPi....
1
vote
0answers
2k views

How to install Python 3.7 with SSL? [closed]

I have compiled and installed Python 3.7 on my Raspberry Pi, but SSL is not working. These are the steps I took to install the new Python: Prerequisites: $ sudo apt-get update $ sudo apt-get ...
1
vote
2answers
61 views

Autostarting a python script at boot not working in /etc/rc.local and systemd

I am working on a data acquisition project where I am sending a bunch of sensor data to the cloud. Here is a small snippet from my code: #!/usr/bin/python3 # coding: utf-8 import ctypes from systemd ...
2
votes
3answers
599 views

Reinstalling Python3

I purged all the python3 packages and when I try to install python3 again on my raspbian I get this: Setting up python3.5-minimal (3.5.3-1) ... # Empty sitecustomize.py to avoid a dangling symlink ...
1
vote
2answers
62 views

Raspberry Pi DC Motor Not Working

So, I am attempting to control a DC motor using a RPi Model 2B. I am using a l293d motor driver to try to control the motor and a 4 AA battery holder. The diagram is supposed to look like this ...
2
votes
2answers
355 views

How fast can GPIO pins toggle?

I'm currently using Python's RPi.GPIO module to toggle some pins, and I want to know how quickly it can do this. I need the pins to be toggled on the schedule of a ~50 mhz FPGA clock, which I'm ...
1
vote
2answers
61 views

Raspberry Pi Error: AttributeError: module 'l293d.driver' has no attribute to 'motor'

So, I am trying to use my RPi model 2B to control a DC motor with an l293d controller. I have moved onto the python3 script and imported the 'l293d' module. Here is my code... import l293d.driver ...
0
votes
1answer
103 views

Help with choosing a GUI library for RPI developpement

I am currently coding an app for Raspberry Pi, the app is very GUI dependent. During my research i saw online that tktinker is good for small/simple apps. I got really excited for PyQt but found out ...
0
votes
2answers
51 views

Reverse DNS on internal LAN

Writing a Python program for my PiZeroW to scan and inventory my home local, internal network. I can easily iterate though the 256 internal DHCP available IP addresses (some assigned, some not), but ...
1
vote
1answer
105 views

Picamera capture to array is slow

In python module picamera, does anyone noticed that camera.capture(array, 'rgb') is quite slow?? If you try to measure this time is about 540ms... example code (the "real code" is irrelevant): from ...
1
vote
0answers
38 views

Send data BMP180 between client and server trought module socket

I would like to send data of BMP180 sensor between a client and a server with two raspberry pi 3 being that the client when executing the command get the server will give the temperature value to the ...
0
votes
1answer
79 views

Why does a communication over SPI returns garbage?

I am trying to read from a gps module NEO-6M using Raspbery Pi 3 B over SPI. It nicely works with Arduino but it doesn't want to work with Raspberry. I have used different libraries in Pyhon, even ...
0
votes
1answer
102 views

Get measured value of gpio vibration sensor (SW420)

I've managed to connect 2 SW420 vibration sensors to my rpi3 and can identify a vibration event on callback. However, I'd like to get the measured value (voltage change?) from the sensors, to see ...
2
votes
1answer
109 views

Python 3 interpreter not recognizing a new installed package(python 3.5.3)

I'm new to this RPI world and also to python although I completed the basic courses I'm still getting used to this so I will appreciate your patience I'll try to express my self the best way. I ...
1
vote
1answer
421 views

Raspberry Pi 3B+ freezes randomly

General setup My RPi is connected to a mouse, keyboard, and monitor. My swap size is set to 1000 MB and I'm not using wifi. Problem The RPi freezes randomly, meaning the GUI is frozen, no SSH ...
0
votes
1answer
47 views

Cron Job turns off the matrix MAX7219 after finishing the script

I have a script in python3 which executes and shows information in an 8x8 MAX7219 matrix and works perfectly. When I run the script directly from the .py file, the matrix does not turn off (and that's ...
0
votes
2answers
3k views

pip cannot confirm SSL certificate: SSL module is not available

I am trying to install openCv for Python 3.6 on my Raspberry Pi 3 Model B+, but somehow it won't connect to the python.org website. I have pip installed for 2.7, 3.0, and 3.6 installed, so when I go ...
0
votes
1answer
142 views

How can I connect with my Raspberry Pi to a database on my PC server using wifi?

Connection code: db = pymysql.connect("192.168.137.1:5901","root","","the-data-base") cursor=db.cursor() Result: Traceback (most recent call last): File "adc.py", line 17, in <module> ...
1
vote
2answers
122 views

Raspberry Pi won't recognize nRF24L01+

I'm a Raspberry Pi n00b and a python beginner, but I have a lot of experience with DIY electronics, arduino and c#. I've tried everything I can think of, and I just can't get the Pi to recognise the ...
2
votes
0answers
177 views

Difference between Thonny and Python 3 (running some code)

I'm just starting with the pi and to be more clear I'm spending time working with the Raspberry Pi Workshop for Beginners series on Youtube.To write an run code we use the Python 3 IDE but I don't ...
0
votes
1answer
40 views

I am trying to create a HID that controls the up and down arrow keys with the raspberry pi

I am trying to create a HID that controls the up and down arrow keys with the raspberry pi. I don't know the simplest/best way to connect the pi to pc for live data exchange. My idea is that the pi ...
0
votes
0answers
37 views

Running the Waveshare DAC with Python

I've been working on setting up and using the Waveshare High Precision AD/DA. I have it set up but I can't seem to figure out how to use it with Python as it seems to be rather poorly documented. (It ...
0
votes
1answer
84 views

Need assistance hooking up Sharp GP2Y0A41SK0F IR sensor

So I have this... Infrared Proximity Sensor Short Range - Sharp GP2Y0A41SK0F & 1 MCP3002. I have been scouring the web for hours, trying all code examples and I still get 0 as a reading no matter ...
1
vote
1answer
71 views

Setting up automatic submersible pump and moisture sensor

I recently came up with the idea of using a raspberry pi to power and control a moisture sensor and a pump to automatically water a plant. It's nothing large scale, but I want it to automatically ...
0
votes
0answers
57 views

Motor driving using template matching using python and opencv on Rapberry pi

I want to drive a motor when my template is matched, I have written code of template matching but can't figure out how to drive the motor with it. This is my code: import cv2 import numpy as np ...
0
votes
0answers
15 views

Rasberry Pi and Sim900A. Trouble with phone calls

First of all I apologize for my English) I connected Raspberry Pi 3 b with sim 900A correctly as many suggests. My sim900A has its own power supply with 2A/5V Task was to take phone calls ...