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
2answers
23 views

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

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
19 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
1answer
46 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
35 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
votes
0answers
19 views

Will AdaFruit HID Library work on a RPi

Will these examples run on a RPi: https://circuitpython.readthedocs.io/projects/hid/en/latest/examples.html Why or why not? Thanks in advance!
-1
votes
0answers
18 views

Continious Image Processing [on hold]

I'm trying to process image on OpenCV Python3 i searched and tried various methods to do the processing. This is far as i could go, i need some help or tips or at least what should i look for. This ...
1
vote
1answer
33 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
0answers
58 views
+50

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
32 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
27 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
26 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. ...
-1
votes
0answers
32 views

interfacing analogue pressure sensor with raspberry pi

I am working on a Raspberry Pi project interfacing an analogue pressure sensor with the Pi. Due to the absence of an ADC on the Pi I am using the MCP3008. I am able to interface the temperature ...
3
votes
0answers
44 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
14 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
46 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
385 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
46 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
345 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
51 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
154 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
38 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
40 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
41 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 ...
0
votes
1answer
45 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
23 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
37 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
40 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
52 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
0answers
158 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
44 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
674 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
66 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
40 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 ...
1
vote
0answers
102 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
34 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
28 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
55 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
41 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
41 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
14 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 ...
1
vote
2answers
254 views

Raspberry pi no module named socket server

I have a strange raspberry pi issue. When I run a python code manually it works perfect but when I run it during startup it gives this error no module named socket server. This is the code given below ...
0
votes
1answer
36 views

PyQt5 / eglfs: Draw call returned Cannot allocate memory. Expect corruption

Rather sure this is not a PyQt specific question, but that's the context. When attempting to start a PyQt5 from CLI/text mode into eglfs, I am met with the following errors: QOpenGLFramebufferObject:...
0
votes
1answer
59 views

mqtt on rpi zero w

I have rpi zero w system with below spec. system specifications: micro SD card slot, a mini HDMI port, two micro USB ports (one for power, one for USB), and 512MB of RAM. It has a single-core 700 MHz ...
0
votes
1answer
89 views

Only 1 thread starts when multi-threading in Python 3 [closed]

t2.start, (the last line), does not execute until I press CTRL+C. Why is this the case? import threading from time import sleep def thread1(): try: while True: print("Thread1 ...
0
votes
1answer
129 views

Running a camera script on startup - Raspberry Pi Zero W

I'm creating a time-lapse camera to attach to a pair of glasses. I tried out my script (python 3) and it works, but I need to get my script to work upon startup up since it will powered by a ...
0
votes
1answer
50 views

TCP server on raspberry pi not connecting to android tcp client [closed]

I am creating a TCP server on raspberry pi so that i can control it from my android phone over WIFI. I have connected both the pi and the phone to my WIFI router. import socket from cookieLED_FINAL ...
0
votes
0answers
46 views

Reading Input of tty in python

I'am looking for some support. For my project I need to read the input of ttyP0 (an extra module of my Raspberry Pi) when I open the terminal and press Screen /dev/ttyP0 [19200] I can read the output ...
0
votes
1answer
131 views

Running my python 3 code on startup with systemd - permission denied

I have a python script which uses motion sensor and camera. It captures an image and stores to the same folder where the script resides. No errors when I run it in bash. But I created this service for ...
0
votes
1answer
92 views

Cannot execute Python3 RPi.GPIO import from shell/rc.local

I have a python script with import RPi.GPIO as GPIO. When I execute in my Raspberry Pi3 Python3 IDLE, it runs just fine with no issues. If I launch the script with shell pi@my_user_name, it says "no ...