Python is a general-purpose, high-level programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs. Python interpreters, versions 3.x and 2.x, come installed ...

learn more… | top users | synonyms

1
vote
0answers
12 views

How to make two sensors to read simultaneously and display results on tkinter gui?

I have two buttons and two text fields in the window.The buttons are interfaced with ultrasonic sensors.when i click on button 1 it should show the distance measured by ultrasonic sensor 1 in text ...
0
votes
1answer
25 views

How can I put GPIO.HIGH in a variable

I have a python program what control relay board via GPIO. When I set a GPIO port LOW the relay closes and HIGH opens the relay As example. I use this line to close the relay and open it again after ...
0
votes
0answers
18 views

Raspberry pi HMI display as input?

I would like to know if it is possible to use an hmi display such as the nextion displays with the pi as a user input display and communicate the info over to the pi using serial communication? if ...
0
votes
0answers
16 views

Most efficient way to play music with floppy drives

I've been wanting to use my RPi as a controller for a floppy drive symphony for a long time. However, progress is going very slowly because I keep running into issues. Whenever I try to use more than ...
0
votes
0answers
11 views

Python and SQL exception handling when internet cuts out

I have a python temperature monitoring program that runs every 30 seconds on my raspberry pi, and uploads the data to an SQL server. I am using try: and except: however this doesn't handle if the ...
-3
votes
0answers
16 views

i am using yl 69 sensor and an arduino .I want to add the value to my database and i am getting an NULL VALUE when i am checking my database? [on hold]

ser = serial.Serial('/dev/ttyACM0',9600) moisturelevel = ser.readline() print moisturelevel sqlline "insert into reading ...
0
votes
0answers
12 views

Push command to RPi without portforwarding

I want to control a RPi from the web. Problem: The RPi should work in many different private Networks. Idea: jQuery -> AJAX -> PHP (done) PHP -> PUSH -> RPi -> Python3 -> GPIO At the moment I am ...
0
votes
0answers
23 views

I'm reading from 20 switchs inputs and this could don't work ,so what is the solution of this problem

The project is that I want to connect 20 switches to the raspberry pi and the arduino inputs and then make a very simple GUI to read on it which switch is open and which one is closed using 40 labels: ...
0
votes
1answer
26 views

Kiosk python app shutil.copyfile files empty on restart

I have a kiosk app written in python which is launched on startup (starting x server but not the window manager as I learnt about here), usbmount is installed to handle automatically mounting pen ...
1
vote
2answers
47 views

python library to generate pulse frequency of “n” hz

I'm trying to make a function which would output a pulse frequency , given a Ts (time.sleep(ts) on my function) The function is for later use on an acceleration ramp for a stepper motor , as the ...
1
vote
2answers
34 views

recording a video with picamera

I have this code which record a video when there is a motion, and the name of the video is the date that is the code: import RPi.GPIO as GPIO import time import picamera import datetime # new def ...
0
votes
0answers
43 views

Raspberry Pi 3 as a server [closed]

I am planning an application where it is required that a Raspberry Pi 3 will send and receive json objects from a central server, located on the same LAN. Which simple python library can I ise for ...
0
votes
0answers
20 views

Python 2 keypress event callback [closed]

I've a RaspberryPi 3, and am using https://github.com/adafruit/Adafruit_DotStar_Pi for controlling LEDs, which constrains me to using Python 2. I want to have a callback function be called when a ...
1
vote
0answers
36 views

LED button doesn't work

I have tried connecting a LED with a button like this (from "Adventures in RPi"), but with the far end of the button plugged at G (instead of F). And I ran it with the following Python program (by ...
0
votes
1answer
24 views

py-spidev and ADNS3080

I have been trying a lot to deal with the flow-motion sensor but I couldn't arrive to a clear result. It might be I can't understand the procedure.. I'm using cs1 on raspberry Defining the spi by ...
0
votes
0answers
33 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
0answers
30 views

Performant way to dump DS18B20 data to Mongo

I've worked with DS18B20 sensors before and have written and used scripts to access their data and make it available to a webserver using Flask and javascript. Now however I'm looking for a way to ...
1
vote
1answer
34 views

DHT22 code problems

I've been having problems integrating the code used to extract temp/humidity measurements from the DHT22 into a larger python script. The following code works without issue - import Adafruit_DHT as ...
0
votes
3answers
43 views

Python code for SW-420 vibration sensor [closed]

I bought an SW-420 vibration sensor. So, I want to make a sensor for touch and vibration detection. This is my first Raspberry Pi project. I was googling for open source Python code but couldn't ...
0
votes
0answers
72 views

Serial Port on Raspberry Pi 3 ttys0

I have a Raspberry Pi B and a Raspberry Pi 3. I am trying to get the Raspberry Pi 3's serial port working. I have put a jumper across pins 8 and 10 to check the serial port is working. I've executed ...
0
votes
0answers
25 views

USB Serial control

I am having a problem with an USB serial connection to my receiver and couldnt find anything on the internet. I am now hoping any of you guys can shed some light on my problem. I did as follow: I ...
0
votes
1answer
24 views

Can't read inputs on Raspberry Pi 2

I tested everything untill now with GPIO 40 as an input, but now comes the moment where i need to connect multiple inputs. Now i'm three inputs further, i tested input 38,37 and 36, they all seem to ...
0
votes
1answer
33 views

Write interrupt data into a Raspberry pi Register on C?

I'm trying to read interrupts and detect direction of interrupts from an encoder using a raspberry pi , it is USdigital Brand "H6BM-1000-500-IE-S-H" , it has 1000 signals per revolution , the thing ...
0
votes
1answer
9 views

Python API parse JSON request error [closed]

Here is my python script. It sends a HTTP request to request music chart data from deezer. It should then print the album names. import requests import json import time json_txt = ...
0
votes
1answer
45 views

Fastest Hardware Interrupt software?

I'm wiring my Raspberry pi to a USdigital encoder , especifically this model "H6BM-1000-500-IE-S-H" , it has 1000 signals per revolution , I've followed the tutorial on ...
0
votes
1answer
37 views

Why i can't control solenoid valve using raspberry bi?

i try to build "irrigation controller" , the material which i used are: 1 relay model , raspberry pi model B , solenoid valve 24 VAC and AC-DC adapter (input 100-240v , output +24v ) I don't know ...
1
vote
3answers
41 views

Sensitivity of GPIO pin

I have a Python script which should read if a switch is pressed (a normal light switch). This switch I've connected to GPIO pin 40 and GND I read the state of GPIO: GPIO_startprog1=20 ...
0
votes
0answers
18 views

Often need to disconnect & reconnect wifi module

Often need to disconnect & reconnect wifi module from my B+ because the wifi connection occasionally drops out. This causes my python script to be unable to reach the web server. Is there some ...
0
votes
1answer
20 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 ...
2
votes
1answer
28 views

Does the Raspberry Pi support I2C multi-master configurations?

We are using Raspberry Pi 2 single board computers for test automation (they run our feature test against an actual DUT). Our Device Under Test (DUT) uses I2C multi-master mode to communicate with its ...
0
votes
0answers
41 views

How do I get weight sensor's data to Raspberry Pi (HX711 Load cell)?

Can someone please give me the Python code to get the weight from a HX711 load cell into the Raspberry Pi? Also, can you please let me know if you used an I2C or SPI protocol?
0
votes
0answers
40 views

Raspberry Pi 3 Interactive Led Strip Wall

At the moment we're working on an interactive led screen wall for the entrance hall of our new studio. I've setup the following frame with 17meters of WS2812B addressable led strips.We're using the ...
0
votes
0answers
26 views

Controlling A Micro Servo via PUBNUB

How can I add a Micro Servo Motor from a WEB UI controlled with Pubnub. The tutorial I followed: Building a Raspbery pi The code I used was: https://github.com/pubnub/pi-house Thanks! EDIT: the ...
0
votes
3answers
65 views

Controlling an Arduino UNO from Raspberry Pi 3 (Controlling not programming)

I am working on an autonomous robot, which uses a python script running on my RPi 3 to detect traffic lights. I want that as soon as the RPi detects that the traffic light has gone off, it would ...
0
votes
0answers
14 views

Can't connect to ODBC database with pyodbc. Which SQL Server driver should I install? [migrated]

I'm trying to connect to a SQL Server database using a python script. I'm using the pyodbc library to connect to it. cnxn = pyodbc.connect('DRIVER={SQL Driver}; SERVER=192.168.80.30 ...
0
votes
1answer
21 views

voice communication between Raspberry pi and PIC through UART

I have connected some PIC Microcontrollers to my Raspberry pi. They can communicate(send text data) to Raspberry pi through UART. Is there any way to connect microphone to GPIO pins and talk to PIC ...
-1
votes
0answers
71 views

How to stream camera live from raspberry pi 3 to android using python?

I've been working to stream the camera from a Raspberry Pi 3 to Android live. So far I've been testing to capture an image then transfer the image to my laptop using this code. Receiving and decoding ...
0
votes
1answer
55 views

“sudo python anyfile.py” not working in LXTerminal

I have created a .py file that turns on a LED, as in the tutorials on raspberrypi.org. It is my understanding that I should be able to open the LXTerminal in Raspbian, type the following command and ...
0
votes
0answers
25 views

Why after adding GPIO.cleanup to my code it still show the GPIO channel warning?

I wrote some python to blink a led. Without the GPIO.cleanup method, I had the following warning: "This channel is already in use, continuing anyway". Then I did tempo=1 import RPi.GPIO as GPIO ...
1
vote
1answer
31 views

How to automatically run a python application on boot to desktop?

I am running raspbian and my pi boots straight to desktop. I am wondering how I could schedule a script to run at boot to desktop and not at power-on.
1
vote
2answers
53 views

Running Multiple Programs at once

How can I run various programs at once. I have a DHT22 sensor sending info to Pubnub, and the LED's program running so I can control the form Pubnub. How can I run both programs at the same time? the ...
0
votes
0answers
17 views

Controling various Led's from one GPIO pin

How can I control various Led's from one GPIO pin and still have PWM. I am building a smart home and I need a lighting for the inside. One Led per room is too little, so I would need three per room, ...
0
votes
1answer
36 views

Launch RetroPie from Pygame script on PiTFT?

As the title suggests, I'm trying to launch RetroPie from a Pygame script. I'm using a 2.8" PiTFT from Adafruit. In order to launch EmulationStation on the PiTFT, I'm using fbcp. In order to ...
1
vote
1answer
53 views

PIR Sensor Consistent False Positives

So, I'm trying to set up my raspberry pi to take input from a PIR sensor in order to automatically turn on a monitor when it detects motion. If no motion has been detected in 60 seconds, the monitor ...
0
votes
0answers
84 views

Rpi2 image on a Rpi3: Module spi-bcm2708 not found

I was using a RPi2 with an RFID-RC522 Board. Now I bougth an new RPi3 because of the included WLAN. I am trying to use the same image I use with my RPi2 in my RPi3 now. But I encounter a very ...
0
votes
2answers
34 views

Launching applications from GPIO button presses via a python script

I have a Python script that runs at startup and looks for GPIO inputs (the buttons on my PiTFT screen). I can make the buttons do things like shut down the Pi (sudo shutdown now), but I'm stumped as ...
0
votes
0answers
29 views

Launch a screen process with a python script at bootup

Whilst I have found there to be many articles on launching screen sessions from local.rc on the RaspberryPi none seem to work, I believe due to the fact that I'm trying to pass in the _$IP variable ...
6
votes
2answers
88 views

Crontab on Rpi not running Python script

I have a simple problem that I cannot seem to find an answer to even though I have done some research. I am trying to run a python script via crontab (I have never worked with crontab before this ...
0
votes
0answers
4 views

Integrate cpp gesture code with python snake game code [migrated]

I have a cpp code for gesture control taken from https://justinwoodman.wordpress.com/2014/11/15/using-the-apds-9960-rgb-proximity-and-gesture-sensor-with-the-raspberry-pi-2/ and I have a python code ...
0
votes
0answers
6 views

Start my webpy server when raspberry starts (using supervisor) [migrated]

I am trying to start my python web.py server when starting my raspberry, but I am having difficulties getting it running by itself. I have a config-file like the following. It's basically the sample ...