FAQ Database Discussion Community
php,apache,configuration,installation,raspberry-pi
I've installed PHP 5.6 on my Raspberry Pi (from the Jessie repo), as well as Apache2. When I access http://192.168.2.50/ (the Pi's IP-address) it's not serving the index.php or index.html file in ~/var/www/. Just an hour ago I was running PHP 5.4 from the Wheezy repo, this was working fine....
python,formatting,raspberry-pi
On a Raspberry Pi, I've set it up so that it's monitoring ASCII serial input from the user, which it then parses and populates a matrix with the parsed data. But when I try to do something with the data: for i in range(1,7): if matrixA[i][1]>0: print "sending DO_Fire (pin...
bash,if-statement,for-loop,raspberry-pi,sendmail
I want to run a bash-script on my raspi. The script's purpose is to check one device in my network for availability (with ping). If this device is responding, script should end. If it's not responding it has to go further and check the availability of 3 specific devices: if...
c,gcc,raspberry-pi,cross-compiling,raspberry-pi2
I wanted to start cross compiling for raspberry pi2 on Ubuntu 32bit (in virtual box), so I downloaded the toolchain on the github site (https://github.com/raspberrypi/tools) and tried to compile a simple hello world program with the command (I've included the path to the bin folder that contains arm-linux-gnueabihf-gcc-4.8.3 to the...
php,jquery,html,ajax,raspberry-pi
So I have a Raspberry Pi controlling my Garage door. The Pi is running an apache webserver. I also have a camera connected to the raspberry pi and I want to be able to update the images from the camera. Currently I have the following code: garage.html: <html> <head> <meta...
raspberry-pi,crontab,raspbian,init.d,ppp
There're three forms about running a script on the boot of the Raspberry, that are modifying /etc/rc.local, modifying the cron daemon and making a script that automatically run on boot in /etc/init.d I want to know which of the methods listed about executed first. The point of the question is...
bash,raspberry-pi,crontab,raspbian
I was trying to get a crontab working on my Raspberry PI and I think I messed up my environment variables. I can execute a file from the GUI by right-clicking and choosing execute. However I cannot get the same file to run from command line. I can use ls...
python,raspberry-pi
I recently started python development on raspberry pi. While reading about .pyc file to speed up the start up, I was wondering if I test a .pyc file on PC, given that same python modules are available on Rpi, will it work directly ? Please also include what happens if...
python,button,raspberry-pi,shutdown,headless
I am writing a script for a surveillance camera. I have programmed it to take a picture when motion is detected (PIR sensor) then attach the photo to an email, to a chosen recipient. However because I am running this without a screen, mouse or keyboard attached I had no...
c#,raspberry-pi,core,win-universal-app,windows-10
using python on the Raspberry PI I use similar code to what is shown below to read data from the serial port: baud = 9600 # baud rate port = '/dev/ttyACM0' # serial URF port on this computer ser = serial.Serial(port, baud) ser.timeout = 0 var message = ser.read(9); Essentially...
python,cron,raspberry-pi,subprocess
I'm trying to use a subprocess call in python to add a cron job entry: from subprocess import call call(["(crontab -l; echo '* * * * * ls -l | tee tresults.txt') | sort - | uniq - | crontab - "]) And I don't know what I'm doing wrong!...
python,raspberry-pi
I am trying to connect this analog to digital converter to my raspberry pi (version b+) but everything I have read seems to use different pins from what I assumed based on this pinout website. Can someone tell me which pins (in GPIO.BOARD style) to use? A simple example of...
python,bash,raspberry-pi
In Python or Bash, is there an easy way to receive a Boolean result on whether or not the crontab exists? crontab -e #shows me manually ...
python,raspberry-pi,raspbian,mqtt,mosquitto
I'm using a Raspberry Pi with a Debian Wheezy image. I have installed Mosquitto (the broker of MQTT protocol), mosquitto client and python mosquitto to use mosquitto in my Python script, I have run a very simple example to test if all my packages work fine or not import mosquitto...
gcc,raspberry-pi,cross-platform,raspbian
At least Debian does not provide a usable toolchain to cross develop for the Raspberry Pi 1. The Linaro toochain is at the time of this writing too old for the Qt5 developer branch. There is a project crosstools-ng, which allows to easily build custom toolchains for all kinds of...
network-programming,raspberry-pi,raspbian,onvif
I was looking through a lot of questions and answers about ONVIF compliant solutions for raspberry pi, but most of them provide incomplete solutions to my problem. I am looking for a way to make the Raspberry Pi Camera (Not an USB camera) into an ONVIF compliant camera which streams...
php,html,raspberry-pi
UPDATE: I have fixed the name issues however it is still not working...using echo "Hello world"; to check if the script is running but doesn't show I created a PHP and HTML script together for testing, works perfectly, now I'm separating the PHP and HTML using <form action="button.php" method="POST"> however...
bash,shell,raspberry-pi,raspberry-pi2
I want to replace "." in this result: "172.16.0.25" with " dot ". Here is my code: #!/bin/bash connection=`netstat -tn | grep :1337 | awk '{print $5}' | cut -d: -f1` #this returns "172.16.0.25" replace=" dot " final=${connection/./$replace} echo "$final" Which returns: test.sh: 4: test.sh: Bad substitution I tried using...
text,sms,raspberry-pi,message,twilio
I recently set up a Twilio account and got a registered Twilio phone number. Is there a way that I can get those messages on my raspberry pi? My intent is to display those messages on a LED screen.
python,sdk,arm,raspberry-pi,informix
I wanted my raspberry pi to connect to an Informix database thru Python. I tried installing the InformixDB module for python but I get an error as NameError: name 'arch_' is not defined But this is caused because I didn't have an Informix Client SDK installed on the pi which...
bash,raspberry-pi,sudo,mount
This question already has an answer here: mkdir command not found in bash script 2 answers I'm trying to make a script to mount a disk when runned. The script is #!/bin/bash PATH=$(python /home/pi/prova.py 2>1&) sudo mount $PATH /media/Drive1 where path in our case is /dev/sda1 (checked using echo)....
c,linux,arduino,raspberry-pi
I'm working on a personal home automation project. On the server side, I have an Arduino Pro Mini with: a 433 MHz TX module on pin 2 a 433 MHz RX module on pin 3 a DHT22 probe on pin 4 (with 10k pull-up) a DHT22 probe on pin 5...
python,python-2.7,synchronization,raspberry-pi,clock-synchronization
I'm new to raspberry pi, trying to send a stream of bits from sender to receiver. However bits are not received in correct pattern most of the times, they seems to be shifted a little. I think i'm unable to synchronize them properly. Does anyone how I can sync the...
raspberry-pi
I downloaded the necessary files for Raspberry Pi onto a MicroSD card, although the MicroSD card is no longer readable. When I put the card into the computer through a MicroSD to USB adapter nothing shows up in Windows Explorer. The card isn't present in Windows Disk Management either. How...
c++,linux,raspberry-pi,qt5,raspbian
I have a project which I've made on Ubuntu 14.04 LTS, but then, I wanted to test if the Raspberry Pi was capable of running this little program of mine. Then I've followed the instructions on this link to compile and build qt5 natively on the Pi. I've managed to...
qt4,raspberry-pi,qt-creator,qt-designer
I am building a UI with QT Designer. I need this UI to run on a Raspberry Pi. What do I need to do to make the UI for the Pi? Does it have to be written in a specific language like python or can I just write it in...
python-2.7,raspberry-pi
I have a few Python scripts, all of them involving while True: and a wait timer so they run at varying intervals. They do things like monitor a serial port and look for new versions of my code on a remote server. I haven't used cron because some require offsets...
python,raspberry-pi,gpio,raspberry-pi2
I am using a Raspberry Pi 2 B and attempting the project on the following website: https://learn.adafruit.com/raspberry-pi-face-recognition-treasure-box/overview However when I try to run the file "capture-positives.py", I get an error when trying to import the GPIO. I have tried updating the GPIO and removing and installing a fresh copy, however...
osx,raspberry-pi,raspberry-pi2
I just received a pi 2 with sd card preloaded with NOOBS. I also have an hdmi cable and wifi dongle for it. I wanted to begin using the pi 2 but do not have a spare monitor to connect it to. I was hoping to be able to connect...
python,raspberry-pi
Update 2: So I piped the output of stderr and it looks like when I include shell=True, i just get the help file for omx player (it lists all the command line switches and such). Is it possible that shell=True might not play nicely with omxplayer? Update: I came across...
linux,windows,sockets,network-programming,raspberry-pi
I'm trying to send a file from my Windows machine to my Raspberry-Pi 2, and I have a client and a server. The client should be able to send a zip file over the network to my server on my linux machine. I know my client and server work on...
bluetooth,raspberry-pi,bluetooth-lowenergy,uuid,ibeacon
I want deploy a large number of iBeacons with the same UUID because we can't access dynamically to the UUID of the beacons detected. What is the limit number of the maximum Beacons with the same UUID ? I found some discussions with a number of 65000 approximately, is it...
python,module,install,raspberry-pi,gpio
I have looked and most of the tutorials are rasbian based. I would like it on windows so I can develop a python script on windows to which would later be put on the Raspberry pi. I have downloaded the module and have tried python setup.py install in command prompt...
raspberry-pi,raspbian
Where can I find all boot, driver or kernel related logs on a Raspbian? Could you please reply with a list as follows: Driver logs - /something/somethingelse.log Thanks!...
python,raspberry-pi
I have a fixed 2 hr job (four 30 min parts) that I want to kick off from a menu option in a Python console application. Can you please help me with some design. When a user clicks the menu option to start the job, I want to give some...
python,tkinter,raspberry-pi
import Tkinter window=Tk() msg1='abc' msg2='def' label =Label(window,text=(msg1,msg2), fg='blue') label.grid(row=0,column=1) window.mainloop() output is {abc}{def} I want output as abcdef. how to do that?...
python,linux,pyqt,raspberry-pi
I'm having a helluva time debugging a python app I've written for an embedded raspberry pi project I'm working on because it's using a TFT screen instead of a full monitor and has no monitor/keyboard, so i'm having to launch the python app via an icon on the TFT desktop...
raspberry-pi,raspbian
I've just installed RASPBIAN 3.18 and next packages: wget http://mirrordirector.raspbian.org/raspbian/pool/main/b/bluez/bluez_4.99- 2_armhf.deb wget http://mirrordirector.raspbian.org/raspbian/pool/main/libc/libcap- ng/libcap-ng0_0.6.6-2_armhf.deb wget http://mirrordirector.raspbian.org/raspbian/pool/main/r/radvd/radvd_1.8.5- 1_armhf.deb wget -O kernel.zip http://www.nordicsemi.com/eng/nordic/download_resource/41602/5/28710770 unzip kernel.zip sudo dpkg -i radvd_1.8.5-1_armhf.deb sudo dpkg -i libcap-ng0_0.6.6-2_armhf.deb sudo...
python-2.7,raspberry-pi
When I run the script below to turn the light on (state=on), then run the script again after rebooting the raspberry pi it tells me the state=on, when it should say off. Why does this happen? Is there any way I can fix this? #!/usr/bin/python import RPi.GPIO as GPIO #setup...
python,raspberry-pi
I'm trying to take continuous input from the user and do things based on that. I'm trying to use the key.get_pressed() function in the pygame module. But, I can't get it to work. I've looked at all the other similar questions but none of those solutions seem to work. import...
c,arm,embedded,raspberry-pi,low-level
I'd like to experiment using the Raspberry Pi for some different low level embedded applications. The only problem is that, unlike the AVR and PIC microcontroller boards available, Raspberry Pi typically runs an OS (like Raspbian) that distributes CPU time across all running programs and makes it impractical for certain...
qt,raspberry-pi,cross-platform,qt5,raspbian
There are a few tutorials on the net, which explain how to compile Qt5 for the Raspberry Pi. Unfortunately all of them are a bit out of date. Usually one gets 'undefined references' for some GLIBC functions. This question and answer explains how to create an up-to-date (March 2015) gcc...
javascript,node.js,socket.io,raspberry-pi
I have the following function: function monitorClimate() { var sensorReadingInterval; function startClimateMonitoring(interval) { sensorReadingInterval = setInterval(function() { io.emit('sensorReading', { temperature: sensor.getTemp() + 'C', humidity: sensor.getHumidity() + '%' }); }, interval); console.log('Climate control started!'); } function stopClimateMonitoring() { clearInterval(sensorReadingInterval); console.log('Climate control stopped!'); } return { start: startClimateMonitoring, stop: stopClimateMonitoring }; }...
php,raspberry-pi
I'm i have created a server/ using the raspberry pi as a server and connected LED lights to to a breadboard at GPIO 7... I am using this script: <html> <head> <?php if (isset($_POST['RedON'])) { exec('sudo python /var/www/on.py'); } if (isset($_POST['RedOFF'])) { exec('sudo python off.py'); } ?> <title>Hub</title> </head> <body>...
python,if-statement,raspberry-pi,global-variables,bottle
I am having issues with my current Python script. The purpose of the 'progress' variable is take a specific value when it goes through one of the if-loops. But, the program never goes further then the first if-statement. It looks as if every if-statement makes his own variable called 'progress'....
bash,raspberry-pi,chmod,chown,raspberry-pi2
The /sys/class/gpio can only be access as root by default. So I like that a new group gpio can use the files and dirs under /sys/class/gpio. To achieve that I added the following lines to /etc/rc.local (I'm on Debian): sudo chown root:gpio /sys/class/gpio/unexport /sys/class/gpio/export sudo chmod 220 /sys/class/gpio/unexport /sys/class/gpio/export So...
c,linux,raspberry-pi,environment-variables,getenv
I have set an environment variable with the following command: QUERY_STRING='This is my query string' This is my program: #include <stdio.h> #include <stdlib.h> void main (int argc, char *argv[]) { printf("%s\n", getenv("QUERY_STRING")); } And this is what I get when I run the program: [email protected] /testing/cgi_download/temp $ echo $QUERY_STRING; ./a.out...
python,raspberry-pi
We have a timer and we want to stop one of the timer when one of the GPIO goes to 1 so far we have this code: #!/usr/bin/env python3 # -*- coding: utf-8 -*- from Tkinter import * import time from functools import partial import RPi.GPIO as GPIO class Chronometre(Frame):...
python,python-2.7,raspberry-pi
I am trying write a Python script to monitor a GPIO pin on the raspberry Pi continually. I wrote a script using event_detection, but it ends on completion. Is there any way to keep it checking for changes to the GPIO pin? #!/usr/bin/python import sys import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD)...
raspberry-pi,cross-platform,raspbian
I want to setup a cross compile environment on Linux for the Raspberry Pi 1. Especially I want to try bleeding edge version, i.e. Raspbian testing + Qt5 dev branch. This question: How can I create a modern cross compile toolchain for the Raspberry Pi 1? ...explains how to get...
raspberry-pi,sampling,i2c,gpio,inertial-navigation
I've connected DSLR to RPi by GPIO; and MPU6050 to RPi using I2C. I'm trying to record the gyro and accelerometer data in a small time window (typically less than 50ms) when I press camera shutter button. My desired sampling rate is somewhere in between 500Hz to 1000Hz. And I...
python,raspberry-pi,raspbian
I am working on a project, in which I have to interface multiple RFID Readers (I'm Using EM 18, With Serial out) with Raspberry Pi. I'm using an USB to TTL Converter to connect EM 18 to Raspberry Pi. I've connected two RFID Readers using USB to TTL Adapter. This...
mysql,raspberry-pi,mysqldump
I've started using Raspberry Pi few days back. I need to transfer a database from my Raspberry Pi to my PC. I've installed MySQL on the Raspberry Pi and put some data in the database. I've already installed MySQL on my PC. I need to transfer data from the MySQL...
node.js,raspberry-pi,hostname
I have this raspberryPi with Node.JS running on top of it. By calling os.hostname(), the Pi returns "raspberry". I'm aware on how to modify this behaviour. What I don't know is how to do so in order to have it return an IP. The raspberry is connected in a distributed...
python,while-loop,raspberry-pi,infinite-loop,raspbian
Hello I have been working on an infinite While True loop for the main file in my python code. I am working on a Raspberry Pi and my goal is that whenever one of the GPIO Pins senses an input it will print out a string. However When I push...
assembly,arm,raspberry-pi
Hello awesome community! I am just starting with learning Assembly Language. I am going to start with ARM Assembly on my Raspberry Pi B+, and later in want to learn Assembly for 64 bit Intel processors running Windows (8.1). But i was wondering if the assembler for the ARM processor...
c,printf,raspberry-pi,gpio
I'm trying a simple code that using wiringPi as here: #include<wiringPi.h> #include<stdio.h> int main(void){ int i; wirintPiSetup(); pinMode(0,OUTPUT); //a single LED pinMode(8,INPUT); //tactile switch for(;;){ delay(500); //push tactile switch and LED is turning on if(digitalRead(8)) digitalWrite(0,0); else digitalWrite(0,1); printf("%d",digitalRead(8)); } } I expected a result of printf() is output to...
c++,linux,qt,raspberry-pi,sudo
This question already has an answer here: How can my C/C++ application determine if the root user is executing the command? 4 answers I have a Qt GUI application that must be ran as sudo. Right now, I have a script that they are supposed to execute to start...
python,raspberry-pi
I am trying to run a python script at bootup which will take a ~10 second video on applying an external input (such as push button, IR sensor etc, and in our case an ultrasonic sensor), and then mail this video to specified email addresses using the SMTPlib library of...
raspberry-pi
I can control LED using the raspberry pi. I was wondering how to control house light bulbs with raspberry pi. I mean what are requirements?
python,linux,raspberry-pi
I am working with Python for the first time, and encountered the following issue, while running it on a Raspberry Pi Version B+ rev 2: The code is supposed to set an interrupt on pin 22 (BCM), and when a button is pressed, halt the OS: # Import the modules...
c++,linux,linux-kernel,raspberry-pi,embedded-linux
Is there some sort of documentation for what kind of headers you can include in c++ files when writing programs for Raspberry Pi or linux in general? For instance I found this great guide on how to access the SPI bus from the Pi using c++ (http://hertaville.com/2013/07/24/interfacing-an-spi-adc-mcp3008-chip-to-the-raspberry-pi-using-c/) I was able...
python,raspberry-pi
this my first python code i am trying to connect to a database , i defined a class called Database in a python file called mysqlConnection.py but when i run the code i get this error : Traceback (most recent call last): File "mysqlConnection.py", line 3, in <module> class Database:...
c++,linux,gps,raspberry-pi,gpsd
I am working on a GPS application on the Raspberry pi. I have just installed GPSD by running sudo apt-get install gpsd gpsd-clients. I do get data from my GPS module when I run sudo gpsd /dev/ttyAMA0 -F /var/run/gpsd.sock. My issue resides when I try to make my own GPS...
ubuntu,raspberry-pi,raspberry-pi2
I just got a Raspberry Pi 2 and put Ubuntu on a microSD card with Win32 Disk Imager. When starting up I get the following: Ubuntu 14.04.2 LTS ubuntu login: What should I type in there?...
windows,powershell,raspberry-pi
I am trying to install Windows 10 IoT on my Raspberry Pi 2. The PowerShell documentation tells me to put in this: Set-Item WSMan:\localhost\Client\TrustedHosts -Value <minwinpc> However, when I put it into my Windows 7 PowerShell, this comes out: At line:1 char:54 + Set-Item WSMan:\localhost\Client\TrustedHosts -Value <minwinpc> + ~ The...
sockets,python-2.7,raspberry-pi
I have two servers and my client want to send same data to both server.but if server1 fails to connect client program waits and server2 is not getting data. I want to wait 1s for server1 if it fails to connect then server2 will get data. import socket s1 =...
python,linux,raspberry-pi,chromium
I am trying to write a script that makes it possible to change the url of an active process. So for instance, I am starting my browser using: browser = Popen(["chromium", "http://www.google.com"]) After an X interval I want to change the url of browser. I've tried allot of things to...
python,raspberry-pi
I have a simple Python program that asks yes or no question and I validate that input. If I run this Python shell, it runs fine. If I enter invalid characters it loops back to top of while. However, if I run this in the terminal window and try to...
arm,raspberry-pi,cross-compiling,raspbian,ellcc
I have an empty program in LLVM IR: define i32 @main(i32 %argc, i8** %argv) nounwind { entry: ret i32 0 } I'm cross-compiling it on Intel x86-64 Windows for ARM Linux using ELLCC, with the following command: ecc++ hw.ll -o hw.o -target arm-linux-engeabihf It completes without errors and generates an...
php,android,mysql,database,raspberry-pi
I have a question regarding my database and being able to use my db everywhere. So currently me and some friends are developing an application for android, this application reads alot from his data from a MySQL Database. Currently we are working on the database design and tought by ourself,...
python,opencv,numpy,opengl-es,raspberry-pi
I'm using pi3d to display an ImageSprite on the screen the texture of which comes form an image I'm loading. displayTexture = pi3d.Texture("display/display.jpg", blend=True, mipmap=True) displaySlide = pi3d.ImageSprite(texture=displayTexture, shader=shader, w=800, h=600) This texture image is actually something I'm creating in-program. It's an openCV2 image and therefore just a numpy array....
javascript,node.js,raspberry-pi,raspbian,web-ide
I'm building a simple infrared breakbeam circuit to plug into my RPi 2. I have some working code in python that successfully picks up when my infrared beam is broken, but I want to use node.js instead of python. Here is my python code, nice and simple: import RPi.GPIO as...
linux,node.js,raspberry-pi
EDIT: As per Jim Rush's advice I'm now using rc.local instead of init.d direclty to run forever start on boot up. I'm wracking my head on this one. I'm wanting to start a node app on the raspberry pi startup and reboot. I'm using forever to actually call the app...
python,raspberry-pi
this my first python code , i am trying to connect to data base , i think the connection part was processed successfully import MySQLdb class Database: host = "localhost" user = "root" passwd = "root" db = "pitest" def __init__(self): self.connection = MySQLdb.connect( host = self.host, user = self.user,...
c++,cmake,arm,raspberry-pi,cross-compiling
I'd like to add Raspberry Pi as a cross compilation target to a C++ project which uses CMake. Following the accepted answer to this question, I've set up the environment successfully. The project has many build targets already, all of them defined in the main CMakeLists.txt in a quite ugly...
linux,opencv,cmake,raspberry-pi
I am trying to build and install TBB library from source so that it can be used for OpenCV to take advantages of multiple cores on my raspberry pi. I was able to build TBB from source without any problems using this steps. (Source : How do I build OpenCV...
node.js,raspberry-pi
I am running a raspberry pi B+ with the intentions of running a node js app on boot. I am using the command su pi -c 'node /home/pi/bartender_main/app.js < /dev/null &' in my /etc/rc.local file. When it boots up it act like it work and give me my indication that...
python,python-2.7,raspberry-pi,wifi
I am using Python 2.7 and wifi library (https://wifi.readthedocs.org/en/latest/) on a Raspberry Pi. I have managed to install wifi library using: sudo pip install wifi on the terminal. The library seems to work but I can't figure out the way to connect to a wifi using a password. The documentation...
linux,debian,raspberry-pi
Is there an easy way to start my File Manager in GUI as root? All I want to do is temporarily create/update some files and I want to do it through the GUI. I am using a Raspberry Pi that is running Wheezy....
bluetooth,raspberry-pi,emulation,bluez
I'm trying to configure my Ipega PG-9025 with Retropie with no succeed. I made some progress following this link (http://askubuntu.com/questions/608386/using-ipega-bluetooth-gamepad-with-steam-linux) but it only works at Emulation Station menu... The gamepad stops working in every emulation system and also gives me some problems pairing and reconnecting my device. Has someone any...
python,tkinter,raspberry-pi
I have a script here that is suppose to use a command to output the temperature of a RPi. from tkinter import * import subprocess win = Tk() f1 = Frame( win ) while True: output = subprocess.check_output('/opt/vc/bin/vcgencmd measure_temp', shell=True) tp = Label( f1 , text='Temperature: ' + str(output[:-1])) f1.pack()...
python,rest,flask,raspberry-pi
I am creating a web interface for OMXPlayer on the Raspberry Pi. I'm trying to create a more REST like API for controlling the video while its playing. The issue I'm having is how to control the video while it is playing. Currently I can create a Player object which...
memory,raspberry-pi,raspbian,raspberry-pi2
In short What file(s) or program(s) controls how much memory is found and can be used by your OS. In my case Raspbian on the Raspberry Pi 2 B+ (kernel version 3.18)? More info I tried to install a touchscreen. For this I had to replace: - kernel.img - kernel7.img...
ssh,raspberry-pi,samba
I have a raspberry Pi at home that I can access over the internet using SSH (using only key authentication), which is behind a TP-Link router. This router has a hard drive attached to it, which I can access as a samba share locally using the router's IP address. I...
python,raspberry-pi,gpio
I have a Raspberry Pi installed to switch on some relays. The script is super simple: import RPi.GPIO as GPIO RELAY_PIN_1 = 18 RELAY_PIN_2 = 19 RELAY_PIN_3 = 20 RELAY_PIN_4 = 21 def main(): GPIO.setmode(GPIO.BCM) GPIO.setup(RELAY_PIN_1, GPIO.OUT) GPIO.setup(RELAY_PIN_2, GPIO.OUT) GPIO.setup(RELAY_PIN_3, GPIO.OUT) GPIO.setup(RELAY_PIN_4, GPIO.OUT) GPIO.output(RELAY_PIN_1, GPIO.HIGH) GPIO.output(RELAY_PIN_2, GPIO.HIGH) GPIO.output(RELAY_PIN_3, GPIO.HIGH) GPIO.output(RELAY_PIN_4,...
raspberry-pi
I'm programming a website where you can choose mp3's to play from a playlist. The webiste must be accessed from a Raspberry Pi. The Raspberry has 3 buttons(next, previous, pause). Can I control the playlist with the buttons? So when I press next, the next song on the website will...
c++,linux,bash,shell,raspberry-pi
I'm using a Raspberry Pi model B with a raspbian and kernel 3.18. What I do is just going through a loop with execution calculation. Loop function looks like this. for(;;) { Timer.get_dt(); ...some print stuff... } and Timer.get_dt() is: oldtime_ = time_; clock_gettime(CLOCK_MONOTONIC, &time_); Timer.dt = ((static_cast<int64_t>(time_.tv_sec) * 1000000000...
c++,raspberry-pi,c++14,chrono
On a Raspberry Pi 2, I need to call a php file on a regular basis, typically every 100ms. I found this c++ code which looks like it does what I need and a test version of it compiles and runs fine using CodeBlock on Windows. I've updated the wheezy...
audio,raspberry-pi,audio-recording,sox,voice-recording
Currently, I use sox like this: sox -d -e u-law --endian little -b 8 -c 1 -r 8000 -t ul - silence 1 0.3 1% 1 0.3 1% For reference, this is recording audio from the default microphone and outputting little endian, ulaw formatted audio at 8 bits and a...
audio,raspberry-pi,adc
Hello I'm using ADC to read voice (from client 1) then I send it to a server from which client 2 can read it. I tried to register values I got in an array and read it through windows media player to be sure that sound is well recorded but...
raspberry-pi,mqtt,gpio
I installed a fresh and clean new raspbian onto a raspberry pi A+ and added the 1.4.2 mosquitto package from mosquitto.org. With mqtt-gpio-Monitor from https://github.com/sumnerboy12/mqtt-gpio-monitor/issues/3 i try to connect but always get an error saying connection refused. Mosquitto_sub works without issues and connects correctly. The mosquitto service is listening on...
c++,linux,time,raspberry-pi,real-time
Question can look blurry since it's hard to describe a problem in one line so here it goes. I use Debian on Raspberry Pi to run a PID regulator which means dt(time difference between loop executions) is obtained every time PID output is calculated. Basically dt is calculated like this....
linux,r,windows,ssh,raspberry-pi
I'm attempting to read files stored in Raspberry Pi (Raspbian) directly to Windows 7 using R. To be specific, here are what I've done so far. 1. Install R 3.1.2 on Windows 7 2. Install Raspbian on Raspberry Pi, stored some text data files in Raspberry Pi. 3. Attempt to...
python,serial-port,raspberry-pi,pyserial
I'm using a USB to RS232 cable for get communication with a pure rs232 device. With pyserial lib a got this code running in loopback tx -> rx cable pins. Setting the port: def __init__ (self, baudrate,timeout,parity,stopbits,bytesize): try: #self.s = serial.Serial(port="'/dev/ttyUSB0'",baudrate=baudrate,timeout=timeout,parity=parity,stopbits=stopbits,bytesize=bytesize) #self.s = serial.Serial("/dev/ttyUSB0",9600) self.s=serial.Serial( "/dev/ttyUSB0", baudrate=9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE,...
ssh,raspberry-pi,raspbian
I have a series of RPi's running Raspian which need to deployed in various location around the world. They will have internet access, but will all be behind a router. Is there an off-the-shelf solution to keep the possibility to create a SSH connection to them? I am thinking about...
python,linux,raspberry-pi,interrupt
I got a piece of code in Python from here: http://www.raspberry-pi-geek.com/Archive/2013/01/Adding-an-On-Off-switch-to-your-Raspberry-Pi And I wanted to improve on it. Since this is the first time I work with Python, I got stuck on understanding what actually happens. Here is the code: # Import the modules to send commands to the system...
python,sql,raspberry-pi
when i run this code in my raspberry-pi nothing happend and the code runs smouthly but there no results #!/usr/bin/python import MySQLdb db = MySQLdb.connect(host="localhost", # your host, usually localhost user="root", # your username passwd="raspberry", # your password db="raspberry") # name of the data base cur = db.cursor() cur.execute("UPDATE visitors...
keyboard,kernel,raspberry-pi,cross-compiling,boot
I'm trying to cross-compile a driver for Raspberry Pi. The driver works in kernel 3.2 so I downloaded the 3.2.27 raspberry pi's kernel. I compiled the kernel as follows: make -j3 ARCH=arm CROSS_COMPILE=<dir>/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- make -j3 ARCH=arm CROSS_COMPILE=<dir>/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- modules make -j3 ARCH=arm...
linux,raspberry-pi,raspbian
So I finally made some progress with Samba on my Raspberry Pi. I can now see (from Windows 7) my shared pi folder and create a text file. Yay! However, now, if I save a file in Windows 7 and open in Raspbian, I can open it but I can't...