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
-1
votes
1answer
83 views

RPi corrupting one SD card a week

I have a model 3 running some python code as a service. It's never on for more than 30 minutes at a time and is maybe used once a day. However, when I do use it, it is often powered on and off ...
-1
votes
1answer
3k views

Reading all channels MCP3008

I have a problem with reading data from adc convertor MCP3008 10bit. I found a python script from adafruit that give data value from all channels (CHO TO CH7). I added a picture with my results and ...
-1
votes
1answer
118 views

Weird square on terminal

Im getting this weird square that shows up in pi terminal. It only appears on the first byte of data read in from the UART. The byte data is there but there square is overlapped over it. Anyone know ...
-1
votes
1answer
168 views

Adafruit's LCD doesn't show text

I've just written small python script to operate adafruit's lcd with additional module. Almost every lcd's operation is handled by module. But when I try to print a message on screen or in console, ...
-1
votes
1answer
372 views

Use Pi 3 With Waveshare 3.5" and MFRC522

This message showed up when I was using MFRC522 along with Waveshare LCD 3.5"(A) on Raspberry Pi 3: python Read.py can't open device: No such file or directory Aborted I think it's because SPI is ...
-1
votes
1answer
2k views

Connecting to bluetooth speakers headlessly

Background: I have a Pi Zero that I want to send music to my bluetooth speakers. This works nicely when I have a monitor and can use bluetoothctl to pair and trust my speakers and the volume-adjuster'...
-1
votes
1answer
129 views

how to change the reading channel? [duplicate]

this code is reading from channel 0, how can i change the reading channel MCP3008 adc = pi.spi_open(1, 40000, 0) # Open SPI channel 1. while True: try: c, d = pi.spi_xfer(adc, [1, 0x80, 0]) #...
-1
votes
1answer
42 views

Newbie python issue

I'm trying to write some code to drive a Sense Hat ' I want to use an LED line to indicate the temperature, then scroll it up over time. The sense.set_pixels function expects a list of 64 RGB lists, ...
-1
votes
1answer
953 views

Will an automated scp script share files between Pis without Passwords?

I am planning on sending some files within an Ad-Hoc network of Pis. Build Raspberry Pi - 2 Model B Debian Wheezy 7.10/7.11 I am planning to run a cron job between the Pis in vicinity. Through ...
-1
votes
2answers
13k views

Installing all python modules

I'm going on vacation into a foreign country and I want to take my Pi 2 with me to play a bit, not having a particular project in mind. I may not have Internet access all the time or it may be limited ...
-1
votes
1answer
646 views

Error message every time I try to install applications

Error processing line 1 of /usr/lib/python2.7/dist-packages/gtk2-2.0-pysupport-compat.pth: Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 162, in addpackage if ...
-1
votes
1answer
148 views

can't work xx.py using crontab

I can send the value to domoticz but the problem is that it just changed when I use the command sudo python distance.py I have added * * * * * /usr/bin/python /home/pi/domoticz/scripts/...
-1
votes
1answer
193 views

Python Face Recognizer Error

I got this error during compilation.
-1
votes
1answer
179 views

Piezo sensor to pick up acoustic instrument signal using Rpi and ADC

I want to read analog inputs from piezo sensors like these on Raspberry using python, which ADC do you advise me with 8 or more channels and how to wire and program it to get digital values?
-2
votes
1answer
626 views

GPIO pins available for switches

Among all the 40 GPIO pins, how many of them are available to connect a switch for on-off information? I counted more than 24 GPIO_* connections here, but are they all available via Python? import ...
-2
votes
1answer
8k views

Is there an equivalent to a 'subroutine' in the Python language? [closed]

What is the syntax for creating, calling, and exiting subroutines in Python?
-2
votes
2answers
136 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","...
-2
votes
1answer
463 views

How to compare the data input from arduino with libreoffice Calc in python [closed]

Was my code for read the libreoffice cal file was right?And i wan send back true or false to arduino after compare the input with cal file. When i key in the number from arduino,no matter correct or ...
-2
votes
1answer
1k views

How to display database in plain HTML or PHP from Python [closed]

How do I just display what's in my database in plain HTML or PHP without any GUI interface or layout, just plain database display? Is it possible? This is my Python code: import sqlite3 import RPi....
-2
votes
2answers
95 views

Runtime warning: This channel is already in use, continuing anyway [duplicate]

I'm trying to fix this code for a robot with multiple sensors. The values of TRIG and ECHO are input through another part of the code. Set this at the beginning of the code def init(): GPIO....
-2
votes
1answer
59 views

Ensure/lock a program to run on Raspberry Pi only?

Are there any characteristics/ lock available so that the program would fail to run on any other device except Raspberry Pi. I have thought about using GPIO with external circuits but would prefer ...
-2
votes
1answer
37 views

Ser.write() ,when checked shows only the length

I have used a=ser.write("TEST".encode()) in my code to send data using UART gpio in Rpi. The code shows no error but when I print a,it gives me the length only. Actually i am trying to interface Rpi ...
-2
votes
1answer
798 views

How to upload data from raspberry pi to MySQL, geting errors [closed]

Basically I am trying to upload the data collected from my raspberry pi to MySQL, I have a table called DHT_data with columns 'datetime' using data type timestamp, 'temp' using data type numeric, 'hum'...
-2
votes
1answer
211 views

How to write python to open the another program [closed]

I'm the starter with python. The point is, I want to call program like calculator or terminal by write python code.
-2
votes
1answer
45 views

Start program when a device connects to local wifi

I'm looking for a python program that could detect when device has connected to a local wifi and start a specific program. And would communicate via SMS with raspberry pi.
-2
votes
1answer
40 views

Run a fan 5scs long GPIO

def fan_on(): GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) FAN_PIN = 23 GPIO.setup(FAN_PIN,GPIO.OUT) GPIO.output(FAN_PIN,True) This is my code to run a fan on my rpi via GPIO ...
-2
votes
1answer
182 views

There is a problem with my python source [closed]

i received a lot of help to the Raspberry Pi study for yours thank you so much!! :) but there is a problem to me. i hope as follow 1. The record run 2. If the vibration sensor is detected during ...
-3
votes
2answers
3k views

How to develop a Plugin to read the status of the Power-LED of the Raspberry Pi 3 B by PHP [closed]

I need to develop a plugin that reads the status of the Power-LED of the Raspberry Pi 3 B and print the status of the LED on the Web-page. Please Help !!!
-3
votes
1answer
91 views

How to set ID for multiple sensors like LED, Temperature Sensor and etc?

I would like to know how to set a custom ID to sensors like LED, Temperature Sensor and etc. Example: Like 1 LED sensor, not smart LED. Only can display real time data and nothing else. So I want to ...
-3
votes
1answer
6k views

Which is the standard python library for Rpi other than GPIO library? [closed]

Which python library is best one to use for programming RPI? I want to program RPI zero and Rpi 3 model B+ using python. I know that there is a GPIO library available for RPI. However, in its readme ...
-3
votes
1answer
310 views

Detecting ambulance siren using raspberry pi [closed]

am trying to find a way of detecting ambulance siren using a raspberry pi,I have tried using fast Fourier transform together with numpy in python to isolate ambulance siren but its not working. any ...
-3
votes
1answer
2k views

UHF RFID PYTHON CODE? [closed]

Hi recently I purchased UHF RFID from China supplier https://ruifanelec.en.alibaba.com/product/60620230740-218430589/Hot_Sell_Free_SDK_Long_Range_Integrated_TCP_IP_UHF_RFID_Reader.html?spm=a2700....
-4
votes
1answer
40 views

Everytime I run my code it says that y is not defined [closed]

Everytime I run my code it says that y is not defined. Why? def main(): x=str(input("enter first number : ")) ab=(input("enter operator : ")) z=str(input("enter second number : ")) ...
-6
votes
1answer
835 views

Writing a script to run multiple scripts on the Raspberry Pi, as part of a larger physical computing project [closed]

I am a beginner with raspberry pi and python, and I’m building an alarm clock project. Can anyone tell me how to write a script to call on all of the other scripts. For example, I have three scripts ...