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

Questions tagged [python-3]

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 this tag only where directly relevant to the Pi.

3
votes
0answers
185 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
20 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
111 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....
2
votes
0answers
4k 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
86 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
1k 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
99 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
863 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
98 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
216 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
71 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
245 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
61 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
158 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
188 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
257 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
878 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
55 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
6k 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
203 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
289 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
256 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
54 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
62 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
115 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
105 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
100 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 ...
1
vote
2answers
642 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
65 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
109 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
166 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
329 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
122 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
84 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
400 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
200 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 ...
-1
votes
1answer
178 views

How can capture many images using picamera and loop and different name? [closed]

Here's my current Python code: import picamera with picamera.piCamera() as camera: for i in range (10): camera.capture("/home/pi/Desktop/newfile/newimage.jpg")
1
vote
1answer
59 views

Camera pretrigger capture

Hi i want to make a program that will continually record a video and on a press of a button, it will save 2 minutes before i pressed the button is it possible to do it somehow ?
0
votes
1answer
137 views

Does there exist an mqtt client that works with python 3.5 on raspbian stretch?

I have been using the paho-mqtt client successfully with python 2.7 on raspbian stretch, but I have a need to use python 3.5 on a new project and paho-mqtt does not appear to install or build for that ...
1
vote
2answers
69 views

Get photoresistor working with Python3

I have a Python 3 program but the code below doesn't work in Python 3. I've searched for days but didn't find any solution. Is there any way to get this working in Python 3? The only output I get is ...
0
votes
0answers
78 views

How to change the text colour by RGB LED Dot Matrix on Pi3 (Using APA102 strip)?

I am using python3 to control APA102 library with RGB LED on Raspberry Pi 3 B+. Currently, I can display the text and emoji on 32x32 LED Matrix. However, I do not know how to change the text colour ...
1
vote
1answer
128 views

How to programmatically check bluetooth speaker is connected to rpi3?

I am trying to detect if my bluetooth speaker is connected to my rpi3 with my python code, executing this command status = subprocess.call('ls /dev/input/event0 2>/dev/null', shell=True) if the ...
2
votes
1answer
3k views

How can I use OpenCV with Python 3 on a Raspberry Pi?

I have installed OpenCV and and access it with Python 2. However, I'm unable to use OpenCV with Python 3. It says "Cannot open shared object". ImportError: libQTtest.so.4: cannot open shared object ...
3
votes
2answers
2k views

Failed to create MMAL component b'vc.ril.camera': Out of memory

I am trying to run a simple script that listens for a button click and then takes a picture. Once two pictures have been taken it compares the two using OpenCV to calculate the difference. I am ...
0
votes
1answer
164 views

I'm wanting to get user input from a screen, but I can't have any buttons

I'm developing an python3 application that only uses a handheld scanner for input. I need to prompt the user for input and want to use a nice window to do it. When I look at tkinter, it appears that ...
1
vote
0answers
302 views

usb.core.USBError: [Errno 13] Access denied (insufficient permissions)

I am running Rasbperry pi and have the pyusb module installed. The printer is Bus 001 Device 004: ID 0fe6:811e Kontron (Industrial Computer Source / ICS Advent) Parallel Adapter, and it's idVendor and ...
0
votes
0answers
234 views

Python program works using Thonny, but fails from command line

When I execute the program after opening with Thonny on the Raspberry, the program will run and execute with no issue. It will also execute when I tell it to "Execute in Terminal", when double ...
5
votes
3answers
460 views

Is it necessary to release Raspberry Pi Camera before rebooting? If so how do I do it?

I have a python3 script that uses OpenCV and a Raspberry Pi cam. It runs almost 24/7. Using crontab the pi will reboot every night at midnight and the script will begin running again. This is mostly ...
0
votes
0answers
23 views

Barcode and Ardunino IR receiver

We are using our barcode scanner as basically a keyboard. Therefore when it scans the barcodes it just prints the numbers associated with that barcode. With that, we are now trying to make our barcode ...