<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://elinux.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://elinux.org/api.php?action=feedcontributions&amp;user=Atniptw&amp;feedformat=atom</id>
		<title>eLinux.org - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://elinux.org/api.php?action=feedcontributions&amp;user=Atniptw&amp;feedformat=atom"/>
		<link rel="alternate" type="text/html" href="http://elinux.org/Special:Contributions/Atniptw"/>
		<updated>2013-06-19T20:10:58Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.22alpha</generator>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-11-09T07:41:28Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{BeagleVNSHead}}&lt;br /&gt;
[[File:BeagleVNS.png|thumb|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
10 Executive Summary (Looks good.  Be sure to keep it up to date)&lt;br /&gt;
00 Installation Instructions (I suggest putting the Hardware section before the software)&lt;br /&gt;
05 User Instructions (How do I make sendmail work on my Bone?)&lt;br /&gt;
00 Highlights (Not done yet)&lt;br /&gt;
00 Theory of Operation (ditto)&lt;br /&gt;
10 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments: I'm looking forward to seeing the completed project.&lt;br /&gt;
&lt;br /&gt;
Score:  25/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:WhereIsYoder.png|thumb|Where is Dr. Yoder?]]&lt;br /&gt;
[[File:WhereIsYoder2.png|thumb|I'll leave him a message]]&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
At this time, we have a method for capturing audio for a specified amount of time and encoding that recording into a mp3 file.  We also have python script that allows the user to send email messages to another email by running a script.  We also have a working external power source for the beagle.&lt;br /&gt;
&lt;br /&gt;
The wireless usb adapter does not work at this time.  We are still trying to get recompile the kernel to install and enable the driver for this wireless adapter.&lt;br /&gt;
&lt;br /&gt;
Overall we are looking at creating a c program that will record the audio while the button is being pressed.  Once the button has been released the program will encode the raw audio into mp3 format, and then attach it via an email and send it to the owner of the Beagle VNS system.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
[[File:BeagleBone_256x249.jpg|320px|thumb|right|BeagleBone]]&lt;br /&gt;
[[File:PlayStation-Eye.png|thumb|right|PlayStation Eye]]&lt;br /&gt;
[[File:Belkin_N150_Micro_Wireless_USB_Adapter.png|thumb|right|Belkin N150 Micro Wireless USB Adapter]]&lt;br /&gt;
&lt;br /&gt;
*BeagleBone&lt;br /&gt;
&lt;br /&gt;
::This project is design primarily for the BeagleBone, but could be implemented on any other Beagle Board given the proper driver installation for the USB hardware and available GPIOs. The BeagleBone is applicable for this project due to is small size, low power consumption, and networking capabilities. Make sure to use the A5 image of Ångström as the A6 image is still buggy with respect to audio/video capturing, as well as using the USB WiFi drivers.&lt;br /&gt;
&lt;br /&gt;
::Further BeagleBone documentation can be found on the official [http://beagleboard.org Beagle Board] website.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [https://www.adafruit.com/products/513 here]  &lt;br /&gt;
&lt;br /&gt;
*Camera&lt;br /&gt;
&lt;br /&gt;
::In this project tutorial, we will be using the [http://en.wikipedia.org/wiki/PlayStation_Eye  PlayStation Eye] as the audio and video source to recod messages and capture face images. The PlayStation Eye is very compatible with the A5 image of Ångström and used in many other Beagle embedded Linux projects.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html here]  &lt;br /&gt;
&lt;br /&gt;
*Wifi dongle&lt;br /&gt;
&lt;br /&gt;
::Here we would like to use a WiFi dongle to easily connect to surrounding wireless networks for ease of installation and placement in the remote stretches of hallways and doorframes. We will need we will need network connectivity to transmit e-mails and recording attachments over to an available e-mail server account. In particularly we are using the [http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]. &lt;br /&gt;
&lt;br /&gt;
::Although this device is not natively supported with the stock A5 image of Ångström, a brief tutorial has already been made on how to compile and install the device drivers for this particular wireless USB adapter: [http://embeddedgeeks.wordpress.com/2012/01/03/belkin-micro-wifi-usb-dongle-on-the-beagleboard/ Belkin Micro Wi-Fi USB dongle on the BeagleBoard]&lt;br /&gt;
&lt;br /&gt;
*Battery Pack and USB Hub&lt;br /&gt;
&lt;br /&gt;
::To again better a ease installation and quick deployment for our system we are using a battery pack to provide power for the BeagleBone, the WiFi dongle and the USB camera. Due to the hottest limitations of the Beagle bones single USB port, in addition to the limited amount of current that the single USB port can provide, we will also use a USB hub with power adapter to solve both issues.&lt;br /&gt;
&lt;br /&gt;
::Specific products we are using included [http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger] and [http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
*Doorbell&lt;br /&gt;
&lt;br /&gt;
::In order for the end user to trigger the recording sequence, we will implement a traditional mechanical momentary pushbutton that will connect to the BeagleBone’s GPIO using the enabled internal pull-up resistors.&lt;br /&gt;
&lt;br /&gt;
*LED&lt;br /&gt;
&lt;br /&gt;
::As a simple display, our project will utilize a simple LED as an indicator for the user that the audio is currently being recorded and that a face capture will be taken.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
*'''Angstrom A5 Image'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the camera drivers for the playstation eye you will need to install the A5 image on the beagle bone.  To do this you will need to download the A5 image.  Then you will need to install this image on the sd card of the BeagleBone using the instructions bases on [http://elinux.org/EBC_Exercise_03_Installing_a_Beagle_OS| ECE 497 Exercise 03 Installing a Beagle OS].&lt;br /&gt;
&lt;br /&gt;
*'''github'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the project code for the Beagle VNS, you will need github installed in order to download the code.  If you do not have github there are instruction on how to install it on the [[EBC Exercise 16 git |ECE Exercise 16]] web page.&lt;br /&gt;
&lt;br /&gt;
::To download the code for the Beagle VNS run the following code:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''git clone git://github.com/geislekj/BeagleBoardVNS.git'''&lt;br /&gt;
&lt;br /&gt;
*'''Python'''&lt;br /&gt;
&lt;br /&gt;
::Python is natively installed on the Beagle operating system.  However it is important to note that the program will be using a python script to send email.&lt;br /&gt;
&lt;br /&gt;
*'''ALSA'''&lt;br /&gt;
&lt;br /&gt;
::The project uses ALSA drivers in order to record audio from a microphone device.&lt;br /&gt;
&lt;br /&gt;
::In order to download the ALSA drivers you will need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg update'''&lt;br /&gt;
 beagle$ '''opkg install alsa-utils-aplay alsa-utils-amixer'''&lt;br /&gt;
&lt;br /&gt;
*'''Lame'''&lt;br /&gt;
&lt;br /&gt;
::Lame is a audio encoder that will take raw audio and convert it into an mp3 format.&lt;br /&gt;
&lt;br /&gt;
::To install the lame onto the beagle board you will need to run the following command.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg install lame'''&lt;br /&gt;
&lt;br /&gt;
*GStreamer&lt;br /&gt;
&lt;br /&gt;
::GStreamer is an application that allows the user to capture video from a camera for multiple types of solutions.  For this project, it is being used to capture an image of the person leaving a message.&lt;br /&gt;
&lt;br /&gt;
::Instructions to install GStreamer is still in the process of being developed.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
*'''Basic Command Line Examples'''&lt;br /&gt;
&lt;br /&gt;
:: In order to give you a feel to how the program is capturing and sending emails.  Here is a short run down of how the program works&lt;br /&gt;
&lt;br /&gt;
:*'''Audio Capture'''&lt;br /&gt;
&lt;br /&gt;
::: In order to capture audio, the project uses arecord.  This application allows you to grab audio from a microphone that is attached to your device and save to the current directory in a raw format.  &lt;br /&gt;
&lt;br /&gt;
:::Here is an example command that allows you to record audio and then pipe the audio into aplay to instantaneously hear feedback:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 | aplay'''&lt;br /&gt;
&lt;br /&gt;
:::In order to encode the audio into mp3 format, you will need to pipe the audio into lame instead of aplay.&lt;br /&gt;
&lt;br /&gt;
:::Here is an example of this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 -r 16000 -f S16_LE -c 2 -t raw -d 3 | lame  -s 16 -r - blackbird.mp3'''&lt;br /&gt;
&lt;br /&gt;
::: For more information about ALSA and how to use many of its interesting features visit [http://www.lvr.com/access_usb_devices_from_linux.htm | Jan Axelson's Lakeview Research web page]&lt;br /&gt;
&lt;br /&gt;
:*'''Email Script'''&lt;br /&gt;
&lt;br /&gt;
::: A python mail client that prompts the user for information to send an email with optional attachments.&lt;br /&gt;
&lt;br /&gt;
  python smtp-mail-client-attachments.py&lt;br /&gt;
&lt;br /&gt;
  Send To (Separated by a comma): &lt;br /&gt;
  Files (Separated by a comma): &lt;br /&gt;
  Send From: beagle497@gmail.com #Must use this email for now&lt;br /&gt;
  Subject: &lt;br /&gt;
  Message:&lt;br /&gt;
&lt;br /&gt;
*'''Install Instructions'''&lt;br /&gt;
&lt;br /&gt;
::Currently as long as the arecord libraries are installed and nodejs is install, no other installation is required. The app file will use files that are contained in the git repository. The python script does not need any additional packages, and the javascript libraries are also located in the repository.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;What do I have to change to make this work in my Bone?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
This device is intended to record audio messages from students when professors are out of their office. The device will sit outside a professors office and will have a microphone and user button attached. A student who wishes to leave a message will press and hold the button then begin speaking, when the student has finished speaking they will release the button. The software will then save the audio file and then send the file as a mp3 to the user specified email. &lt;br /&gt;
&lt;br /&gt;
As a user the professor will be able to modify the default preferences such as email to send to and the message that they receive.&lt;br /&gt;
&lt;br /&gt;
The system consists of a C program that runs at start-up and checks for the button press. When it picks up that the button has been pressed is creates an audio process that begins recording until the button is released. The system then calls on a python mail client script passing in the location of the newly created audio file. The python script then reads from the user preferences and sends an email accordingly.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Acquire Hardware - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''2.''' Set up project page - Tom &amp;amp; Kevin&lt;br /&gt;
:::Page made and updated&lt;br /&gt;
'''3.''' Get USB wireless to work - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is not working at this time for A6 image&lt;br /&gt;
'''4.''' Get PlayStation Eye to work - Tom&lt;br /&gt;
:::Audio working, need to use A5 image&lt;br /&gt;
:::Passing capture video on to Ruffin&lt;br /&gt;
'''5.''' Get BeagleBoard Bone to run off a battery pack - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''6.''' Register an email for the BeagleBoard - Ruffin&lt;br /&gt;
:::Google acound made, along with Gmail and Google vouice accounts&lt;br /&gt;
'''7.''' Create an email script to send email with attachments - Tom&lt;br /&gt;
:::Email sending&lt;br /&gt;
'''8.''' Encode the raw audio from ALSA into mp3 format - Kevin&lt;br /&gt;
:::Able to record on bone, use lame to convert file, and SCP to send to PC and listen to the recording&lt;br /&gt;
'''9.''' Capture an image using GStreamer - Kevin &amp;amp; Tom&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''10.''' Create a C program to capture the audio and listen for GPIO inputs - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''11.''' Putting all the pieces together - Tom, Kevin, &amp;amp; Ruffin&lt;br /&gt;
:::Making c file for initializing GPIOs, interrupts and start up scripts for VNS server&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * main.c&lt;br /&gt;
 *&lt;br /&gt;
 * ============================================================================&lt;br /&gt;
 * Copyright (c) Texas Instruments Inc 2005&lt;br /&gt;
 *&lt;br /&gt;
 * Use of this software is controlled by the terms and conditions found in the&lt;br /&gt;
 * license agreement under which this software has been supplied or provided.&lt;br /&gt;
 * ============================================================================&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
// Standard Linux headers&lt;br /&gt;
#include     &amp;lt;stdio.h&amp;gt;              // Always include this header&lt;br /&gt;
#include     &amp;lt;stdlib.h&amp;gt;             // Always include this header&lt;br /&gt;
#include     &amp;lt;signal.h&amp;gt;             // Defines signal-handling functions (i.e. trap Ctrl-C)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Application headers&lt;br /&gt;
#include     &amp;quot;debug.h&amp;quot;&lt;br /&gt;
// #include     &amp;quot;audio_thread.h&amp;quot;&lt;br /&gt;
#include     &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
// Global audio thread environment&lt;br /&gt;
// audio_thread_env audio_env = {0};&lt;br /&gt;
&lt;br /&gt;
/* Store previous signal handler and call it */&lt;br /&gt;
void (*pSigPrev)(int sig);&lt;br /&gt;
&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
    DBG( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
   //  audio_env.quit = 1;&lt;br /&gt;
&lt;br /&gt;
    if( pSigPrev != NULL )&lt;br /&gt;
        (*pSigPrev)( sig );&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//*****************************************************************************&lt;br /&gt;
//*  main&lt;br /&gt;
//*****************************************************************************&lt;br /&gt;
int main( int argc, char *argv[] )&lt;br /&gt;
{&lt;br /&gt;
    int   status = EXIT_SUCCESS;&lt;br /&gt;
&lt;br /&gt;
    void *audioThreadReturn;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // Set the signal callback for Ctrl-C&lt;br /&gt;
    pSigPrev = signal( SIGINT, signal_handler );&lt;br /&gt;
    DBG( &amp;quot;Registered SIGINT signal handler.\n&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
	// button values&lt;br /&gt;
	int button = 16;&lt;br /&gt;
	int bButton = 1;&lt;br /&gt;
	int bValue = 0;&lt;br /&gt;
	button =  (bButton*32)+button;&lt;br /&gt;
	exportgpio(button);&lt;br /&gt;
&lt;br /&gt;
	//SET DIRECTION&lt;br /&gt;
	setdirection(button,1);	&lt;br /&gt;
	&lt;br /&gt;
//	printf(&amp;quot;ENTER&amp;quot;);&lt;br /&gt;
    while(1){&lt;br /&gt;
//	printf(&amp;quot;Button:%d&amp;quot;,bValue);&lt;br /&gt;
	bValue = gpioRead(button);&lt;br /&gt;
	if(bValue){&lt;br /&gt;
		printf(&amp;quot;Button Pushed&amp;quot;);&lt;br /&gt;
		//Grab the audio from the microphone while the button is pressed&lt;br /&gt;
		//audioThreadReturn = audio_thread_fxn( (void *) &amp;amp;audio_env, button);&lt;br /&gt;
		//runs a script that will take the raw file saved and encode it to mp3 useing lame and send via email.&lt;br /&gt;
 		system(&amp;quot;./../BeagleVNSScript&amp;quot;);&lt;br /&gt;
	}	&lt;br /&gt;
//	sleep(100);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import smtplib, os, sys&lt;br /&gt;
#from getpass import getpass&lt;br /&gt;
from email.MIMEMultipart import MIMEMultipart&lt;br /&gt;
from email.MIMEBase import MIMEBase&lt;br /&gt;
from email.MIMEText import MIMEText&lt;br /&gt;
from email.Utils import COMMASPACE, formatdate&lt;br /&gt;
from email import Encoders&lt;br /&gt;
from PREFERENCES import *&lt;br /&gt;
&lt;br /&gt;
#def send_mail(send_files=&amp;quot;&amp;quot;):&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    #This version promts the user to specify recipient, files,&lt;br /&gt;
    #subject, and message. The version for incorperating in the&lt;br /&gt;
    #notifier will need to read from a preferences file that &lt;br /&gt;
    #should be modifiable by the user.&lt;br /&gt;
    print sys.argv[1]&lt;br /&gt;
    send_to = SEND_TO&lt;br /&gt;
    files = sys.argv[1]&lt;br /&gt;
&lt;br /&gt;
    send_to=send_to.split(',')&lt;br /&gt;
    files=filter(None, files.split(','))&lt;br /&gt;
&lt;br /&gt;
    #Make sure that we are working with a list&lt;br /&gt;
    assert type(send_to)==list&lt;br /&gt;
    assert type(files)==list&lt;br /&gt;
&lt;br /&gt;
    send_from = SEND_FROM&lt;br /&gt;
    subject = SUBJECT&lt;br /&gt;
&lt;br /&gt;
    #Create a message object that we will be sending&lt;br /&gt;
    msg = MIMEMultipart()&lt;br /&gt;
    msg['From'] = send_from&lt;br /&gt;
    msg['To'] = COMMASPACE.join(send_to)&lt;br /&gt;
    msg['Date'] = formatdate(localtime=True)&lt;br /&gt;
    msg['Subject'] = subject&lt;br /&gt;
&lt;br /&gt;
    text = MESSAGE&lt;br /&gt;
&lt;br /&gt;
    msg.attach( MIMEText(text) )&lt;br /&gt;
&lt;br /&gt;
    #Attach files to message&lt;br /&gt;
    for f in files:&lt;br /&gt;
        part = MIMEBase('application', &amp;quot;octet-stream&amp;quot;)&lt;br /&gt;
        part.set_payload( open(f,&amp;quot;rb&amp;quot;).read() )&lt;br /&gt;
        Encoders.encode_base64(part)&lt;br /&gt;
        part.add_header('Content-Disposition', 'attachment; filename=&amp;quot;%s&amp;quot;' % os.path.basename(f))&lt;br /&gt;
        msg.attach(part)&lt;br /&gt;
&lt;br /&gt;
    #Open up a connection to the gmail servers on port 587&lt;br /&gt;
    server = smtplib.SMTP('smtp.gmail.com',587) #port 465 or 587&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    server.starttls()&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    #password = getpass()&lt;br /&gt;
    password=PASSWORD&lt;br /&gt;
    server.login(send_from, password)&lt;br /&gt;
    server.sendmail(send_from,&amp;quot;,&amp;quot;.join(send_to),msg.as_string())&lt;br /&gt;
    server.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if __name__ == '__main__':&lt;br /&gt;
#    send_mail()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Web Interface using HTML and NodeJS&lt;br /&gt;
# Web Interface to manage audio files&lt;br /&gt;
# Capture video along with audio&lt;br /&gt;
# Voice-To-Text&lt;br /&gt;
# Low Power Mode for longer battery life&lt;br /&gt;
# Authentication&lt;br /&gt;
&lt;br /&gt;
== Parts ==&lt;br /&gt;
&lt;br /&gt;
[http://beagleboard.org/bone Beagle Bone]&lt;br /&gt;
&lt;br /&gt;
[http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html PlayStation Eye]&lt;br /&gt;
&lt;br /&gt;
[http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]&lt;br /&gt;
&lt;br /&gt;
[http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger]&lt;br /&gt;
&lt;br /&gt;
[http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&amp;lt;br&amp;gt; Need More Cake &amp;lt;br&amp;gt; Want to discuss alsa limitations that prevented more advanced recording methods.&lt;br /&gt;
&lt;br /&gt;
{{BeagleVNSFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-11-09T07:40:32Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Conclusions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{BeagleVNSHead}}&lt;br /&gt;
[[File:BeagleVNS.png|thumb|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
10 Executive Summary (Looks good.  Be sure to keep it up to date)&lt;br /&gt;
00 Installation Instructions (I suggest putting the Hardware section before the software)&lt;br /&gt;
05 User Instructions (How do I make sendmail work on my Bone?)&lt;br /&gt;
00 Highlights (Not done yet)&lt;br /&gt;
00 Theory of Operation (ditto)&lt;br /&gt;
10 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments: I'm looking forward to seeing the completed project.&lt;br /&gt;
&lt;br /&gt;
Score:  25/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:WhereIsYoder.png|thumb|Where is Dr. Yoder?]]&lt;br /&gt;
[[File:WhereIsYoder2.png|thumb|I'll leave him a message]]&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
At this time, we have a method for capturing audio for a specified amount of time and encoding that recording into a mp3 file.  We also have python script that allows the user to send email messages to another email by running a script.  We also have a working external power source for the beagle.&lt;br /&gt;
&lt;br /&gt;
The wireless usb adapter does not work at this time.  We are still trying to get recompile the kernel to install and enable the driver for this wireless adapter.&lt;br /&gt;
&lt;br /&gt;
Overall we are looking at creating a c program that will record the audio while the button is being pressed.  Once the button has been released the program will encode the raw audio into mp3 format, and then attach it via an email and send it to the owner of the Beagle VNS system.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
[[File:BeagleBone_256x249.jpg|320px|thumb|right|BeagleBone]]&lt;br /&gt;
[[File:PlayStation-Eye.png|thumb|right|PlayStation Eye]]&lt;br /&gt;
[[File:Belkin_N150_Micro_Wireless_USB_Adapter.png|thumb|right|Belkin N150 Micro Wireless USB Adapter]]&lt;br /&gt;
&lt;br /&gt;
*BeagleBone&lt;br /&gt;
&lt;br /&gt;
::This project is design primarily for the BeagleBone, but could be implemented on any other Beagle Board given the proper driver installation for the USB hardware and available GPIOs. The BeagleBone is applicable for this project due to is small size, low power consumption, and networking capabilities. Make sure to use the A5 image of Ångström as the A6 image is still buggy with respect to audio/video capturing, as well as using the USB WiFi drivers.&lt;br /&gt;
&lt;br /&gt;
::Further BeagleBone documentation can be found on the official [http://beagleboard.org Beagle Board] website.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [https://www.adafruit.com/products/513 here]  &lt;br /&gt;
&lt;br /&gt;
*Camera&lt;br /&gt;
&lt;br /&gt;
::In this project tutorial, we will be using the [http://en.wikipedia.org/wiki/PlayStation_Eye  PlayStation Eye] as the audio and video source to recod messages and capture face images. The PlayStation Eye is very compatible with the A5 image of Ångström and used in many other Beagle embedded Linux projects.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html here]  &lt;br /&gt;
&lt;br /&gt;
*Wifi dongle&lt;br /&gt;
&lt;br /&gt;
::Here we would like to use a WiFi dongle to easily connect to surrounding wireless networks for ease of installation and placement in the remote stretches of hallways and doorframes. We will need we will need network connectivity to transmit e-mails and recording attachments over to an available e-mail server account. In particularly we are using the [http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]. &lt;br /&gt;
&lt;br /&gt;
::Although this device is not natively supported with the stock A5 image of Ångström, a brief tutorial has already been made on how to compile and install the device drivers for this particular wireless USB adapter: [http://embeddedgeeks.wordpress.com/2012/01/03/belkin-micro-wifi-usb-dongle-on-the-beagleboard/ Belkin Micro Wi-Fi USB dongle on the BeagleBoard]&lt;br /&gt;
&lt;br /&gt;
*Battery Pack and USB Hub&lt;br /&gt;
&lt;br /&gt;
::To again better a ease installation and quick deployment for our system we are using a battery pack to provide power for the BeagleBone, the WiFi dongle and the USB camera. Due to the hottest limitations of the Beagle bones single USB port, in addition to the limited amount of current that the single USB port can provide, we will also use a USB hub with power adapter to solve both issues.&lt;br /&gt;
&lt;br /&gt;
::Specific products we are using included [http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger] and [http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
*Doorbell&lt;br /&gt;
&lt;br /&gt;
::In order for the end user to trigger the recording sequence, we will implement a traditional mechanical momentary pushbutton that will connect to the BeagleBone’s GPIO using the enabled internal pull-up resistors.&lt;br /&gt;
&lt;br /&gt;
*LED&lt;br /&gt;
&lt;br /&gt;
::As a simple display, our project will utilize a simple LED as an indicator for the user that the audio is currently being recorded and that a face capture will be taken.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
*'''Angstrom A5 Image'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the camera drivers for the playstation eye you will need to install the A5 image on the beagle bone.  To do this you will need to download the A5 image.  Then you will need to install this image on the sd card of the BeagleBone using the instructions bases on [http://elinux.org/EBC_Exercise_03_Installing_a_Beagle_OS| ECE 497 Exercise 03 Installing a Beagle OS].&lt;br /&gt;
&lt;br /&gt;
*'''github'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the project code for the Beagle VNS, you will need github installed in order to download the code.  If you do not have github there are instruction on how to install it on the [[EBC Exercise 16 git |ECE Exercise 16]] web page.&lt;br /&gt;
&lt;br /&gt;
::To download the code for the Beagle VNS run the following code:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''git clone git://github.com/geislekj/BeagleBoardVNS.git'''&lt;br /&gt;
&lt;br /&gt;
*'''Python'''&lt;br /&gt;
&lt;br /&gt;
::Python is natively installed on the Beagle operating system.  However it is important to note that the program will be using a python script to send email.&lt;br /&gt;
&lt;br /&gt;
*'''ALSA'''&lt;br /&gt;
&lt;br /&gt;
::The project uses ALSA drivers in order to record audio from a microphone device.&lt;br /&gt;
&lt;br /&gt;
::In order to download the ALSA drivers you will need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg update'''&lt;br /&gt;
 beagle$ '''opkg install alsa-utils-aplay alsa-utils-amixer'''&lt;br /&gt;
&lt;br /&gt;
*'''Lame'''&lt;br /&gt;
&lt;br /&gt;
::Lame is a audio encoder that will take raw audio and convert it into an mp3 format.&lt;br /&gt;
&lt;br /&gt;
::To install the lame onto the beagle board you will need to run the following command.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg install lame'''&lt;br /&gt;
&lt;br /&gt;
*GStreamer&lt;br /&gt;
&lt;br /&gt;
::GStreamer is an application that allows the user to capture video from a camera for multiple types of solutions.  For this project, it is being used to capture an image of the person leaving a message.&lt;br /&gt;
&lt;br /&gt;
::Instructions to install GStreamer is still in the process of being developed.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
*'''Basic Command Line Examples'''&lt;br /&gt;
&lt;br /&gt;
:: In order to give you a feel to how the program is capturing and sending emails.  Here is a short run down of how the program works&lt;br /&gt;
&lt;br /&gt;
:*'''Audio Capture'''&lt;br /&gt;
&lt;br /&gt;
::: In order to capture audio, the project uses arecord.  This application allows you to grab audio from a microphone that is attached to your device and save to the current directory in a raw format.  &lt;br /&gt;
&lt;br /&gt;
:::Here is an example command that allows you to record audio and then pipe the audio into aplay to instantaneously hear feedback:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 | aplay'''&lt;br /&gt;
&lt;br /&gt;
:::In order to encode the audio into mp3 format, you will need to pipe the audio into lame instead of aplay.&lt;br /&gt;
&lt;br /&gt;
:::Here is an example of this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 -r 16000 -f S16_LE -c 2 -t raw -d 3 | lame  -s 16 -r - blackbird.mp3'''&lt;br /&gt;
&lt;br /&gt;
::: For more information about ALSA and how to use many of its interesting features visit [http://www.lvr.com/access_usb_devices_from_linux.htm | Jan Axelson's Lakeview Research web page]&lt;br /&gt;
&lt;br /&gt;
:*'''Email Script'''&lt;br /&gt;
&lt;br /&gt;
::: A python mail client that prompts the user for information to send an email with optional attachments.&lt;br /&gt;
&lt;br /&gt;
  python smtp-mail-client-attachments.py&lt;br /&gt;
&lt;br /&gt;
  Send To (Separated by a comma): &lt;br /&gt;
  Files (Separated by a comma): &lt;br /&gt;
  Send From: beagle497@gmail.com #Must use this email for now&lt;br /&gt;
  Subject: &lt;br /&gt;
  Message:&lt;br /&gt;
&lt;br /&gt;
*'''Install Instructions'''&lt;br /&gt;
&lt;br /&gt;
::Currently as long as the arecord libraries are installed and nodejs is install, no other installation is required. The app file will use files that are contained in the git repository. The python script does not need any additional packages, and the javascript libraries are also located in the repository.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;What do I have to change to make this work in my Bone?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
This device is intended to record audio messages from students when professors are out of their office. The device will sit outside a professors office and will have a microphone and user button attached. A student who wishes to leave a message will press and hold the button then begin speaking, when the student has finished speaking they will release the button. The software will then save the audio file and then send the file as a mp3 to the user specified email. &lt;br /&gt;
&lt;br /&gt;
As a user the professor will be able to modify the default preferences such as email to send to and the message that they receive.&lt;br /&gt;
&lt;br /&gt;
The system consists of a C program that runs at start-up and checks for the button press. When it picks up that the button has been pressed is creates an audio process that begins recording until the button is released. The system then calls on a python mail client script passing in the location of the newly created audio file. The python script then reads from the user preferences and sends an email accordingly.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Acquire Hardware - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''2.''' Set up project page - Tom &amp;amp; Kevin&lt;br /&gt;
:::Page made and updated&lt;br /&gt;
'''3.''' Get USB wireless to work - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is not working at this time for A6 image&lt;br /&gt;
'''4.''' Get PlayStation Eye to work - Tom&lt;br /&gt;
:::Audio working, need to use A5 image&lt;br /&gt;
:::Passing capture video on to Ruffin&lt;br /&gt;
'''5.''' Get BeagleBoard Bone to run off a battery pack - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''6.''' Register an email for the BeagleBoard - Ruffin&lt;br /&gt;
:::Google acound made, along with Gmail and Google vouice accounts&lt;br /&gt;
'''7.''' Create an email script to send email with attachments - Tom&lt;br /&gt;
:::Email sending&lt;br /&gt;
'''8.''' Encode the raw audio from ALSA into mp3 format - Kevin&lt;br /&gt;
:::Able to record on bone, use lame to convert file, and SCP to send to PC and listen to the recording&lt;br /&gt;
'''9.''' Capture an image using GStreamer - Kevin &amp;amp; Tom&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''10.''' Create a C program to capture the audio and listen for GPIO inputs - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''11.''' Putting all the pieces together - Tom, Kevin, &amp;amp; Ruffin&lt;br /&gt;
:::Making c file for initializing GPIOs, interrupts and start up scripts for VNS server&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import smtplib, os, sys&lt;br /&gt;
#from getpass import getpass&lt;br /&gt;
from email.MIMEMultipart import MIMEMultipart&lt;br /&gt;
from email.MIMEBase import MIMEBase&lt;br /&gt;
from email.MIMEText import MIMEText&lt;br /&gt;
from email.Utils import COMMASPACE, formatdate&lt;br /&gt;
from email import Encoders&lt;br /&gt;
from PREFERENCES import *&lt;br /&gt;
&lt;br /&gt;
#def send_mail(send_files=&amp;quot;&amp;quot;):&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    #This version promts the user to specify recipient, files,&lt;br /&gt;
    #subject, and message. The version for incorperating in the&lt;br /&gt;
    #notifier will need to read from a preferences file that &lt;br /&gt;
    #should be modifiable by the user.&lt;br /&gt;
    print sys.argv[1]&lt;br /&gt;
    send_to = SEND_TO&lt;br /&gt;
    files = sys.argv[1]&lt;br /&gt;
&lt;br /&gt;
    send_to=send_to.split(',')&lt;br /&gt;
    files=filter(None, files.split(','))&lt;br /&gt;
&lt;br /&gt;
    #Make sure that we are working with a list&lt;br /&gt;
    assert type(send_to)==list&lt;br /&gt;
    assert type(files)==list&lt;br /&gt;
&lt;br /&gt;
    send_from = SEND_FROM&lt;br /&gt;
    subject = SUBJECT&lt;br /&gt;
&lt;br /&gt;
    #Create a message object that we will be sending&lt;br /&gt;
    msg = MIMEMultipart()&lt;br /&gt;
    msg['From'] = send_from&lt;br /&gt;
    msg['To'] = COMMASPACE.join(send_to)&lt;br /&gt;
    msg['Date'] = formatdate(localtime=True)&lt;br /&gt;
    msg['Subject'] = subject&lt;br /&gt;
&lt;br /&gt;
    text = MESSAGE&lt;br /&gt;
&lt;br /&gt;
    msg.attach( MIMEText(text) )&lt;br /&gt;
&lt;br /&gt;
    #Attach files to message&lt;br /&gt;
    for f in files:&lt;br /&gt;
        part = MIMEBase('application', &amp;quot;octet-stream&amp;quot;)&lt;br /&gt;
        part.set_payload( open(f,&amp;quot;rb&amp;quot;).read() )&lt;br /&gt;
        Encoders.encode_base64(part)&lt;br /&gt;
        part.add_header('Content-Disposition', 'attachment; filename=&amp;quot;%s&amp;quot;' % os.path.basename(f))&lt;br /&gt;
        msg.attach(part)&lt;br /&gt;
&lt;br /&gt;
    #Open up a connection to the gmail servers on port 587&lt;br /&gt;
    server = smtplib.SMTP('smtp.gmail.com',587) #port 465 or 587&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    server.starttls()&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    #password = getpass()&lt;br /&gt;
    password=PASSWORD&lt;br /&gt;
    server.login(send_from, password)&lt;br /&gt;
    server.sendmail(send_from,&amp;quot;,&amp;quot;.join(send_to),msg.as_string())&lt;br /&gt;
    server.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if __name__ == '__main__':&lt;br /&gt;
#    send_mail()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Web Interface using HTML and NodeJS&lt;br /&gt;
# Web Interface to manage audio files&lt;br /&gt;
# Capture video along with audio&lt;br /&gt;
# Voice-To-Text&lt;br /&gt;
# Low Power Mode for longer battery life&lt;br /&gt;
# Authentication&lt;br /&gt;
&lt;br /&gt;
== Parts ==&lt;br /&gt;
&lt;br /&gt;
[http://beagleboard.org/bone Beagle Bone]&lt;br /&gt;
&lt;br /&gt;
[http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html PlayStation Eye]&lt;br /&gt;
&lt;br /&gt;
[http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]&lt;br /&gt;
&lt;br /&gt;
[http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger]&lt;br /&gt;
&lt;br /&gt;
[http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&amp;lt;br&amp;gt; Need More Cake &amp;lt;br&amp;gt; Want to discuss alsa limitations that prevented more advanced recording methods.&lt;br /&gt;
&lt;br /&gt;
{{BeagleVNSFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-11-09T07:39:24Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{BeagleVNSHead}}&lt;br /&gt;
[[File:BeagleVNS.png|thumb|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
10 Executive Summary (Looks good.  Be sure to keep it up to date)&lt;br /&gt;
00 Installation Instructions (I suggest putting the Hardware section before the software)&lt;br /&gt;
05 User Instructions (How do I make sendmail work on my Bone?)&lt;br /&gt;
00 Highlights (Not done yet)&lt;br /&gt;
00 Theory of Operation (ditto)&lt;br /&gt;
10 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments: I'm looking forward to seeing the completed project.&lt;br /&gt;
&lt;br /&gt;
Score:  25/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:WhereIsYoder.png|thumb|Where is Dr. Yoder?]]&lt;br /&gt;
[[File:WhereIsYoder2.png|thumb|I'll leave him a message]]&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
At this time, we have a method for capturing audio for a specified amount of time and encoding that recording into a mp3 file.  We also have python script that allows the user to send email messages to another email by running a script.  We also have a working external power source for the beagle.&lt;br /&gt;
&lt;br /&gt;
The wireless usb adapter does not work at this time.  We are still trying to get recompile the kernel to install and enable the driver for this wireless adapter.&lt;br /&gt;
&lt;br /&gt;
Overall we are looking at creating a c program that will record the audio while the button is being pressed.  Once the button has been released the program will encode the raw audio into mp3 format, and then attach it via an email and send it to the owner of the Beagle VNS system.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
[[File:BeagleBone_256x249.jpg|320px|thumb|right|BeagleBone]]&lt;br /&gt;
[[File:PlayStation-Eye.png|thumb|right|PlayStation Eye]]&lt;br /&gt;
[[File:Belkin_N150_Micro_Wireless_USB_Adapter.png|thumb|right|Belkin N150 Micro Wireless USB Adapter]]&lt;br /&gt;
&lt;br /&gt;
*BeagleBone&lt;br /&gt;
&lt;br /&gt;
::This project is design primarily for the BeagleBone, but could be implemented on any other Beagle Board given the proper driver installation for the USB hardware and available GPIOs. The BeagleBone is applicable for this project due to is small size, low power consumption, and networking capabilities. Make sure to use the A5 image of Ångström as the A6 image is still buggy with respect to audio/video capturing, as well as using the USB WiFi drivers.&lt;br /&gt;
&lt;br /&gt;
::Further BeagleBone documentation can be found on the official [http://beagleboard.org Beagle Board] website.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [https://www.adafruit.com/products/513 here]  &lt;br /&gt;
&lt;br /&gt;
*Camera&lt;br /&gt;
&lt;br /&gt;
::In this project tutorial, we will be using the [http://en.wikipedia.org/wiki/PlayStation_Eye  PlayStation Eye] as the audio and video source to recod messages and capture face images. The PlayStation Eye is very compatible with the A5 image of Ångström and used in many other Beagle embedded Linux projects.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html here]  &lt;br /&gt;
&lt;br /&gt;
*Wifi dongle&lt;br /&gt;
&lt;br /&gt;
::Here we would like to use a WiFi dongle to easily connect to surrounding wireless networks for ease of installation and placement in the remote stretches of hallways and doorframes. We will need we will need network connectivity to transmit e-mails and recording attachments over to an available e-mail server account. In particularly we are using the [http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]. &lt;br /&gt;
&lt;br /&gt;
::Although this device is not natively supported with the stock A5 image of Ångström, a brief tutorial has already been made on how to compile and install the device drivers for this particular wireless USB adapter: [http://embeddedgeeks.wordpress.com/2012/01/03/belkin-micro-wifi-usb-dongle-on-the-beagleboard/ Belkin Micro Wi-Fi USB dongle on the BeagleBoard]&lt;br /&gt;
&lt;br /&gt;
*Battery Pack and USB Hub&lt;br /&gt;
&lt;br /&gt;
::To again better a ease installation and quick deployment for our system we are using a battery pack to provide power for the BeagleBone, the WiFi dongle and the USB camera. Due to the hottest limitations of the Beagle bones single USB port, in addition to the limited amount of current that the single USB port can provide, we will also use a USB hub with power adapter to solve both issues.&lt;br /&gt;
&lt;br /&gt;
::Specific products we are using included [http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger] and [http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
*Doorbell&lt;br /&gt;
&lt;br /&gt;
::In order for the end user to trigger the recording sequence, we will implement a traditional mechanical momentary pushbutton that will connect to the BeagleBone’s GPIO using the enabled internal pull-up resistors.&lt;br /&gt;
&lt;br /&gt;
*LED&lt;br /&gt;
&lt;br /&gt;
::As a simple display, our project will utilize a simple LED as an indicator for the user that the audio is currently being recorded and that a face capture will be taken.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
*'''Angstrom A5 Image'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the camera drivers for the playstation eye you will need to install the A5 image on the beagle bone.  To do this you will need to download the A5 image.  Then you will need to install this image on the sd card of the BeagleBone using the instructions bases on [http://elinux.org/EBC_Exercise_03_Installing_a_Beagle_OS| ECE 497 Exercise 03 Installing a Beagle OS].&lt;br /&gt;
&lt;br /&gt;
*'''github'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the project code for the Beagle VNS, you will need github installed in order to download the code.  If you do not have github there are instruction on how to install it on the [[EBC Exercise 16 git |ECE Exercise 16]] web page.&lt;br /&gt;
&lt;br /&gt;
::To download the code for the Beagle VNS run the following code:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''git clone git://github.com/geislekj/BeagleBoardVNS.git'''&lt;br /&gt;
&lt;br /&gt;
*'''Python'''&lt;br /&gt;
&lt;br /&gt;
::Python is natively installed on the Beagle operating system.  However it is important to note that the program will be using a python script to send email.&lt;br /&gt;
&lt;br /&gt;
*'''ALSA'''&lt;br /&gt;
&lt;br /&gt;
::The project uses ALSA drivers in order to record audio from a microphone device.&lt;br /&gt;
&lt;br /&gt;
::In order to download the ALSA drivers you will need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg update'''&lt;br /&gt;
 beagle$ '''opkg install alsa-utils-aplay alsa-utils-amixer'''&lt;br /&gt;
&lt;br /&gt;
*'''Lame'''&lt;br /&gt;
&lt;br /&gt;
::Lame is a audio encoder that will take raw audio and convert it into an mp3 format.&lt;br /&gt;
&lt;br /&gt;
::To install the lame onto the beagle board you will need to run the following command.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg install lame'''&lt;br /&gt;
&lt;br /&gt;
*GStreamer&lt;br /&gt;
&lt;br /&gt;
::GStreamer is an application that allows the user to capture video from a camera for multiple types of solutions.  For this project, it is being used to capture an image of the person leaving a message.&lt;br /&gt;
&lt;br /&gt;
::Instructions to install GStreamer is still in the process of being developed.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
*'''Basic Command Line Examples'''&lt;br /&gt;
&lt;br /&gt;
:: In order to give you a feel to how the program is capturing and sending emails.  Here is a short run down of how the program works&lt;br /&gt;
&lt;br /&gt;
:*'''Audio Capture'''&lt;br /&gt;
&lt;br /&gt;
::: In order to capture audio, the project uses arecord.  This application allows you to grab audio from a microphone that is attached to your device and save to the current directory in a raw format.  &lt;br /&gt;
&lt;br /&gt;
:::Here is an example command that allows you to record audio and then pipe the audio into aplay to instantaneously hear feedback:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 | aplay'''&lt;br /&gt;
&lt;br /&gt;
:::In order to encode the audio into mp3 format, you will need to pipe the audio into lame instead of aplay.&lt;br /&gt;
&lt;br /&gt;
:::Here is an example of this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 -r 16000 -f S16_LE -c 2 -t raw -d 3 | lame  -s 16 -r - blackbird.mp3'''&lt;br /&gt;
&lt;br /&gt;
::: For more information about ALSA and how to use many of its interesting features visit [http://www.lvr.com/access_usb_devices_from_linux.htm | Jan Axelson's Lakeview Research web page]&lt;br /&gt;
&lt;br /&gt;
:*'''Email Script'''&lt;br /&gt;
&lt;br /&gt;
::: A python mail client that prompts the user for information to send an email with optional attachments.&lt;br /&gt;
&lt;br /&gt;
  python smtp-mail-client-attachments.py&lt;br /&gt;
&lt;br /&gt;
  Send To (Separated by a comma): &lt;br /&gt;
  Files (Separated by a comma): &lt;br /&gt;
  Send From: beagle497@gmail.com #Must use this email for now&lt;br /&gt;
  Subject: &lt;br /&gt;
  Message:&lt;br /&gt;
&lt;br /&gt;
*'''Install Instructions'''&lt;br /&gt;
&lt;br /&gt;
::Currently as long as the arecord libraries are installed and nodejs is install, no other installation is required. The app file will use files that are contained in the git repository. The python script does not need any additional packages, and the javascript libraries are also located in the repository.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;What do I have to change to make this work in my Bone?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
This device is intended to record audio messages from students when professors are out of their office. The device will sit outside a professors office and will have a microphone and user button attached. A student who wishes to leave a message will press and hold the button then begin speaking, when the student has finished speaking they will release the button. The software will then save the audio file and then send the file as a mp3 to the user specified email. &lt;br /&gt;
&lt;br /&gt;
As a user the professor will be able to modify the default preferences such as email to send to and the message that they receive.&lt;br /&gt;
&lt;br /&gt;
The system consists of a C program that runs at start-up and checks for the button press. When it picks up that the button has been pressed is creates an audio process that begins recording until the button is released. The system then calls on a python mail client script passing in the location of the newly created audio file. The python script then reads from the user preferences and sends an email accordingly.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Acquire Hardware - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''2.''' Set up project page - Tom &amp;amp; Kevin&lt;br /&gt;
:::Page made and updated&lt;br /&gt;
'''3.''' Get USB wireless to work - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is not working at this time for A6 image&lt;br /&gt;
'''4.''' Get PlayStation Eye to work - Tom&lt;br /&gt;
:::Audio working, need to use A5 image&lt;br /&gt;
:::Passing capture video on to Ruffin&lt;br /&gt;
'''5.''' Get BeagleBoard Bone to run off a battery pack - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''6.''' Register an email for the BeagleBoard - Ruffin&lt;br /&gt;
:::Google acound made, along with Gmail and Google vouice accounts&lt;br /&gt;
'''7.''' Create an email script to send email with attachments - Tom&lt;br /&gt;
:::Email sending&lt;br /&gt;
'''8.''' Encode the raw audio from ALSA into mp3 format - Kevin&lt;br /&gt;
:::Able to record on bone, use lame to convert file, and SCP to send to PC and listen to the recording&lt;br /&gt;
'''9.''' Capture an image using GStreamer - Kevin &amp;amp; Tom&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''10.''' Create a C program to capture the audio and listen for GPIO inputs - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''11.''' Putting all the pieces together - Tom, Kevin, &amp;amp; Ruffin&lt;br /&gt;
:::Making c file for initializing GPIOs, interrupts and start up scripts for VNS server&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import smtplib, os, sys&lt;br /&gt;
#from getpass import getpass&lt;br /&gt;
from email.MIMEMultipart import MIMEMultipart&lt;br /&gt;
from email.MIMEBase import MIMEBase&lt;br /&gt;
from email.MIMEText import MIMEText&lt;br /&gt;
from email.Utils import COMMASPACE, formatdate&lt;br /&gt;
from email import Encoders&lt;br /&gt;
from PREFERENCES import *&lt;br /&gt;
&lt;br /&gt;
#def send_mail(send_files=&amp;quot;&amp;quot;):&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    #This version promts the user to specify recipient, files,&lt;br /&gt;
    #subject, and message. The version for incorperating in the&lt;br /&gt;
    #notifier will need to read from a preferences file that &lt;br /&gt;
    #should be modifiable by the user.&lt;br /&gt;
    print sys.argv[1]&lt;br /&gt;
    send_to = SEND_TO&lt;br /&gt;
    files = sys.argv[1]&lt;br /&gt;
&lt;br /&gt;
    send_to=send_to.split(',')&lt;br /&gt;
    files=filter(None, files.split(','))&lt;br /&gt;
&lt;br /&gt;
    #Make sure that we are working with a list&lt;br /&gt;
    assert type(send_to)==list&lt;br /&gt;
    assert type(files)==list&lt;br /&gt;
&lt;br /&gt;
    send_from = SEND_FROM&lt;br /&gt;
    subject = SUBJECT&lt;br /&gt;
&lt;br /&gt;
    #Create a message object that we will be sending&lt;br /&gt;
    msg = MIMEMultipart()&lt;br /&gt;
    msg['From'] = send_from&lt;br /&gt;
    msg['To'] = COMMASPACE.join(send_to)&lt;br /&gt;
    msg['Date'] = formatdate(localtime=True)&lt;br /&gt;
    msg['Subject'] = subject&lt;br /&gt;
&lt;br /&gt;
    text = MESSAGE&lt;br /&gt;
&lt;br /&gt;
    msg.attach( MIMEText(text) )&lt;br /&gt;
&lt;br /&gt;
    #Attach files to message&lt;br /&gt;
    for f in files:&lt;br /&gt;
        part = MIMEBase('application', &amp;quot;octet-stream&amp;quot;)&lt;br /&gt;
        part.set_payload( open(f,&amp;quot;rb&amp;quot;).read() )&lt;br /&gt;
        Encoders.encode_base64(part)&lt;br /&gt;
        part.add_header('Content-Disposition', 'attachment; filename=&amp;quot;%s&amp;quot;' % os.path.basename(f))&lt;br /&gt;
        msg.attach(part)&lt;br /&gt;
&lt;br /&gt;
    #Open up a connection to the gmail servers on port 587&lt;br /&gt;
    server = smtplib.SMTP('smtp.gmail.com',587) #port 465 or 587&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    server.starttls()&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    #password = getpass()&lt;br /&gt;
    password=PASSWORD&lt;br /&gt;
    server.login(send_from, password)&lt;br /&gt;
    server.sendmail(send_from,&amp;quot;,&amp;quot;.join(send_to),msg.as_string())&lt;br /&gt;
    server.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if __name__ == '__main__':&lt;br /&gt;
#    send_mail()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Web Interface using HTML and NodeJS&lt;br /&gt;
# Web Interface to manage audio files&lt;br /&gt;
# Capture video along with audio&lt;br /&gt;
# Voice-To-Text&lt;br /&gt;
# Low Power Mode for longer battery life&lt;br /&gt;
# Authentication&lt;br /&gt;
&lt;br /&gt;
== Parts ==&lt;br /&gt;
&lt;br /&gt;
[http://beagleboard.org/bone Beagle Bone]&lt;br /&gt;
&lt;br /&gt;
[http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html PlayStation Eye]&lt;br /&gt;
&lt;br /&gt;
[http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]&lt;br /&gt;
&lt;br /&gt;
[http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger]&lt;br /&gt;
&lt;br /&gt;
[http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&amp;lt;br&amp;gt; Need More Cake&lt;br /&gt;
&lt;br /&gt;
{{BeagleVNSFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-11-09T07:37:50Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* User Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{BeagleVNSHead}}&lt;br /&gt;
[[File:BeagleVNS.png|thumb|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
10 Executive Summary (Looks good.  Be sure to keep it up to date)&lt;br /&gt;
00 Installation Instructions (I suggest putting the Hardware section before the software)&lt;br /&gt;
05 User Instructions (How do I make sendmail work on my Bone?)&lt;br /&gt;
00 Highlights (Not done yet)&lt;br /&gt;
00 Theory of Operation (ditto)&lt;br /&gt;
10 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments: I'm looking forward to seeing the completed project.&lt;br /&gt;
&lt;br /&gt;
Score:  25/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:WhereIsYoder.png|thumb|Where is Dr. Yoder?]]&lt;br /&gt;
[[File:WhereIsYoder2.png|thumb|I'll leave him a message]]&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
At this time, we have a method for capturing audio for a specified amount of time and encoding that recording into a mp3 file.  We also have python script that allows the user to send email messages to another email by running a script.  We also have a working external power source for the beagle.&lt;br /&gt;
&lt;br /&gt;
The wireless usb adapter does not work at this time.  We are still trying to get recompile the kernel to install and enable the driver for this wireless adapter.&lt;br /&gt;
&lt;br /&gt;
Overall we are looking at creating a c program that will record the audio while the button is being pressed.  Once the button has been released the program will encode the raw audio into mp3 format, and then attach it via an email and send it to the owner of the Beagle VNS system.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
[[File:BeagleBone_256x249.jpg|320px|thumb|right|BeagleBone]]&lt;br /&gt;
[[File:PlayStation-Eye.png|thumb|right|PlayStation Eye]]&lt;br /&gt;
[[File:Belkin_N150_Micro_Wireless_USB_Adapter.png|thumb|right|Belkin N150 Micro Wireless USB Adapter]]&lt;br /&gt;
&lt;br /&gt;
*BeagleBone&lt;br /&gt;
&lt;br /&gt;
::This project is design primarily for the BeagleBone, but could be implemented on any other Beagle Board given the proper driver installation for the USB hardware and available GPIOs. The BeagleBone is applicable for this project due to is small size, low power consumption, and networking capabilities. Make sure to use the A5 image of Ångström as the A6 image is still buggy with respect to audio/video capturing, as well as using the USB WiFi drivers.&lt;br /&gt;
&lt;br /&gt;
::Further BeagleBone documentation can be found on the official [http://beagleboard.org Beagle Board] website.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [https://www.adafruit.com/products/513 here]  &lt;br /&gt;
&lt;br /&gt;
*Camera&lt;br /&gt;
&lt;br /&gt;
::In this project tutorial, we will be using the [http://en.wikipedia.org/wiki/PlayStation_Eye  PlayStation Eye] as the audio and video source to recod messages and capture face images. The PlayStation Eye is very compatible with the A5 image of Ångström and used in many other Beagle embedded Linux projects.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html here]  &lt;br /&gt;
&lt;br /&gt;
*Wifi dongle&lt;br /&gt;
&lt;br /&gt;
::Here we would like to use a WiFi dongle to easily connect to surrounding wireless networks for ease of installation and placement in the remote stretches of hallways and doorframes. We will need we will need network connectivity to transmit e-mails and recording attachments over to an available e-mail server account. In particularly we are using the [http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]. &lt;br /&gt;
&lt;br /&gt;
::Although this device is not natively supported with the stock A5 image of Ångström, a brief tutorial has already been made on how to compile and install the device drivers for this particular wireless USB adapter: [http://embeddedgeeks.wordpress.com/2012/01/03/belkin-micro-wifi-usb-dongle-on-the-beagleboard/ Belkin Micro Wi-Fi USB dongle on the BeagleBoard]&lt;br /&gt;
&lt;br /&gt;
*Battery Pack and USB Hub&lt;br /&gt;
&lt;br /&gt;
::To again better a ease installation and quick deployment for our system we are using a battery pack to provide power for the BeagleBone, the WiFi dongle and the USB camera. Due to the hottest limitations of the Beagle bones single USB port, in addition to the limited amount of current that the single USB port can provide, we will also use a USB hub with power adapter to solve both issues.&lt;br /&gt;
&lt;br /&gt;
::Specific products we are using included [http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger] and [http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
*Doorbell&lt;br /&gt;
&lt;br /&gt;
::In order for the end user to trigger the recording sequence, we will implement a traditional mechanical momentary pushbutton that will connect to the BeagleBone’s GPIO using the enabled internal pull-up resistors.&lt;br /&gt;
&lt;br /&gt;
*LED&lt;br /&gt;
&lt;br /&gt;
::As a simple display, our project will utilize a simple LED as an indicator for the user that the audio is currently being recorded and that a face capture will be taken.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
*'''Angstrom A5 Image'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the camera drivers for the playstation eye you will need to install the A5 image on the beagle bone.  To do this you will need to download the A5 image.  Then you will need to install this image on the sd card of the BeagleBone using the instructions bases on [http://elinux.org/EBC_Exercise_03_Installing_a_Beagle_OS| ECE 497 Exercise 03 Installing a Beagle OS].&lt;br /&gt;
&lt;br /&gt;
*'''github'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the project code for the Beagle VNS, you will need github installed in order to download the code.  If you do not have github there are instruction on how to install it on the [[EBC Exercise 16 git |ECE Exercise 16]] web page.&lt;br /&gt;
&lt;br /&gt;
::To download the code for the Beagle VNS run the following code:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''git clone git://github.com/geislekj/BeagleBoardVNS.git'''&lt;br /&gt;
&lt;br /&gt;
*'''Python'''&lt;br /&gt;
&lt;br /&gt;
::Python is natively installed on the Beagle operating system.  However it is important to note that the program will be using a python script to send email.&lt;br /&gt;
&lt;br /&gt;
*'''ALSA'''&lt;br /&gt;
&lt;br /&gt;
::The project uses ALSA drivers in order to record audio from a microphone device.&lt;br /&gt;
&lt;br /&gt;
::In order to download the ALSA drivers you will need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg update'''&lt;br /&gt;
 beagle$ '''opkg install alsa-utils-aplay alsa-utils-amixer'''&lt;br /&gt;
&lt;br /&gt;
*'''Lame'''&lt;br /&gt;
&lt;br /&gt;
::Lame is a audio encoder that will take raw audio and convert it into an mp3 format.&lt;br /&gt;
&lt;br /&gt;
::To install the lame onto the beagle board you will need to run the following command.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg install lame'''&lt;br /&gt;
&lt;br /&gt;
*GStreamer&lt;br /&gt;
&lt;br /&gt;
::GStreamer is an application that allows the user to capture video from a camera for multiple types of solutions.  For this project, it is being used to capture an image of the person leaving a message.&lt;br /&gt;
&lt;br /&gt;
::Instructions to install GStreamer is still in the process of being developed.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
*'''Basic Command Line Examples'''&lt;br /&gt;
&lt;br /&gt;
:: In order to give you a feel to how the program is capturing and sending emails.  Here is a short run down of how the program works&lt;br /&gt;
&lt;br /&gt;
:*'''Audio Capture'''&lt;br /&gt;
&lt;br /&gt;
::: In order to capture audio, the project uses arecord.  This application allows you to grab audio from a microphone that is attached to your device and save to the current directory in a raw format.  &lt;br /&gt;
&lt;br /&gt;
:::Here is an example command that allows you to record audio and then pipe the audio into aplay to instantaneously hear feedback:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 | aplay'''&lt;br /&gt;
&lt;br /&gt;
:::In order to encode the audio into mp3 format, you will need to pipe the audio into lame instead of aplay.&lt;br /&gt;
&lt;br /&gt;
:::Here is an example of this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 -r 16000 -f S16_LE -c 2 -t raw -d 3 | lame  -s 16 -r - blackbird.mp3'''&lt;br /&gt;
&lt;br /&gt;
::: For more information about ALSA and how to use many of its interesting features visit [http://www.lvr.com/access_usb_devices_from_linux.htm | Jan Axelson's Lakeview Research web page]&lt;br /&gt;
&lt;br /&gt;
:*'''Email Script'''&lt;br /&gt;
&lt;br /&gt;
::: A python mail client that prompts the user for information to send an email with optional attachments.&lt;br /&gt;
&lt;br /&gt;
  python smtp-mail-client-attachments.py&lt;br /&gt;
&lt;br /&gt;
  Send To (Separated by a comma): &lt;br /&gt;
  Files (Separated by a comma): &lt;br /&gt;
  Send From: beagle497@gmail.com #Must use this email for now&lt;br /&gt;
  Subject: &lt;br /&gt;
  Message:&lt;br /&gt;
&lt;br /&gt;
*'''Install Instructions'''&lt;br /&gt;
&lt;br /&gt;
::Currently as long as the arecord libraries are installed and nodejs is install, no other installation is required. The app file will use files that are contained in the git repository. The python script does not need any additional packages, and the javascript libraries are also located in the repository.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;What do I have to change to make this work in my Bone?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
This device is intended to record audio messages from students when professors are out of their office. The device will sit outside a professors office and will have a microphone and user button attached. A student who wishes to leave a message will press and hold the button then begin speaking, when the student has finished speaking they will release the button. The software will then save the audio file and then send the file as a mp3 to the user specified email. &lt;br /&gt;
&lt;br /&gt;
As a user the professor will be able to modify the default preferences such as email to send to and the message that they receive.&lt;br /&gt;
&lt;br /&gt;
The system consists of a C program that runs at start-up and checks for the button press. When it picks up that the button has been pressed is creates an audio process that begins recording until the button is released. The system then calls on a python mail client script passing in the location of the newly created audio file. The python script then reads from the user preferences and sends an email accordingly.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Acquire Hardware - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''2.''' Set up project page - Tom &amp;amp; Kevin&lt;br /&gt;
:::Page made and updated&lt;br /&gt;
'''3.''' Get USB wireless to work - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is not working at this time for A6 image&lt;br /&gt;
'''4.''' Get PlayStation Eye to work - Tom&lt;br /&gt;
:::Audio working, need to use A5 image&lt;br /&gt;
:::Passing capture video on to Ruffin&lt;br /&gt;
'''5.''' Get BeagleBoard Bone to run off a battery pack - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''6.''' Register an email for the BeagleBoard - Ruffin&lt;br /&gt;
:::Google acound made, along with Gmail and Google vouice accounts&lt;br /&gt;
'''7.''' Create an email script to send email with attachments - Tom&lt;br /&gt;
:::Email sending&lt;br /&gt;
'''8.''' Encode the raw audio from ALSA into mp3 format - Kevin&lt;br /&gt;
:::Able to record on bone, use lame to convert file, and SCP to send to PC and listen to the recording&lt;br /&gt;
'''9.''' Capture an image using GStreamer - Kevin &amp;amp; Tom&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''10.''' Create a C program to capture the audio and listen for GPIO inputs - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''11.''' Putting all the pieces together - Tom, Kevin, &amp;amp; Ruffin&lt;br /&gt;
:::Making c file for initializing GPIOs, interrupts and start up scripts for VNS server&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import smtplib, os&lt;br /&gt;
from email.MIMEMultipart import MIMEMultipart&lt;br /&gt;
from email.MIMEBase import MIMEBase&lt;br /&gt;
from email.MIMEText import MIMEText&lt;br /&gt;
from email.Utils import COMMASPACE, formatdate&lt;br /&gt;
from email import Encoders&lt;br /&gt;
&lt;br /&gt;
def send_mail():&lt;br /&gt;
    #This version promts the user to specify recipient, files,&lt;br /&gt;
    #subject, and message. The version for incorperating in the&lt;br /&gt;
    #notifier will need to read from a preferences file that &lt;br /&gt;
    #should be modifiable by the user.&lt;br /&gt;
&lt;br /&gt;
    send_to = raw_input(&amp;quot;Send To (Separated by a comma): &amp;quot;)&lt;br /&gt;
    files = raw_input(&amp;quot;Files (Separated by a comma): &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    send_to=send_to.split(',')&lt;br /&gt;
    files=filter(None, files.split(','))&lt;br /&gt;
&lt;br /&gt;
    #Make sure that we are working with a list&lt;br /&gt;
    assert type(send_to)==list&lt;br /&gt;
    assert type(files)==list&lt;br /&gt;
&lt;br /&gt;
    send_from = raw_input(&amp;quot;Send From: &amp;quot;)&lt;br /&gt;
    subject = raw_input(&amp;quot;Subject: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    #Create a message object that we will be sending&lt;br /&gt;
    msg = MIMEMultipart()&lt;br /&gt;
    msg['From'] = send_from&lt;br /&gt;
    msg['To'] = COMMASPACE.join(send_to)&lt;br /&gt;
    msg['Date'] = formatdate(localtime=True)&lt;br /&gt;
    msg['Subject'] = subject&lt;br /&gt;
&lt;br /&gt;
    text = raw_input(&amp;quot;Message: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    msg.attach( MIMEText(text) )&lt;br /&gt;
&lt;br /&gt;
    #Attach files to message&lt;br /&gt;
    for f in files:&lt;br /&gt;
        part = MIMEBase('application', &amp;quot;octet-stream&amp;quot;)&lt;br /&gt;
        part.set_payload( open(f,&amp;quot;rb&amp;quot;).read() )&lt;br /&gt;
        Encoders.encode_base64(part)&lt;br /&gt;
        part.add_header('Content-Disposition', 'attachment; filename=&amp;quot;%s&amp;quot;' % os.path.basename(f))&lt;br /&gt;
        msg.attach(part)&lt;br /&gt;
&lt;br /&gt;
    #Open up a connection to the gmail servers on port 587&lt;br /&gt;
    server = smtplib.SMTP('smtp.gmail.com',587) #port 465 or 587&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    server.starttls()&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    #password = getpass()&lt;br /&gt;
    password=&amp;quot;beagleece497&amp;quot;&lt;br /&gt;
    server.login(send_from, password)&lt;br /&gt;
    server.sendmail(send_from,&amp;quot;,&amp;quot;.join(send_to),msg.as_string())&lt;br /&gt;
    server.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    send_mail()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Web Interface using HTML and NodeJS&lt;br /&gt;
# Web Interface to manage audio files&lt;br /&gt;
# Capture video along with audio&lt;br /&gt;
# Voice-To-Text&lt;br /&gt;
# Low Power Mode for longer battery life&lt;br /&gt;
# Authentication&lt;br /&gt;
&lt;br /&gt;
== Parts ==&lt;br /&gt;
&lt;br /&gt;
[http://beagleboard.org/bone Beagle Bone]&lt;br /&gt;
&lt;br /&gt;
[http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html PlayStation Eye]&lt;br /&gt;
&lt;br /&gt;
[http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]&lt;br /&gt;
&lt;br /&gt;
[http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger]&lt;br /&gt;
&lt;br /&gt;
[http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&amp;lt;br&amp;gt; Need More Cake&lt;br /&gt;
&lt;br /&gt;
{{BeagleVNSFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-11-09T04:21:15Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Future Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{BeagleVNSHead}}&lt;br /&gt;
[[File:BeagleVNS.png|thumb|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
10 Executive Summary (Looks good.  Be sure to keep it up to date)&lt;br /&gt;
00 Installation Instructions (I suggest putting the Hardware section before the software)&lt;br /&gt;
05 User Instructions (How do I make sendmail work on my Bone?)&lt;br /&gt;
00 Highlights (Not done yet)&lt;br /&gt;
00 Theory of Operation (ditto)&lt;br /&gt;
10 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments: I'm looking forward to seeing the completed project.&lt;br /&gt;
&lt;br /&gt;
Score:  25/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:WhereIsYoder.png|thumb|Where is Dr. Yoder?]]&lt;br /&gt;
[[File:WhereIsYoder2.png|thumb|I'll leave him a message]]&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
At this time, we have a method for capturing audio for a specified amount of time and encoding that recording into a mp3 file.  We also have python script that allows the user to send email messages to another email by running a script.  We also have a working external power source for the beagle.&lt;br /&gt;
&lt;br /&gt;
The wireless usb adapter does not work at this time.  We are still trying to get recompile the kernel to install and enable the driver for this wireless adapter.&lt;br /&gt;
&lt;br /&gt;
Overall we are looking at creating a c program that will record the audio while the button is being pressed.  Once the button has been released the program will encode the raw audio into mp3 format, and then attach it via an email and send it to the owner of the Beagle VNS system.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
[[File:BeagleBone_256x249.jpg|320px|thumb|right|BeagleBone]]&lt;br /&gt;
[[File:PlayStation-Eye.png|thumb|right|PlayStation Eye]]&lt;br /&gt;
[[File:Belkin_N150_Micro_Wireless_USB_Adapter.png|thumb|right|Belkin N150 Micro Wireless USB Adapter]]&lt;br /&gt;
&lt;br /&gt;
*BeagleBone&lt;br /&gt;
&lt;br /&gt;
::This project is design primarily for the BeagleBone, but could be implemented on any other Beagle Board given the proper driver installation for the USB hardware and available GPIOs. The BeagleBone is applicable for this project due to is small size, low power consumption, and networking capabilities. Make sure to use the A5 image of Ångström as the A6 image is still buggy with respect to audio/video capturing, as well as using the USB WiFi drivers.&lt;br /&gt;
&lt;br /&gt;
::Further BeagleBone documentation can be found on the official [http://beagleboard.org Beagle Board] website.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [https://www.adafruit.com/products/513 here]  &lt;br /&gt;
&lt;br /&gt;
*Camera&lt;br /&gt;
&lt;br /&gt;
::In this project tutorial, we will be using the [http://en.wikipedia.org/wiki/PlayStation_Eye  PlayStation Eye] as the audio and video source to recod messages and capture face images. The PlayStation Eye is very compatible with the A5 image of Ångström and used in many other Beagle embedded Linux projects.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html here]  &lt;br /&gt;
&lt;br /&gt;
*Wifi dongle&lt;br /&gt;
&lt;br /&gt;
::Here we would like to use a WiFi dongle to easily connect to surrounding wireless networks for ease of installation and placement in the remote stretches of hallways and doorframes. We will need we will need network connectivity to transmit e-mails and recording attachments over to an available e-mail server account. In particularly we are using the [http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]. &lt;br /&gt;
&lt;br /&gt;
::Although this device is not natively supported with the stock A5 image of Ångström, a brief tutorial has already been made on how to compile and install the device drivers for this particular wireless USB adapter: [http://embeddedgeeks.wordpress.com/2012/01/03/belkin-micro-wifi-usb-dongle-on-the-beagleboard/ Belkin Micro Wi-Fi USB dongle on the BeagleBoard]&lt;br /&gt;
&lt;br /&gt;
*Battery Pack and USB Hub&lt;br /&gt;
&lt;br /&gt;
::To again better a ease installation and quick deployment for our system we are using a battery pack to provide power for the BeagleBone, the WiFi dongle and the USB camera. Due to the hottest limitations of the Beagle bones single USB port, in addition to the limited amount of current that the single USB port can provide, we will also use a USB hub with power adapter to solve both issues.&lt;br /&gt;
&lt;br /&gt;
::Specific products we are using included [http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger] and [http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
*Doorbell&lt;br /&gt;
&lt;br /&gt;
::In order for the end user to trigger the recording sequence, we will implement a traditional mechanical momentary pushbutton that will connect to the BeagleBone’s GPIO using the enabled internal pull-up resistors.&lt;br /&gt;
&lt;br /&gt;
*LED&lt;br /&gt;
&lt;br /&gt;
::As a simple display, our project will utilize a simple LED as an indicator for the user that the audio is currently being recorded and that a face capture will be taken.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
*'''Angstrom A5 Image'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the camera drivers for the playstation eye you will need to install the A5 image on the beagle bone.  To do this you will need to download the A5 image.  Then you will need to install this image on the sd card of the BeagleBone using the instructions bases on [http://elinux.org/EBC_Exercise_03_Installing_a_Beagle_OS| ECE 497 Exercise 03 Installing a Beagle OS].&lt;br /&gt;
&lt;br /&gt;
*'''github'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the project code for the Beagle VNS, you will need github installed in order to download the code.  If you do not have github there are instruction on how to install it on the [[EBC Exercise 16 git |ECE Exercise 16]] web page.&lt;br /&gt;
&lt;br /&gt;
::To download the code for the Beagle VNS run the following code:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''git clone git://github.com/geislekj/BeagleBoardVNS.git'''&lt;br /&gt;
&lt;br /&gt;
*'''Python'''&lt;br /&gt;
&lt;br /&gt;
::Python is natively installed on the Beagle operating system.  However it is important to note that the program will be using a python script to send email.&lt;br /&gt;
&lt;br /&gt;
*'''ALSA'''&lt;br /&gt;
&lt;br /&gt;
::The project uses ALSA drivers in order to record audio from a microphone device.&lt;br /&gt;
&lt;br /&gt;
::In order to download the ALSA drivers you will need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg update'''&lt;br /&gt;
 beagle$ '''opkg install alsa-utils-aplay alsa-utils-amixer'''&lt;br /&gt;
&lt;br /&gt;
*'''Lame'''&lt;br /&gt;
&lt;br /&gt;
::Lame is a audio encoder that will take raw audio and convert it into an mp3 format.&lt;br /&gt;
&lt;br /&gt;
::To install the lame onto the beagle board you will need to run the following command.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg install lame'''&lt;br /&gt;
&lt;br /&gt;
*GStreamer&lt;br /&gt;
&lt;br /&gt;
::GStreamer is an application that allows the user to capture video from a camera for multiple types of solutions.  For this project, it is being used to capture an image of the person leaving a message.&lt;br /&gt;
&lt;br /&gt;
::Instructions to install GStreamer is still in the process of being developed.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
*'''Basic Command Line Examples'''&lt;br /&gt;
&lt;br /&gt;
:: In order to give you a feel to how the program is capturing and sending emails.  Here is a short run down of how the program works&lt;br /&gt;
&lt;br /&gt;
:*'''Audio Capture'''&lt;br /&gt;
&lt;br /&gt;
::: In order to capture audio, the project uses arecord.  This application allows you to grab audio from a microphone that is attached to your device and save to the current directory in a raw format.  &lt;br /&gt;
&lt;br /&gt;
:::Here is an example command that allows you to record audio and then pipe the audio into aplay to instantaneously hear feedback:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 | aplay'''&lt;br /&gt;
&lt;br /&gt;
:::In order to encode the audio into mp3 format, you will need to pipe the audio into lame instead of aplay.&lt;br /&gt;
&lt;br /&gt;
:::Here is an example of this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 -r 16000 -f S16_LE -c 2 -t raw -d 3 | lame  -s 16 -r - blackbird.mp3'''&lt;br /&gt;
&lt;br /&gt;
::: For more information about ALSA and how to use many of its interesting features visit [http://www.lvr.com/access_usb_devices_from_linux.htm | Jan Axelson's Lakeview Research web page]&lt;br /&gt;
&lt;br /&gt;
:*'''Email Script'''&lt;br /&gt;
&lt;br /&gt;
::: A python mail client that prompts the user for information to send an email with optional attachments.&lt;br /&gt;
&lt;br /&gt;
  python smtp-mail-client-attachments.py&lt;br /&gt;
&lt;br /&gt;
  Send To (Separated by a comma): &lt;br /&gt;
  Files (Separated by a comma): &lt;br /&gt;
  Send From: beagle497@gmail.com #Must use this email for now&lt;br /&gt;
  Subject: &lt;br /&gt;
  Message:&lt;br /&gt;
&lt;br /&gt;
*'''Install Instructions'''&lt;br /&gt;
&lt;br /&gt;
::alsa, nodejs, lame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;What do I have to change to make this work in my Bone?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
This device is intended to record audio messages from students when professors are out of their office. The device will sit outside a professors office and will have a microphone and user button attached. A student who wishes to leave a message will press and hold the button then begin speaking, when the student has finished speaking they will release the button. The software will then save the audio file and then send the file as a mp3 to the user specified email. &lt;br /&gt;
&lt;br /&gt;
As a user the professor will be able to modify the default preferences such as email to send to and the message that they receive.&lt;br /&gt;
&lt;br /&gt;
The system consists of a C program that runs at start-up and checks for the button press. When it picks up that the button has been pressed is creates an audio process that begins recording until the button is released. The system then calls on a python mail client script passing in the location of the newly created audio file. The python script then reads from the user preferences and sends an email accordingly.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Acquire Hardware - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''2.''' Set up project page - Tom &amp;amp; Kevin&lt;br /&gt;
:::Page made and updated&lt;br /&gt;
'''3.''' Get USB wireless to work - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is not working at this time for A6 image&lt;br /&gt;
'''4.''' Get PlayStation Eye to work - Tom&lt;br /&gt;
:::Audio working, need to use A5 image&lt;br /&gt;
:::Passing capture video on to Ruffin&lt;br /&gt;
'''5.''' Get BeagleBoard Bone to run off a battery pack - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''6.''' Register an email for the BeagleBoard - Ruffin&lt;br /&gt;
:::Google acound made, along with Gmail and Google vouice accounts&lt;br /&gt;
'''7.''' Create an email script to send email with attachments - Tom&lt;br /&gt;
:::Email sending&lt;br /&gt;
'''8.''' Encode the raw audio from ALSA into mp3 format - Kevin&lt;br /&gt;
:::Able to record on bone, use lame to convert file, and SCP to send to PC and listen to the recording&lt;br /&gt;
'''9.''' Capture an image using GStreamer - Kevin &amp;amp; Tom&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''10.''' Create a C program to capture the audio and listen for GPIO inputs - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''11.''' Putting all the pieces together - Tom, Kevin, &amp;amp; Ruffin&lt;br /&gt;
:::Making c file for initializing GPIOs, interrupts and start up scripts for VNS server&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import smtplib, os&lt;br /&gt;
from email.MIMEMultipart import MIMEMultipart&lt;br /&gt;
from email.MIMEBase import MIMEBase&lt;br /&gt;
from email.MIMEText import MIMEText&lt;br /&gt;
from email.Utils import COMMASPACE, formatdate&lt;br /&gt;
from email import Encoders&lt;br /&gt;
&lt;br /&gt;
def send_mail():&lt;br /&gt;
    #This version promts the user to specify recipient, files,&lt;br /&gt;
    #subject, and message. The version for incorperating in the&lt;br /&gt;
    #notifier will need to read from a preferences file that &lt;br /&gt;
    #should be modifiable by the user.&lt;br /&gt;
&lt;br /&gt;
    send_to = raw_input(&amp;quot;Send To (Separated by a comma): &amp;quot;)&lt;br /&gt;
    files = raw_input(&amp;quot;Files (Separated by a comma): &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    send_to=send_to.split(',')&lt;br /&gt;
    files=filter(None, files.split(','))&lt;br /&gt;
&lt;br /&gt;
    #Make sure that we are working with a list&lt;br /&gt;
    assert type(send_to)==list&lt;br /&gt;
    assert type(files)==list&lt;br /&gt;
&lt;br /&gt;
    send_from = raw_input(&amp;quot;Send From: &amp;quot;)&lt;br /&gt;
    subject = raw_input(&amp;quot;Subject: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    #Create a message object that we will be sending&lt;br /&gt;
    msg = MIMEMultipart()&lt;br /&gt;
    msg['From'] = send_from&lt;br /&gt;
    msg['To'] = COMMASPACE.join(send_to)&lt;br /&gt;
    msg['Date'] = formatdate(localtime=True)&lt;br /&gt;
    msg['Subject'] = subject&lt;br /&gt;
&lt;br /&gt;
    text = raw_input(&amp;quot;Message: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    msg.attach( MIMEText(text) )&lt;br /&gt;
&lt;br /&gt;
    #Attach files to message&lt;br /&gt;
    for f in files:&lt;br /&gt;
        part = MIMEBase('application', &amp;quot;octet-stream&amp;quot;)&lt;br /&gt;
        part.set_payload( open(f,&amp;quot;rb&amp;quot;).read() )&lt;br /&gt;
        Encoders.encode_base64(part)&lt;br /&gt;
        part.add_header('Content-Disposition', 'attachment; filename=&amp;quot;%s&amp;quot;' % os.path.basename(f))&lt;br /&gt;
        msg.attach(part)&lt;br /&gt;
&lt;br /&gt;
    #Open up a connection to the gmail servers on port 587&lt;br /&gt;
    server = smtplib.SMTP('smtp.gmail.com',587) #port 465 or 587&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    server.starttls()&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    #password = getpass()&lt;br /&gt;
    password=&amp;quot;beagleece497&amp;quot;&lt;br /&gt;
    server.login(send_from, password)&lt;br /&gt;
    server.sendmail(send_from,&amp;quot;,&amp;quot;.join(send_to),msg.as_string())&lt;br /&gt;
    server.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    send_mail()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Web Interface using HTML and NodeJS&lt;br /&gt;
# Web Interface to manage audio files&lt;br /&gt;
# Capture video along with audio&lt;br /&gt;
# Voice-To-Text&lt;br /&gt;
# Low Power Mode for longer battery life&lt;br /&gt;
# Authentication&lt;br /&gt;
&lt;br /&gt;
== Parts ==&lt;br /&gt;
&lt;br /&gt;
[http://beagleboard.org/bone Beagle Bone]&lt;br /&gt;
&lt;br /&gt;
[http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html PlayStation Eye]&lt;br /&gt;
&lt;br /&gt;
[http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]&lt;br /&gt;
&lt;br /&gt;
[http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger]&lt;br /&gt;
&lt;br /&gt;
[http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&amp;lt;br&amp;gt; Need More Cake&lt;br /&gt;
&lt;br /&gt;
{{BeagleVNSFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-11-09T04:15:48Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Theory of Operation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{BeagleVNSHead}}&lt;br /&gt;
[[File:BeagleVNS.png|thumb|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
10 Executive Summary (Looks good.  Be sure to keep it up to date)&lt;br /&gt;
00 Installation Instructions (I suggest putting the Hardware section before the software)&lt;br /&gt;
05 User Instructions (How do I make sendmail work on my Bone?)&lt;br /&gt;
00 Highlights (Not done yet)&lt;br /&gt;
00 Theory of Operation (ditto)&lt;br /&gt;
10 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments: I'm looking forward to seeing the completed project.&lt;br /&gt;
&lt;br /&gt;
Score:  25/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:WhereIsYoder.png|thumb|Where is Dr. Yoder?]]&lt;br /&gt;
[[File:WhereIsYoder2.png|thumb|I'll leave him a message]]&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
At this time, we have a method for capturing audio for a specified amount of time and encoding that recording into a mp3 file.  We also have python script that allows the user to send email messages to another email by running a script.  We also have a working external power source for the beagle.&lt;br /&gt;
&lt;br /&gt;
The wireless usb adapter does not work at this time.  We are still trying to get recompile the kernel to install and enable the driver for this wireless adapter.&lt;br /&gt;
&lt;br /&gt;
Overall we are looking at creating a c program that will record the audio while the button is being pressed.  Once the button has been released the program will encode the raw audio into mp3 format, and then attach it via an email and send it to the owner of the Beagle VNS system.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
[[File:BeagleBone_256x249.jpg|320px|thumb|right|BeagleBone]]&lt;br /&gt;
[[File:PlayStation-Eye.png|thumb|right|PlayStation Eye]]&lt;br /&gt;
[[File:Belkin_N150_Micro_Wireless_USB_Adapter.png|thumb|right|Belkin N150 Micro Wireless USB Adapter]]&lt;br /&gt;
&lt;br /&gt;
*BeagleBone&lt;br /&gt;
&lt;br /&gt;
::This project is design primarily for the BeagleBone, but could be implemented on any other Beagle Board given the proper driver installation for the USB hardware and available GPIOs. The BeagleBone is applicable for this project due to is small size, low power consumption, and networking capabilities. Make sure to use the A5 image of Ångström as the A6 image is still buggy with respect to audio/video capturing, as well as using the USB WiFi drivers.&lt;br /&gt;
&lt;br /&gt;
::Further BeagleBone documentation can be found on the official [http://beagleboard.org Beagle Board] website.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [https://www.adafruit.com/products/513 here]  &lt;br /&gt;
&lt;br /&gt;
*Camera&lt;br /&gt;
&lt;br /&gt;
::In this project tutorial, we will be using the [http://en.wikipedia.org/wiki/PlayStation_Eye  PlayStation Eye] as the audio and video source to recod messages and capture face images. The PlayStation Eye is very compatible with the A5 image of Ångström and used in many other Beagle embedded Linux projects.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html here]  &lt;br /&gt;
&lt;br /&gt;
*Wifi dongle&lt;br /&gt;
&lt;br /&gt;
::Here we would like to use a WiFi dongle to easily connect to surrounding wireless networks for ease of installation and placement in the remote stretches of hallways and doorframes. We will need we will need network connectivity to transmit e-mails and recording attachments over to an available e-mail server account. In particularly we are using the [http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]. &lt;br /&gt;
&lt;br /&gt;
::Although this device is not natively supported with the stock A5 image of Ångström, a brief tutorial has already been made on how to compile and install the device drivers for this particular wireless USB adapter: [http://embeddedgeeks.wordpress.com/2012/01/03/belkin-micro-wifi-usb-dongle-on-the-beagleboard/ Belkin Micro Wi-Fi USB dongle on the BeagleBoard]&lt;br /&gt;
&lt;br /&gt;
*Battery Pack and USB Hub&lt;br /&gt;
&lt;br /&gt;
::To again better a ease installation and quick deployment for our system we are using a battery pack to provide power for the BeagleBone, the WiFi dongle and the USB camera. Due to the hottest limitations of the Beagle bones single USB port, in addition to the limited amount of current that the single USB port can provide, we will also use a USB hub with power adapter to solve both issues.&lt;br /&gt;
&lt;br /&gt;
::Specific products we are using included [http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger] and [http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
*Doorbell&lt;br /&gt;
&lt;br /&gt;
::In order for the end user to trigger the recording sequence, we will implement a traditional mechanical momentary pushbutton that will connect to the BeagleBone’s GPIO using the enabled internal pull-up resistors.&lt;br /&gt;
&lt;br /&gt;
*LED&lt;br /&gt;
&lt;br /&gt;
::As a simple display, our project will utilize a simple LED as an indicator for the user that the audio is currently being recorded and that a face capture will be taken.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
*'''Angstrom A5 Image'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the camera drivers for the playstation eye you will need to install the A5 image on the beagle bone.  To do this you will need to download the A5 image.  Then you will need to install this image on the sd card of the BeagleBone using the instructions bases on [http://elinux.org/EBC_Exercise_03_Installing_a_Beagle_OS| ECE 497 Exercise 03 Installing a Beagle OS].&lt;br /&gt;
&lt;br /&gt;
*'''github'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the project code for the Beagle VNS, you will need github installed in order to download the code.  If you do not have github there are instruction on how to install it on the [[EBC Exercise 16 git |ECE Exercise 16]] web page.&lt;br /&gt;
&lt;br /&gt;
::To download the code for the Beagle VNS run the following code:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''git clone git://github.com/geislekj/BeagleBoardVNS.git'''&lt;br /&gt;
&lt;br /&gt;
*'''Python'''&lt;br /&gt;
&lt;br /&gt;
::Python is natively installed on the Beagle operating system.  However it is important to note that the program will be using a python script to send email.&lt;br /&gt;
&lt;br /&gt;
*'''ALSA'''&lt;br /&gt;
&lt;br /&gt;
::The project uses ALSA drivers in order to record audio from a microphone device.&lt;br /&gt;
&lt;br /&gt;
::In order to download the ALSA drivers you will need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg update'''&lt;br /&gt;
 beagle$ '''opkg install alsa-utils-aplay alsa-utils-amixer'''&lt;br /&gt;
&lt;br /&gt;
*'''Lame'''&lt;br /&gt;
&lt;br /&gt;
::Lame is a audio encoder that will take raw audio and convert it into an mp3 format.&lt;br /&gt;
&lt;br /&gt;
::To install the lame onto the beagle board you will need to run the following command.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg install lame'''&lt;br /&gt;
&lt;br /&gt;
*GStreamer&lt;br /&gt;
&lt;br /&gt;
::GStreamer is an application that allows the user to capture video from a camera for multiple types of solutions.  For this project, it is being used to capture an image of the person leaving a message.&lt;br /&gt;
&lt;br /&gt;
::Instructions to install GStreamer is still in the process of being developed.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
*'''Basic Command Line Examples'''&lt;br /&gt;
&lt;br /&gt;
:: In order to give you a feel to how the program is capturing and sending emails.  Here is a short run down of how the program works&lt;br /&gt;
&lt;br /&gt;
:*'''Audio Capture'''&lt;br /&gt;
&lt;br /&gt;
::: In order to capture audio, the project uses arecord.  This application allows you to grab audio from a microphone that is attached to your device and save to the current directory in a raw format.  &lt;br /&gt;
&lt;br /&gt;
:::Here is an example command that allows you to record audio and then pipe the audio into aplay to instantaneously hear feedback:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 | aplay'''&lt;br /&gt;
&lt;br /&gt;
:::In order to encode the audio into mp3 format, you will need to pipe the audio into lame instead of aplay.&lt;br /&gt;
&lt;br /&gt;
:::Here is an example of this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 -r 16000 -f S16_LE -c 2 -t raw -d 3 | lame  -s 16 -r - blackbird.mp3'''&lt;br /&gt;
&lt;br /&gt;
::: For more information about ALSA and how to use many of its interesting features visit [http://www.lvr.com/access_usb_devices_from_linux.htm | Jan Axelson's Lakeview Research web page]&lt;br /&gt;
&lt;br /&gt;
:*'''Email Script'''&lt;br /&gt;
&lt;br /&gt;
::: A python mail client that prompts the user for information to send an email with optional attachments.&lt;br /&gt;
&lt;br /&gt;
  python smtp-mail-client-attachments.py&lt;br /&gt;
&lt;br /&gt;
  Send To (Separated by a comma): &lt;br /&gt;
  Files (Separated by a comma): &lt;br /&gt;
  Send From: beagle497@gmail.com #Must use this email for now&lt;br /&gt;
  Subject: &lt;br /&gt;
  Message:&lt;br /&gt;
&lt;br /&gt;
*'''Install Instructions'''&lt;br /&gt;
&lt;br /&gt;
::alsa, nodejs, lame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;What do I have to change to make this work in my Bone?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
This device is intended to record audio messages from students when professors are out of their office. The device will sit outside a professors office and will have a microphone and user button attached. A student who wishes to leave a message will press and hold the button then begin speaking, when the student has finished speaking they will release the button. The software will then save the audio file and then send the file as a mp3 to the user specified email. &lt;br /&gt;
&lt;br /&gt;
As a user the professor will be able to modify the default preferences such as email to send to and the message that they receive.&lt;br /&gt;
&lt;br /&gt;
The system consists of a C program that runs at start-up and checks for the button press. When it picks up that the button has been pressed is creates an audio process that begins recording until the button is released. The system then calls on a python mail client script passing in the location of the newly created audio file. The python script then reads from the user preferences and sends an email accordingly.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Acquire Hardware - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''2.''' Set up project page - Tom &amp;amp; Kevin&lt;br /&gt;
:::Page made and updated&lt;br /&gt;
'''3.''' Get USB wireless to work - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is not working at this time for A6 image&lt;br /&gt;
'''4.''' Get PlayStation Eye to work - Tom&lt;br /&gt;
:::Audio working, need to use A5 image&lt;br /&gt;
:::Passing capture video on to Ruffin&lt;br /&gt;
'''5.''' Get BeagleBoard Bone to run off a battery pack - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''6.''' Register an email for the BeagleBoard - Ruffin&lt;br /&gt;
:::Google acound made, along with Gmail and Google vouice accounts&lt;br /&gt;
'''7.''' Create an email script to send email with attachments - Tom&lt;br /&gt;
:::Email sending&lt;br /&gt;
'''8.''' Encode the raw audio from ALSA into mp3 format - Kevin&lt;br /&gt;
:::Able to record on bone, use lame to convert file, and SCP to send to PC and listen to the recording&lt;br /&gt;
'''9.''' Capture an image using GStreamer - Kevin &amp;amp; Tom&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''10.''' Create a C program to capture the audio and listen for GPIO inputs - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''11.''' Putting all the pieces together - Tom, Kevin, &amp;amp; Ruffin&lt;br /&gt;
:::Making c file for initializing GPIOs, interrupts and start up scripts for VNS server&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import smtplib, os&lt;br /&gt;
from email.MIMEMultipart import MIMEMultipart&lt;br /&gt;
from email.MIMEBase import MIMEBase&lt;br /&gt;
from email.MIMEText import MIMEText&lt;br /&gt;
from email.Utils import COMMASPACE, formatdate&lt;br /&gt;
from email import Encoders&lt;br /&gt;
&lt;br /&gt;
def send_mail():&lt;br /&gt;
    #This version promts the user to specify recipient, files,&lt;br /&gt;
    #subject, and message. The version for incorperating in the&lt;br /&gt;
    #notifier will need to read from a preferences file that &lt;br /&gt;
    #should be modifiable by the user.&lt;br /&gt;
&lt;br /&gt;
    send_to = raw_input(&amp;quot;Send To (Separated by a comma): &amp;quot;)&lt;br /&gt;
    files = raw_input(&amp;quot;Files (Separated by a comma): &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    send_to=send_to.split(',')&lt;br /&gt;
    files=filter(None, files.split(','))&lt;br /&gt;
&lt;br /&gt;
    #Make sure that we are working with a list&lt;br /&gt;
    assert type(send_to)==list&lt;br /&gt;
    assert type(files)==list&lt;br /&gt;
&lt;br /&gt;
    send_from = raw_input(&amp;quot;Send From: &amp;quot;)&lt;br /&gt;
    subject = raw_input(&amp;quot;Subject: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    #Create a message object that we will be sending&lt;br /&gt;
    msg = MIMEMultipart()&lt;br /&gt;
    msg['From'] = send_from&lt;br /&gt;
    msg['To'] = COMMASPACE.join(send_to)&lt;br /&gt;
    msg['Date'] = formatdate(localtime=True)&lt;br /&gt;
    msg['Subject'] = subject&lt;br /&gt;
&lt;br /&gt;
    text = raw_input(&amp;quot;Message: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    msg.attach( MIMEText(text) )&lt;br /&gt;
&lt;br /&gt;
    #Attach files to message&lt;br /&gt;
    for f in files:&lt;br /&gt;
        part = MIMEBase('application', &amp;quot;octet-stream&amp;quot;)&lt;br /&gt;
        part.set_payload( open(f,&amp;quot;rb&amp;quot;).read() )&lt;br /&gt;
        Encoders.encode_base64(part)&lt;br /&gt;
        part.add_header('Content-Disposition', 'attachment; filename=&amp;quot;%s&amp;quot;' % os.path.basename(f))&lt;br /&gt;
        msg.attach(part)&lt;br /&gt;
&lt;br /&gt;
    #Open up a connection to the gmail servers on port 587&lt;br /&gt;
    server = smtplib.SMTP('smtp.gmail.com',587) #port 465 or 587&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    server.starttls()&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    #password = getpass()&lt;br /&gt;
    password=&amp;quot;beagleece497&amp;quot;&lt;br /&gt;
    server.login(send_from, password)&lt;br /&gt;
    server.sendmail(send_from,&amp;quot;,&amp;quot;.join(send_to),msg.as_string())&lt;br /&gt;
    server.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    send_mail()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Web Interface using HTML and NodeJS&lt;br /&gt;
&lt;br /&gt;
== Parts ==&lt;br /&gt;
&lt;br /&gt;
[http://beagleboard.org/bone Beagle Bone]&lt;br /&gt;
&lt;br /&gt;
[http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html PlayStation Eye]&lt;br /&gt;
&lt;br /&gt;
[http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]&lt;br /&gt;
&lt;br /&gt;
[http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger]&lt;br /&gt;
&lt;br /&gt;
[http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&amp;lt;br&amp;gt; Need More Cake&lt;br /&gt;
&lt;br /&gt;
{{BeagleVNSFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-11-09T04:01:33Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* User Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{BeagleVNSHead}}&lt;br /&gt;
[[File:BeagleVNS.png|thumb|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
10 Executive Summary (Looks good.  Be sure to keep it up to date)&lt;br /&gt;
00 Installation Instructions (I suggest putting the Hardware section before the software)&lt;br /&gt;
05 User Instructions (How do I make sendmail work on my Bone?)&lt;br /&gt;
00 Highlights (Not done yet)&lt;br /&gt;
00 Theory of Operation (ditto)&lt;br /&gt;
10 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments: I'm looking forward to seeing the completed project.&lt;br /&gt;
&lt;br /&gt;
Score:  25/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:WhereIsYoder.png|thumb|Where is Dr. Yoder?]]&lt;br /&gt;
[[File:WhereIsYoder2.png|thumb|I'll leave him a message]]&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
At this time, we have a method for capturing audio for a specified amount of time and encoding that recording into a mp3 file.  We also have python script that allows the user to send email messages to another email by running a script.  We also have a working external power source for the beagle.&lt;br /&gt;
&lt;br /&gt;
The wireless usb adapter does not work at this time.  We are still trying to get recompile the kernel to install and enable the driver for this wireless adapter.&lt;br /&gt;
&lt;br /&gt;
Overall we are looking at creating a c program that will record the audio while the button is being pressed.  Once the button has been released the program will encode the raw audio into mp3 format, and then attach it via an email and send it to the owner of the Beagle VNS system.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
[[File:BeagleBone_256x249.jpg|320px|thumb|right|BeagleBone]]&lt;br /&gt;
[[File:PlayStation-Eye.png|thumb|right|PlayStation Eye]]&lt;br /&gt;
[[File:Belkin_N150_Micro_Wireless_USB_Adapter.png|thumb|right|Belkin N150 Micro Wireless USB Adapter]]&lt;br /&gt;
&lt;br /&gt;
*BeagleBone&lt;br /&gt;
&lt;br /&gt;
::This project is design primarily for the BeagleBone, but could be implemented on any other Beagle Board given the proper driver installation for the USB hardware and available GPIOs. The BeagleBone is applicable for this project due to is small size, low power consumption, and networking capabilities. Make sure to use the A5 image of Ångström as the A6 image is still buggy with respect to audio/video capturing, as well as using the USB WiFi drivers.&lt;br /&gt;
&lt;br /&gt;
::Further BeagleBone documentation can be found on the official [http://beagleboard.org Beagle Board] website.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [https://www.adafruit.com/products/513 here]  &lt;br /&gt;
&lt;br /&gt;
*Camera&lt;br /&gt;
&lt;br /&gt;
::In this project tutorial, we will be using the [http://en.wikipedia.org/wiki/PlayStation_Eye  PlayStation Eye] as the audio and video source to recod messages and capture face images. The PlayStation Eye is very compatible with the A5 image of Ångström and used in many other Beagle embedded Linux projects.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html here]  &lt;br /&gt;
&lt;br /&gt;
*Wifi dongle&lt;br /&gt;
&lt;br /&gt;
::Here we would like to use a WiFi dongle to easily connect to surrounding wireless networks for ease of installation and placement in the remote stretches of hallways and doorframes. We will need we will need network connectivity to transmit e-mails and recording attachments over to an available e-mail server account. In particularly we are using the [http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]. &lt;br /&gt;
&lt;br /&gt;
::Although this device is not natively supported with the stock A5 image of Ångström, a brief tutorial has already been made on how to compile and install the device drivers for this particular wireless USB adapter: [http://embeddedgeeks.wordpress.com/2012/01/03/belkin-micro-wifi-usb-dongle-on-the-beagleboard/ Belkin Micro Wi-Fi USB dongle on the BeagleBoard]&lt;br /&gt;
&lt;br /&gt;
*Battery Pack and USB Hub&lt;br /&gt;
&lt;br /&gt;
::To again better a ease installation and quick deployment for our system we are using a battery pack to provide power for the BeagleBone, the WiFi dongle and the USB camera. Due to the hottest limitations of the Beagle bones single USB port, in addition to the limited amount of current that the single USB port can provide, we will also use a USB hub with power adapter to solve both issues.&lt;br /&gt;
&lt;br /&gt;
::Specific products we are using included [http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger] and [http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
*Doorbell&lt;br /&gt;
&lt;br /&gt;
::In order for the end user to trigger the recording sequence, we will implement a traditional mechanical momentary pushbutton that will connect to the BeagleBone’s GPIO using the enabled internal pull-up resistors.&lt;br /&gt;
&lt;br /&gt;
*LED&lt;br /&gt;
&lt;br /&gt;
::As a simple display, our project will utilize a simple LED as an indicator for the user that the audio is currently being recorded and that a face capture will be taken.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
*'''Angstrom A5 Image'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the camera drivers for the playstation eye you will need to install the A5 image on the beagle bone.  To do this you will need to download the A5 image.  Then you will need to install this image on the sd card of the BeagleBone using the instructions bases on [http://elinux.org/EBC_Exercise_03_Installing_a_Beagle_OS| ECE 497 Exercise 03 Installing a Beagle OS].&lt;br /&gt;
&lt;br /&gt;
*'''github'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the project code for the Beagle VNS, you will need github installed in order to download the code.  If you do not have github there are instruction on how to install it on the [[EBC Exercise 16 git |ECE Exercise 16]] web page.&lt;br /&gt;
&lt;br /&gt;
::To download the code for the Beagle VNS run the following code:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''git clone git://github.com/geislekj/BeagleBoardVNS.git'''&lt;br /&gt;
&lt;br /&gt;
*'''Python'''&lt;br /&gt;
&lt;br /&gt;
::Python is natively installed on the Beagle operating system.  However it is important to note that the program will be using a python script to send email.&lt;br /&gt;
&lt;br /&gt;
*'''ALSA'''&lt;br /&gt;
&lt;br /&gt;
::The project uses ALSA drivers in order to record audio from a microphone device.&lt;br /&gt;
&lt;br /&gt;
::In order to download the ALSA drivers you will need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg update'''&lt;br /&gt;
 beagle$ '''opkg install alsa-utils-aplay alsa-utils-amixer'''&lt;br /&gt;
&lt;br /&gt;
*'''Lame'''&lt;br /&gt;
&lt;br /&gt;
::Lame is a audio encoder that will take raw audio and convert it into an mp3 format.&lt;br /&gt;
&lt;br /&gt;
::To install the lame onto the beagle board you will need to run the following command.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg install lame'''&lt;br /&gt;
&lt;br /&gt;
*GStreamer&lt;br /&gt;
&lt;br /&gt;
::GStreamer is an application that allows the user to capture video from a camera for multiple types of solutions.  For this project, it is being used to capture an image of the person leaving a message.&lt;br /&gt;
&lt;br /&gt;
::Instructions to install GStreamer is still in the process of being developed.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
*'''Basic Command Line Examples'''&lt;br /&gt;
&lt;br /&gt;
:: In order to give you a feel to how the program is capturing and sending emails.  Here is a short run down of how the program works&lt;br /&gt;
&lt;br /&gt;
:*'''Audio Capture'''&lt;br /&gt;
&lt;br /&gt;
::: In order to capture audio, the project uses arecord.  This application allows you to grab audio from a microphone that is attached to your device and save to the current directory in a raw format.  &lt;br /&gt;
&lt;br /&gt;
:::Here is an example command that allows you to record audio and then pipe the audio into aplay to instantaneously hear feedback:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 | aplay'''&lt;br /&gt;
&lt;br /&gt;
:::In order to encode the audio into mp3 format, you will need to pipe the audio into lame instead of aplay.&lt;br /&gt;
&lt;br /&gt;
:::Here is an example of this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''arecord -D plughw:0,0 -r 16000 -f S16_LE -c 2 -t raw -d 3 | lame  -s 16 -r - blackbird.mp3'''&lt;br /&gt;
&lt;br /&gt;
::: For more information about ALSA and how to use many of its interesting features visit [http://www.lvr.com/access_usb_devices_from_linux.htm | Jan Axelson's Lakeview Research web page]&lt;br /&gt;
&lt;br /&gt;
:*'''Email Script'''&lt;br /&gt;
&lt;br /&gt;
::: A python mail client that prompts the user for information to send an email with optional attachments.&lt;br /&gt;
&lt;br /&gt;
  python smtp-mail-client-attachments.py&lt;br /&gt;
&lt;br /&gt;
  Send To (Separated by a comma): &lt;br /&gt;
  Files (Separated by a comma): &lt;br /&gt;
  Send From: beagle497@gmail.com #Must use this email for now&lt;br /&gt;
  Subject: &lt;br /&gt;
  Message:&lt;br /&gt;
&lt;br /&gt;
*'''Install Instructions'''&lt;br /&gt;
&lt;br /&gt;
::alsa, nodejs, lame&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;What do I have to change to make this work in my Bone?&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Acquire Hardware - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''2.''' Set up project page - Tom &amp;amp; Kevin&lt;br /&gt;
:::Page made and updated&lt;br /&gt;
'''3.''' Get USB wireless to work - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is not working at this time for A6 image&lt;br /&gt;
'''4.''' Get PlayStation Eye to work - Tom&lt;br /&gt;
:::Audio working, need to use A5 image&lt;br /&gt;
:::Passing capture video on to Ruffin&lt;br /&gt;
'''5.''' Get BeagleBoard Bone to run off a battery pack - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''6.''' Register an email for the BeagleBoard - Ruffin&lt;br /&gt;
:::Google acound made, along with Gmail and Google vouice accounts&lt;br /&gt;
'''7.''' Create an email script to send email with attachments - Tom&lt;br /&gt;
:::Email sending&lt;br /&gt;
'''8.''' Encode the raw audio from ALSA into mp3 format - Kevin&lt;br /&gt;
:::Able to record on bone, use lame to convert file, and SCP to send to PC and listen to the recording&lt;br /&gt;
'''9.''' Capture an image using GStreamer - Kevin &amp;amp; Tom&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''10.''' Create a C program to capture the audio and listen for GPIO inputs - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''11.''' Putting all the pieces together - Tom, Kevin, &amp;amp; Ruffin&lt;br /&gt;
:::Making c file for initializing GPIOs, interrupts and start up scripts for VNS server&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import smtplib, os&lt;br /&gt;
from email.MIMEMultipart import MIMEMultipart&lt;br /&gt;
from email.MIMEBase import MIMEBase&lt;br /&gt;
from email.MIMEText import MIMEText&lt;br /&gt;
from email.Utils import COMMASPACE, formatdate&lt;br /&gt;
from email import Encoders&lt;br /&gt;
&lt;br /&gt;
def send_mail():&lt;br /&gt;
    #This version promts the user to specify recipient, files,&lt;br /&gt;
    #subject, and message. The version for incorperating in the&lt;br /&gt;
    #notifier will need to read from a preferences file that &lt;br /&gt;
    #should be modifiable by the user.&lt;br /&gt;
&lt;br /&gt;
    send_to = raw_input(&amp;quot;Send To (Separated by a comma): &amp;quot;)&lt;br /&gt;
    files = raw_input(&amp;quot;Files (Separated by a comma): &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    send_to=send_to.split(',')&lt;br /&gt;
    files=filter(None, files.split(','))&lt;br /&gt;
&lt;br /&gt;
    #Make sure that we are working with a list&lt;br /&gt;
    assert type(send_to)==list&lt;br /&gt;
    assert type(files)==list&lt;br /&gt;
&lt;br /&gt;
    send_from = raw_input(&amp;quot;Send From: &amp;quot;)&lt;br /&gt;
    subject = raw_input(&amp;quot;Subject: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    #Create a message object that we will be sending&lt;br /&gt;
    msg = MIMEMultipart()&lt;br /&gt;
    msg['From'] = send_from&lt;br /&gt;
    msg['To'] = COMMASPACE.join(send_to)&lt;br /&gt;
    msg['Date'] = formatdate(localtime=True)&lt;br /&gt;
    msg['Subject'] = subject&lt;br /&gt;
&lt;br /&gt;
    text = raw_input(&amp;quot;Message: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    msg.attach( MIMEText(text) )&lt;br /&gt;
&lt;br /&gt;
    #Attach files to message&lt;br /&gt;
    for f in files:&lt;br /&gt;
        part = MIMEBase('application', &amp;quot;octet-stream&amp;quot;)&lt;br /&gt;
        part.set_payload( open(f,&amp;quot;rb&amp;quot;).read() )&lt;br /&gt;
        Encoders.encode_base64(part)&lt;br /&gt;
        part.add_header('Content-Disposition', 'attachment; filename=&amp;quot;%s&amp;quot;' % os.path.basename(f))&lt;br /&gt;
        msg.attach(part)&lt;br /&gt;
&lt;br /&gt;
    #Open up a connection to the gmail servers on port 587&lt;br /&gt;
    server = smtplib.SMTP('smtp.gmail.com',587) #port 465 or 587&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    server.starttls()&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    #password = getpass()&lt;br /&gt;
    password=&amp;quot;beagleece497&amp;quot;&lt;br /&gt;
    server.login(send_from, password)&lt;br /&gt;
    server.sendmail(send_from,&amp;quot;,&amp;quot;.join(send_to),msg.as_string())&lt;br /&gt;
    server.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    send_mail()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Web Interface using HTML and NodeJS&lt;br /&gt;
&lt;br /&gt;
== Parts ==&lt;br /&gt;
&lt;br /&gt;
[http://beagleboard.org/bone Beagle Bone]&lt;br /&gt;
&lt;br /&gt;
[http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html PlayStation Eye]&lt;br /&gt;
&lt;br /&gt;
[http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]&lt;br /&gt;
&lt;br /&gt;
[http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger]&lt;br /&gt;
&lt;br /&gt;
[http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&amp;lt;br&amp;gt; Need More Cake&lt;br /&gt;
&lt;br /&gt;
{{BeagleVNSFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-11-02T16:07:48Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Work Breakdown */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{BeagleVNSHead}}&lt;br /&gt;
[[File:BeagleVNS.png|thumb|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:WhereIsYoder.png|thumb|Where is Dr. Yoder?]]&lt;br /&gt;
[[File:WhereIsYoder2.png|thumb|I'll leave him a message]]&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
At this time, we have a method for capturing audio for a specified amount of time and encoding that recording into a mp3 file.  We also have python script that allows the user to send email messages to another email by running a script.  We also have a working external power source for the beagle.&lt;br /&gt;
&lt;br /&gt;
The wireless usb adapter does not work at this time.  We are still trying to get recompile the kernel to install and enable the driver for this wireless adapter.&lt;br /&gt;
&lt;br /&gt;
Overall we are looking at creating a c program that will record the audio while the button is being pressed.  Once the button has been released the program will encode the raw audio into mp3 format, and then attach it via an email and send it to the owner of the Beagle VNS system.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
*'''Angstrom A5 Image'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the camera drivers for the playstation eye you will need to install the A5 image on the beagle bone.  To do this you will need to download the A5 image.  Then you will need to install this image on the sd card of the BeagleBone using the instructions bases on [http://elinux.org/EBC_Exercise_03_Installing_a_Beagle_OS| ECE 497 Exercise 03 Installing a Beagle OS].&lt;br /&gt;
&lt;br /&gt;
*'''github'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the project code for the Beagle VNS, you will need github installed in order to download the code.  If you do not have github there are instruction on how to install it on the [[EBC Exercise 16 git |ECE Exercise 16]] web page.&lt;br /&gt;
&lt;br /&gt;
::To download the code for the Beagle VNS run the following code:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''git clone https://github.com/geislekj/BeagleBoardVNS.git'''&lt;br /&gt;
&lt;br /&gt;
*'''Python'''&lt;br /&gt;
&lt;br /&gt;
::Python is natively installed on the Beagle operating system.  However it is important to note that the program will be using a python script to send email.&lt;br /&gt;
&lt;br /&gt;
*'''ALSA'''&lt;br /&gt;
&lt;br /&gt;
::The project uses ALSA drivers in order to record audio from a microphone device.&lt;br /&gt;
&lt;br /&gt;
::In order to download the ALSA drivers you will need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg update'''&lt;br /&gt;
 beagle$ '''opkg install alsa-utils-aplay alsa-utils-amixer'''&lt;br /&gt;
&lt;br /&gt;
*'''Lame'''&lt;br /&gt;
&lt;br /&gt;
::Lame is a audio encoder that will take raw audio and convert it into an mp3 format.&lt;br /&gt;
&lt;br /&gt;
::To install the lame onto the beagle board you will need to run the following command.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg install lame'''&lt;br /&gt;
&lt;br /&gt;
*GStreamer&lt;br /&gt;
&lt;br /&gt;
::GStreamer is an application that allows the user to capture video from a camera for multiple types of solutions.  For this project, it is being used to capture an image of the person leaving a message.&lt;br /&gt;
&lt;br /&gt;
::Instructions to install GStreamer is still in the process of being developed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_256x249.jpg|320px|thumb|right|BeagleBone]]&lt;br /&gt;
[[File:PlayStation-Eye.png|320px|thumb|right|PlayStation Eye]]&lt;br /&gt;
[[File:Belkin_N150_Micro_Wireless_USB_Adapter.jpg|320px|thumb|right|Belkin N150 Micro Wireless USB Adapter]]&lt;br /&gt;
&lt;br /&gt;
*BeagleBone&lt;br /&gt;
&lt;br /&gt;
::This project is design primarily for the BeagleBone, but could be implemented on any other Beagle Board given the proper driver installation for the USB hardware and available GPIOs. The BeagleBone is applicable for this project due to is small size, low power consumption, and networking capabilities. Make sure to use the A5 image of Ångström as the A6 image is still buggy with respect to audio/video capturing, as well as using the USB WiFi drivers.&lt;br /&gt;
&lt;br /&gt;
::Further BeagleBone documentation can be found on the official [http://beagleboard.org Beagle Board] website.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [https://www.adafruit.com/products/513 here]  &lt;br /&gt;
&lt;br /&gt;
*Camera&lt;br /&gt;
&lt;br /&gt;
::In this project tutorial, we will be using the [http://en.wikipedia.org/wiki/PlayStation_Eye  PlayStation Eye] as the audio and video source to recod messages and capture face images. The PlayStation Eye is very compatible with the A5 image of Ångström and used in many other Beagle embedded Linux projects.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html here]  &lt;br /&gt;
&lt;br /&gt;
*Wifi dongle&lt;br /&gt;
&lt;br /&gt;
::Here we would like to use a WiFi dongle to easily connect to surrounding wireless networks for ease of installation and placement in the remote stretches of hallways and doorframes. We will need we will need network connectivity to transmit e-mails and recording attachments over to an available e-mail server account. In particularly we are using the [http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]. &lt;br /&gt;
&lt;br /&gt;
::Although this device is not natively supported with the stock A5 image of Ångström, a brief tutorial has already been made on how to compile and install the device drivers for this particular wireless USB adapter: [http://embeddedgeeks.wordpress.com/2012/01/03/belkin-micro-wifi-usb-dongle-on-the-beagleboard/ Belkin Micro Wi-Fi USB dongle on the BeagleBoard]&lt;br /&gt;
&lt;br /&gt;
*Battery Pack and USB Hub&lt;br /&gt;
&lt;br /&gt;
::To again better a ease installation and quick deployment for our system we are using a battery pack to provide power for the BeagleBone, the WiFi dongle and the USB camera. Due to the hottest limitations of the Beagle bones single USB port, in addition to the limited amount of current that the single USB port can provide, we will also use a USB hub with power adapter to solve both issues.&lt;br /&gt;
&lt;br /&gt;
::Specific products we are using included [http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger] and [http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
*Doorbell&lt;br /&gt;
&lt;br /&gt;
::In order for the end user to trigger the recording sequence, we will implement a traditional mechanical momentary pushbutton that will connect to the BeagleBone’s GPIO using the enabled internal pull-up resistors.&lt;br /&gt;
&lt;br /&gt;
*LED&lt;br /&gt;
&lt;br /&gt;
::As a simple display, our project will utilize a simple LED as an indicator for the user that the audio is currently being recorded and that a face capture will be taken.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
*'''Basic Command Line Examples'''&lt;br /&gt;
&lt;br /&gt;
:: In order to give you a feel to how the program is capturing and sending emails.  Here is a short run down of how the program works&lt;br /&gt;
&lt;br /&gt;
:*'''Audio Capture'''&lt;br /&gt;
&lt;br /&gt;
::: In order to capture audio, the project uses arecord.  This application allows you to grab audio from a microphone that is attached to your device and save to the current directory in a raw format.  &lt;br /&gt;
&lt;br /&gt;
:::Here is an example command that allows you to record audio and then pipe the audio into aplay to instantaneously hear feedback:&lt;br /&gt;
&lt;br /&gt;
 beagle$ arecord -D plughw:1,0 | aplay&lt;br /&gt;
&lt;br /&gt;
:::In order to encode the audio into mp3 format, you will need to pipe the audio into lame instead of aplay.&lt;br /&gt;
&lt;br /&gt;
:::Here is an example of this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ arecord -D plughw:2,0 -r 16000 -f S16_LE -c 2 -t raw -d 3 | lame  -s 16 -r - blackbird.mp3&lt;br /&gt;
&lt;br /&gt;
::: For more information about ALSA and how to use many of its interesting features visit [http://www.lvr.com/access_usb_devices_from_linux.htm | Jan Axelson's Lakeview Research web page]&lt;br /&gt;
&lt;br /&gt;
:*'''Email Script'''&lt;br /&gt;
&lt;br /&gt;
::: A python mail client that prompts the user for information to send an email with optional attachments.&lt;br /&gt;
&lt;br /&gt;
  python smtp-mail-client-attachments.py&lt;br /&gt;
&lt;br /&gt;
  Send To (Separated by a comma): &lt;br /&gt;
  Files (Separated by a comma): &lt;br /&gt;
  Send From: beagle497@gmail.com #Must use this email for now&lt;br /&gt;
  Subject: &lt;br /&gt;
  Message:&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Acquire Hardware - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''2.''' Set up project page - Tom &amp;amp; Kevin&lt;br /&gt;
:::Page made and updated&lt;br /&gt;
'''3.''' Get USB wireless to work - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is not working at this time for A6 image&lt;br /&gt;
'''4.''' Get PlayStation Eye to work - Tom&lt;br /&gt;
:::Audio working, need to use A5 image&lt;br /&gt;
:::Passing capture video on to Ruffin&lt;br /&gt;
'''5.''' Get BeagleBoard Bone to run off a battery pack - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''6.''' Register an email for the BeagleBoard - Ruffin&lt;br /&gt;
:::Google acound made, along with Gmail and Google vouice accounts&lt;br /&gt;
'''7.''' Create an email script to send email with attachments - Tom&lt;br /&gt;
:::Email sending&lt;br /&gt;
'''8.''' Encode the raw audio from ALSA into mp3 format - Kevin&lt;br /&gt;
:::Able to record on bone, use lame to convert file, and SCP to send to PC and listen to the recording&lt;br /&gt;
'''9.''' Capture an image using GStreamer - Kevin &amp;amp; Tom&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''10.''' Create a C program to capture the audio and listen for GPIO inputs - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''11.''' Putting all the pieces together - Tom, Kevin, &amp;amp; Ruffin&lt;br /&gt;
:::Making c file for initializing GPIOs, interrupts and start up scripts for VNS server&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import smtplib, os&lt;br /&gt;
from email.MIMEMultipart import MIMEMultipart&lt;br /&gt;
from email.MIMEBase import MIMEBase&lt;br /&gt;
from email.MIMEText import MIMEText&lt;br /&gt;
from email.Utils import COMMASPACE, formatdate&lt;br /&gt;
from email import Encoders&lt;br /&gt;
&lt;br /&gt;
def send_mail():&lt;br /&gt;
    #This version promts the user to specify recipient, files,&lt;br /&gt;
    #subject, and message. The version for incorperating in the&lt;br /&gt;
    #notifier will need to read from a preferences file that &lt;br /&gt;
    #should be modifiable by the user.&lt;br /&gt;
&lt;br /&gt;
    send_to = raw_input(&amp;quot;Send To (Separated by a comma): &amp;quot;)&lt;br /&gt;
    files = raw_input(&amp;quot;Files (Separated by a comma): &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    send_to=send_to.split(',')&lt;br /&gt;
    files=filter(None, files.split(','))&lt;br /&gt;
&lt;br /&gt;
    #Make sure that we are working with a list&lt;br /&gt;
    assert type(send_to)==list&lt;br /&gt;
    assert type(files)==list&lt;br /&gt;
&lt;br /&gt;
    send_from = raw_input(&amp;quot;Send From: &amp;quot;)&lt;br /&gt;
    subject = raw_input(&amp;quot;Subject: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    #Create a message object that we will be sending&lt;br /&gt;
    msg = MIMEMultipart()&lt;br /&gt;
    msg['From'] = send_from&lt;br /&gt;
    msg['To'] = COMMASPACE.join(send_to)&lt;br /&gt;
    msg['Date'] = formatdate(localtime=True)&lt;br /&gt;
    msg['Subject'] = subject&lt;br /&gt;
&lt;br /&gt;
    text = raw_input(&amp;quot;Message: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    msg.attach( MIMEText(text) )&lt;br /&gt;
&lt;br /&gt;
    #Attach files to message&lt;br /&gt;
    for f in files:&lt;br /&gt;
        part = MIMEBase('application', &amp;quot;octet-stream&amp;quot;)&lt;br /&gt;
        part.set_payload( open(f,&amp;quot;rb&amp;quot;).read() )&lt;br /&gt;
        Encoders.encode_base64(part)&lt;br /&gt;
        part.add_header('Content-Disposition', 'attachment; filename=&amp;quot;%s&amp;quot;' % os.path.basename(f))&lt;br /&gt;
        msg.attach(part)&lt;br /&gt;
&lt;br /&gt;
    #Open up a connection to the gmail servers on port 587&lt;br /&gt;
    server = smtplib.SMTP('smtp.gmail.com',587) #port 465 or 587&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    server.starttls()&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    #password = getpass()&lt;br /&gt;
    password=&amp;quot;beagleece497&amp;quot;&lt;br /&gt;
    server.login(send_from, password)&lt;br /&gt;
    server.sendmail(send_from,&amp;quot;,&amp;quot;.join(send_to),msg.as_string())&lt;br /&gt;
    server.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    send_mail()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Web Interface using HTML and NodeJS&lt;br /&gt;
&lt;br /&gt;
== Parts ==&lt;br /&gt;
&lt;br /&gt;
[http://beagleboard.org/bone Beagle Bone]&lt;br /&gt;
&lt;br /&gt;
[http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html PlayStation Eye]&lt;br /&gt;
&lt;br /&gt;
[http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]&lt;br /&gt;
&lt;br /&gt;
[http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger]&lt;br /&gt;
&lt;br /&gt;
[http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&amp;lt;br&amp;gt; Need More Cake&lt;br /&gt;
&lt;br /&gt;
{{BeagleVNSFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-11-02T16:06:27Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Work Breakdown */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{BeagleVNSHead}}&lt;br /&gt;
[[File:BeagleVNS.png|thumb|]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:WhereIsYoder.png|thumb|Where is Dr. Yoder?]]&lt;br /&gt;
[[File:WhereIsYoder2.png|thumb|I'll leave him a message]]&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
At this time, we have a method for capturing audio for a specified amount of time and encoding that recording into a mp3 file.  We also have python script that allows the user to send email messages to another email by running a script.  We also have a working external power source for the beagle.&lt;br /&gt;
&lt;br /&gt;
The wireless usb adapter does not work at this time.  We are still trying to get recompile the kernel to install and enable the driver for this wireless adapter.&lt;br /&gt;
&lt;br /&gt;
Overall we are looking at creating a c program that will record the audio while the button is being pressed.  Once the button has been released the program will encode the raw audio into mp3 format, and then attach it via an email and send it to the owner of the Beagle VNS system.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
*'''Angstrom A5 Image'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the camera drivers for the playstation eye you will need to install the A5 image on the beagle bone.  To do this you will need to download the A5 image.  Then you will need to install this image on the sd card of the BeagleBone using the instructions bases on [http://elinux.org/EBC_Exercise_03_Installing_a_Beagle_OS| ECE 497 Exercise 03 Installing a Beagle OS].&lt;br /&gt;
&lt;br /&gt;
*'''github'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the project code for the Beagle VNS, you will need github installed in order to download the code.  If you do not have github there are instruction on how to install it on the [[EBC Exercise 16 git |ECE Exercise 16]] web page.&lt;br /&gt;
&lt;br /&gt;
::To download the code for the Beagle VNS run the following code:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''git clone https://github.com/geislekj/BeagleBoardVNS.git'''&lt;br /&gt;
&lt;br /&gt;
*'''Python'''&lt;br /&gt;
&lt;br /&gt;
::Python is natively installed on the Beagle operating system.  However it is important to note that the program will be using a python script to send email.&lt;br /&gt;
&lt;br /&gt;
*'''ALSA'''&lt;br /&gt;
&lt;br /&gt;
::The project uses ALSA drivers in order to record audio from a microphone device.&lt;br /&gt;
&lt;br /&gt;
::In order to download the ALSA drivers you will need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg update'''&lt;br /&gt;
 beagle$ '''opkg install alsa-utils-aplay alsa-utils-amixer'''&lt;br /&gt;
&lt;br /&gt;
*'''Lame'''&lt;br /&gt;
&lt;br /&gt;
::Lame is a audio encoder that will take raw audio and convert it into an mp3 format.&lt;br /&gt;
&lt;br /&gt;
::To install the lame onto the beagle board you will need to run the following command.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg install lame'''&lt;br /&gt;
&lt;br /&gt;
*GStreamer&lt;br /&gt;
&lt;br /&gt;
::GStreamer is an application that allows the user to capture video from a camera for multiple types of solutions.  For this project, it is being used to capture an image of the person leaving a message.&lt;br /&gt;
&lt;br /&gt;
::Instructions to install GStreamer is still in the process of being developed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_256x249.jpg|320px|thumb|right|BeagleBone]]&lt;br /&gt;
[[File:PlayStation-Eye.png|320px|thumb|right|PlayStation Eye]]&lt;br /&gt;
[[File:Belkin_N150_Micro_Wireless_USB_Adapter.jpg|320px|thumb|right|Belkin N150 Micro Wireless USB Adapter]]&lt;br /&gt;
&lt;br /&gt;
*BeagleBone&lt;br /&gt;
&lt;br /&gt;
::This project is design primarily for the BeagleBone, but could be implemented on any other Beagle Board given the proper driver installation for the USB hardware and available GPIOs. The BeagleBone is applicable for this project due to is small size, low power consumption, and networking capabilities. Make sure to use the A5 image of Ångström as the A6 image is still buggy with respect to audio/video capturing, as well as using the USB WiFi drivers.&lt;br /&gt;
&lt;br /&gt;
::Further BeagleBone documentation can be found on the official [http://beagleboard.org Beagle Board] website.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [https://www.adafruit.com/products/513 here]  &lt;br /&gt;
&lt;br /&gt;
*Camera&lt;br /&gt;
&lt;br /&gt;
::In this project tutorial, we will be using the [http://en.wikipedia.org/wiki/PlayStation_Eye  PlayStation Eye] as the audio and video source to recod messages and capture face images. The PlayStation Eye is very compatible with the A5 image of Ångström and used in many other Beagle embedded Linux projects.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html here]  &lt;br /&gt;
&lt;br /&gt;
*Wifi dongle&lt;br /&gt;
&lt;br /&gt;
::Here we would like to use a WiFi dongle to easily connect to surrounding wireless networks for ease of installation and placement in the remote stretches of hallways and doorframes. We will need we will need network connectivity to transmit e-mails and recording attachments over to an available e-mail server account. In particularly we are using the [http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]. &lt;br /&gt;
&lt;br /&gt;
::Although this device is not natively supported with the stock A5 image of Ångström, a brief tutorial has already been made on how to compile and install the device drivers for this particular wireless USB adapter: [http://embeddedgeeks.wordpress.com/2012/01/03/belkin-micro-wifi-usb-dongle-on-the-beagleboard/ Belkin Micro Wi-Fi USB dongle on the BeagleBoard]&lt;br /&gt;
&lt;br /&gt;
*Battery Pack and USB Hub&lt;br /&gt;
&lt;br /&gt;
::To again better a ease installation and quick deployment for our system we are using a battery pack to provide power for the BeagleBone, the WiFi dongle and the USB camera. Due to the hottest limitations of the Beagle bones single USB port, in addition to the limited amount of current that the single USB port can provide, we will also use a USB hub with power adapter to solve both issues.&lt;br /&gt;
&lt;br /&gt;
::Specific products we are using included [http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger] and [http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
*Doorbell&lt;br /&gt;
&lt;br /&gt;
::In order for the end user to trigger the recording sequence, we will implement a traditional mechanical momentary pushbutton that will connect to the BeagleBone’s GPIO using the enabled internal pull-up resistors.&lt;br /&gt;
&lt;br /&gt;
*LED&lt;br /&gt;
&lt;br /&gt;
::As a simple display, our project will utilize a simple LED as an indicator for the user that the audio is currently being recorded and that a face capture will be taken.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
*'''Basic Command Line Examples'''&lt;br /&gt;
&lt;br /&gt;
:: In order to give you a feel to how the program is capturing and sending emails.  Here is a short run down of how the program works&lt;br /&gt;
&lt;br /&gt;
:*'''Audio Capture'''&lt;br /&gt;
&lt;br /&gt;
::: In order to capture audio, the project uses arecord.  This application allows you to grab audio from a microphone that is attached to your device and save to the current directory in a raw format.  &lt;br /&gt;
&lt;br /&gt;
:::Here is an example command that allows you to record audio and then pipe the audio into aplay to instantaneously hear feedback:&lt;br /&gt;
&lt;br /&gt;
 beagle$ arecord -D plughw:1,0 | aplay&lt;br /&gt;
&lt;br /&gt;
:::In order to encode the audio into mp3 format, you will need to pipe the audio into lame instead of aplay.&lt;br /&gt;
&lt;br /&gt;
:::Here is an example of this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ arecord -D plughw:2,0 -r 16000 -f S16_LE -c 2 -t raw -d 3 | lame  -s 16 -r - blackbird.mp3&lt;br /&gt;
&lt;br /&gt;
::: For more information about ALSA and how to use many of its interesting features visit [http://www.lvr.com/access_usb_devices_from_linux.htm | Jan Axelson's Lakeview Research web page]&lt;br /&gt;
&lt;br /&gt;
:*'''Email Script'''&lt;br /&gt;
&lt;br /&gt;
::: A python mail client that prompts the user for information to send an email with optional attachments.&lt;br /&gt;
&lt;br /&gt;
  python smtp-mail-client-attachments.py&lt;br /&gt;
&lt;br /&gt;
  Send To (Separated by a comma): &lt;br /&gt;
  Files (Separated by a comma): &lt;br /&gt;
  Send From: beagle497@gmail.com #Must use this email for now&lt;br /&gt;
  Subject: &lt;br /&gt;
  Message:&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
'''1.''' Acquire Hardware - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''2.''' Set up project page - Tom &amp;amp; Kevin&lt;br /&gt;
:::Page made and updated&lt;br /&gt;
'''3.''' Get USB wireless to work - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is not working at this time for A6 image&lt;br /&gt;
'''4.''' Get PlayStation Eye to work - Tom&lt;br /&gt;
:::Audio working, need to use A5 image&lt;br /&gt;
:::Passing capture video on to Ruffin&lt;br /&gt;
'''5.''' Get BeagleBoard Bone to run off a battery pack - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
'''6.''' Register an email for the BeagleBoard - Ruffin&lt;br /&gt;
:::Google acound made, along with Gmail and Google vouice accounts&lt;br /&gt;
'''7.''' Create an email script to send email with attachments - Tom&lt;br /&gt;
:::Email sending, google is blocking attachments however&lt;br /&gt;
'''8.''' Encode the raw audio from ALSA into mp3 format - Kevin&lt;br /&gt;
:::Able to record on bone, use lame to convert file, and SCP to send to PC and listen to the recording&lt;br /&gt;
'''9.''' Capture an image using GStreamer - Kevin &amp;amp; Tom&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''10.''' Create a C program to capture the audio and listen for GPIO inputs - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
'''11.''' Putting all the pieces together - Tom, Kevin, &amp;amp; Ruffin&lt;br /&gt;
:::Making c file for initializing GPIOs, interrupts and start up scripts for VNS server&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import smtplib, os&lt;br /&gt;
from email.MIMEMultipart import MIMEMultipart&lt;br /&gt;
from email.MIMEBase import MIMEBase&lt;br /&gt;
from email.MIMEText import MIMEText&lt;br /&gt;
from email.Utils import COMMASPACE, formatdate&lt;br /&gt;
from email import Encoders&lt;br /&gt;
&lt;br /&gt;
def send_mail():&lt;br /&gt;
    #This version promts the user to specify recipient, files,&lt;br /&gt;
    #subject, and message. The version for incorperating in the&lt;br /&gt;
    #notifier will need to read from a preferences file that &lt;br /&gt;
    #should be modifiable by the user.&lt;br /&gt;
&lt;br /&gt;
    send_to = raw_input(&amp;quot;Send To (Separated by a comma): &amp;quot;)&lt;br /&gt;
    files = raw_input(&amp;quot;Files (Separated by a comma): &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    send_to=send_to.split(',')&lt;br /&gt;
    files=filter(None, files.split(','))&lt;br /&gt;
&lt;br /&gt;
    #Make sure that we are working with a list&lt;br /&gt;
    assert type(send_to)==list&lt;br /&gt;
    assert type(files)==list&lt;br /&gt;
&lt;br /&gt;
    send_from = raw_input(&amp;quot;Send From: &amp;quot;)&lt;br /&gt;
    subject = raw_input(&amp;quot;Subject: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    #Create a message object that we will be sending&lt;br /&gt;
    msg = MIMEMultipart()&lt;br /&gt;
    msg['From'] = send_from&lt;br /&gt;
    msg['To'] = COMMASPACE.join(send_to)&lt;br /&gt;
    msg['Date'] = formatdate(localtime=True)&lt;br /&gt;
    msg['Subject'] = subject&lt;br /&gt;
&lt;br /&gt;
    text = raw_input(&amp;quot;Message: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    msg.attach( MIMEText(text) )&lt;br /&gt;
&lt;br /&gt;
    #Attach files to message&lt;br /&gt;
    for f in files:&lt;br /&gt;
        part = MIMEBase('application', &amp;quot;octet-stream&amp;quot;)&lt;br /&gt;
        part.set_payload( open(f,&amp;quot;rb&amp;quot;).read() )&lt;br /&gt;
        Encoders.encode_base64(part)&lt;br /&gt;
        part.add_header('Content-Disposition', 'attachment; filename=&amp;quot;%s&amp;quot;' % os.path.basename(f))&lt;br /&gt;
        msg.attach(part)&lt;br /&gt;
&lt;br /&gt;
    #Open up a connection to the gmail servers on port 587&lt;br /&gt;
    server = smtplib.SMTP('smtp.gmail.com',587) #port 465 or 587&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    server.starttls()&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    #password = getpass()&lt;br /&gt;
    password=&amp;quot;beagleece497&amp;quot;&lt;br /&gt;
    server.login(send_from, password)&lt;br /&gt;
    server.sendmail(send_from,&amp;quot;,&amp;quot;.join(send_to),msg.as_string())&lt;br /&gt;
    server.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    send_mail()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Web Interface using HTML and NodeJS&lt;br /&gt;
&lt;br /&gt;
== Parts ==&lt;br /&gt;
&lt;br /&gt;
[http://beagleboard.org/bone Beagle Bone]&lt;br /&gt;
&lt;br /&gt;
[http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html PlayStation Eye]&lt;br /&gt;
&lt;br /&gt;
[http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]&lt;br /&gt;
&lt;br /&gt;
[http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger]&lt;br /&gt;
&lt;br /&gt;
[http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&amp;lt;br&amp;gt; Need More Cake&lt;br /&gt;
&lt;br /&gt;
{{BeagleVNSFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-11-02T16:01:57Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* User Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{BeagleVNSHead}}&lt;br /&gt;
[[File:BeagleVNS.png|thumb|]]&lt;br /&gt;
&lt;br /&gt;
Team members:[[User:atniptw | Tom Atnip]],[[User:Geislekj | Kevin Geisler]],[[user:Ruff | Ruffin White]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:WhereIsYoder.png|thumb|Where is Dr. Yoder?]]&lt;br /&gt;
[[File:WhereIsYoder2.png|thumb|I'll leave him a message]]&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
At this time, we have a method for capturing audio for a specified amount of time and encoding that recording into a mp3 file.  We also have python script that allows the user to send email messages to another email by running a script.  We also have a working external power source for the beagle.&lt;br /&gt;
&lt;br /&gt;
The wireless usb adapter does not work at this time.  We are still trying to get recompile the kernel to install and enable the driver for this wireless adapter.&lt;br /&gt;
&lt;br /&gt;
Overall we are looking at creating a c program that will record the audio while the button is being pressed.  Once the button has been released the program will encode the raw audio into mp3 format, and then attach it via an email and send it to the owner of the Beagle VNS system.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
*'''Angstrom A5 Image'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the camera drivers for the playstation eye you will need to install the A5 image on the beagle bone.  To do this you will need to download the A5 image.  Then you will need to install this image on the sd card of the BeagleBone using the instructions bases on [http://elinux.org/EBC_Exercise_03_Installing_a_Beagle_OS| ECE 497 Exercise 03 Installing a Beagle OS].&lt;br /&gt;
&lt;br /&gt;
*'''github'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the project code for the Beagle VNS, you will need github installed in order to download the code.  If you do not have github there are instruction on how to install it on the [[EBC Exercise 16 git |ECE Exercise 16]] web page.&lt;br /&gt;
&lt;br /&gt;
::To download the code for the Beagle VNS run the following code:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''git clone https://github.com/geislekj/BeagleBoardVNS.git'''&lt;br /&gt;
&lt;br /&gt;
*'''Python'''&lt;br /&gt;
&lt;br /&gt;
::Python is natively installed on the Beagle operating system.  However it is important to note that the program will be using a python script to send email.&lt;br /&gt;
&lt;br /&gt;
*'''ALSA'''&lt;br /&gt;
&lt;br /&gt;
::The project uses ALSA drivers in order to record audio from a microphone device.&lt;br /&gt;
&lt;br /&gt;
::In order to download the ALSA drivers you will need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg update'''&lt;br /&gt;
 beagle$ '''opkg install alsa-utils-aplay alsa-utils-amixer'''&lt;br /&gt;
&lt;br /&gt;
*'''Lame'''&lt;br /&gt;
&lt;br /&gt;
::Lame is a audio encoder that will take raw audio and convert it into an mp3 format.&lt;br /&gt;
&lt;br /&gt;
::To install the lame onto the beagle board you will need to run the following command.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg install lame'''&lt;br /&gt;
&lt;br /&gt;
*GStreamer&lt;br /&gt;
&lt;br /&gt;
::GStreamer is an application that allows the user to capture video from a camera for multiple types of solutions.  For this project, it is being used to capture an image of the person leaving a message.&lt;br /&gt;
&lt;br /&gt;
::Instructions to install GStreamer is still in the process of being developed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_256x249.jpg|320px|thumb|right|BeagleBone]]&lt;br /&gt;
[[File:PlayStation-Eye.png|320px|thumb|right|PlayStation Eye]]&lt;br /&gt;
[[File:Belkin_N150_Micro_Wireless_USB_Adapter.jpg|320px|thumb|right|Belkin N150 Micro Wireless USB Adapter]]&lt;br /&gt;
&lt;br /&gt;
*BeagleBone&lt;br /&gt;
&lt;br /&gt;
::This project is design primarily for the BeagleBone, but could be implemented on any other Beagle Board given the proper driver installation for the USB hardware and available GPIOs. The BeagleBone is applicable for this project due to is small size, low power consumption, and networking capabilities. Make sure to use the A5 image of Ångström as the A6 image is still buggy with respect to audio/video capturing, as well as using the USB WiFi drivers.&lt;br /&gt;
&lt;br /&gt;
::Further BeagleBone documentation can be found on the official [http://beagleboard.org Beagle Board] website.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [https://www.adafruit.com/products/513 here]  &lt;br /&gt;
&lt;br /&gt;
*Camera&lt;br /&gt;
&lt;br /&gt;
::In this project tutorial, we will be using the [http://en.wikipedia.org/wiki/PlayStation_Eye  PlayStation Eye] as the audio and video source to recod messages and capture face images. The PlayStation Eye is very compatible with the A5 image of Ångström and used in many other Beagle embedded Linux projects.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html here]  &lt;br /&gt;
&lt;br /&gt;
*Wifi dongle&lt;br /&gt;
&lt;br /&gt;
::Here we would like to use a WiFi dongle to easily connect to surrounding wireless networks for ease of installation and placement in the remote stretches of hallways and doorframes. We will need we will need network connectivity to transmit e-mails and recording attachments over to an available e-mail server account. In particularly we are using the [http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]. &lt;br /&gt;
&lt;br /&gt;
::Although this device is not natively supported with the stock A5 image of Ångström, a brief tutorial has already been made on how to compile and install the device drivers for this particular wireless USB adapter: [http://embeddedgeeks.wordpress.com/2012/01/03/belkin-micro-wifi-usb-dongle-on-the-beagleboard/ Belkin Micro Wi-Fi USB dongle on the BeagleBoard]&lt;br /&gt;
&lt;br /&gt;
*Battery Pack and USB Hub&lt;br /&gt;
&lt;br /&gt;
::To again better a ease installation and quick deployment for our system we are using a battery pack to provide power for the BeagleBone, the WiFi dongle and the USB camera. Due to the hottest limitations of the Beagle bones single USB port, in addition to the limited amount of current that the single USB port can provide, we will also use a USB hub with power adapter to solve both issues.&lt;br /&gt;
&lt;br /&gt;
::Specific products we are using included [http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger] and [http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
*Doorbell&lt;br /&gt;
&lt;br /&gt;
::In order for the end user to trigger the recording sequence, we will implement a traditional mechanical momentary pushbutton that will connect to the BeagleBone’s GPIO using the enabled internal pull-up resistors.&lt;br /&gt;
&lt;br /&gt;
*LED&lt;br /&gt;
&lt;br /&gt;
::As a simple display, our project will utilize a simple LED as an indicator for the user that the audio is currently being recorded and that a face capture will be taken.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
*'''Basic Command Line Examples'''&lt;br /&gt;
&lt;br /&gt;
:: In order to give you a feel to how the program is capturing and sending emails.  Here is a short run down of how the program works&lt;br /&gt;
&lt;br /&gt;
:*'''Audio Capture'''&lt;br /&gt;
&lt;br /&gt;
::: In order to capture audio, the project uses arecord.  This application allows you to grab audio from a microphone that is attached to your device and save to the current directory in a raw format.  &lt;br /&gt;
&lt;br /&gt;
:::Here is an example command that allows you to record audio and then pipe the audio into aplay to instantaneously hear feedback:&lt;br /&gt;
&lt;br /&gt;
 beagle$ arecord -D plughw:1,0 | aplay&lt;br /&gt;
&lt;br /&gt;
:::In order to encode the audio into mp3 format, you will need to pipe the audio into lame instead of aplay.&lt;br /&gt;
&lt;br /&gt;
:::Here is an example of this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ arecord -D plughw:2,0 -r 16000 -f S16_LE -c 2 -t raw -d 3 | lame  -s 16 -r - blackbird.mp3&lt;br /&gt;
&lt;br /&gt;
::: For more information about ALSA and how to use many of its interesting features visit [http://www.lvr.com/access_usb_devices_from_linux.htm | Jan Axelson's Lakeview Research web page]&lt;br /&gt;
&lt;br /&gt;
:*'''Email Script'''&lt;br /&gt;
&lt;br /&gt;
::: A python mail client that prompts the user for information to send an email with optional attachments.&lt;br /&gt;
&lt;br /&gt;
  python smtp-mail-client-attachments.py&lt;br /&gt;
&lt;br /&gt;
  Send To (Separated by a comma): &lt;br /&gt;
  Files (Separated by a comma): &lt;br /&gt;
  Send From: beagle497@gmail.com #Must use this email for now&lt;br /&gt;
  Subject: &lt;br /&gt;
  Message:&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
# Acquire Hardware - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
# Set up project page - Tom &amp;amp; Kevin&lt;br /&gt;
:::Page made and updated&lt;br /&gt;
# Get USB wireless to work - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is not working at this time for A6 image&lt;br /&gt;
# Get PlayStation Eye to work - Tom&lt;br /&gt;
:::Audio working, need to use A5 image&lt;br /&gt;
# Get BeagleBoard Bone to run off a battery pack - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
# Register an email for the BeagleBoard - Ruffin&lt;br /&gt;
:::Google acound made, along with Gmail and Google vouice accounts&lt;br /&gt;
# Create an email script to send email with attachments - Tom&lt;br /&gt;
:::Email sending, google is blocking attachments however&lt;br /&gt;
# Encode the raw audio from ALSA into mp3 format - Kevin&lt;br /&gt;
:::Able to record on bone, use lame to convert file, and SCP to send to PC and listen to the recording&lt;br /&gt;
# Capture an image using GStreamer - Kevin &amp;amp; Tom&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
# Create a C program to capture the audio and listen for GPIO inputs - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
# Putting all the pieces together - Tom, Kevin, &amp;amp; Ruffin&lt;br /&gt;
:::Making c file for initializing GPIOs, interrupts and start up scripts for VNS server&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import smtplib, os&lt;br /&gt;
from email.MIMEMultipart import MIMEMultipart&lt;br /&gt;
from email.MIMEBase import MIMEBase&lt;br /&gt;
from email.MIMEText import MIMEText&lt;br /&gt;
from email.Utils import COMMASPACE, formatdate&lt;br /&gt;
from email import Encoders&lt;br /&gt;
&lt;br /&gt;
def send_mail():&lt;br /&gt;
    #This version promts the user to specify recipient, files,&lt;br /&gt;
    #subject, and message. The version for incorperating in the&lt;br /&gt;
    #notifier will need to read from a preferences file that &lt;br /&gt;
    #should be modifiable by the user.&lt;br /&gt;
&lt;br /&gt;
    send_to = raw_input(&amp;quot;Send To (Separated by a comma): &amp;quot;)&lt;br /&gt;
    files = raw_input(&amp;quot;Files (Separated by a comma): &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    send_to=send_to.split(',')&lt;br /&gt;
    files=filter(None, files.split(','))&lt;br /&gt;
&lt;br /&gt;
    #Make sure that we are working with a list&lt;br /&gt;
    assert type(send_to)==list&lt;br /&gt;
    assert type(files)==list&lt;br /&gt;
&lt;br /&gt;
    send_from = raw_input(&amp;quot;Send From: &amp;quot;)&lt;br /&gt;
    subject = raw_input(&amp;quot;Subject: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    #Create a message object that we will be sending&lt;br /&gt;
    msg = MIMEMultipart()&lt;br /&gt;
    msg['From'] = send_from&lt;br /&gt;
    msg['To'] = COMMASPACE.join(send_to)&lt;br /&gt;
    msg['Date'] = formatdate(localtime=True)&lt;br /&gt;
    msg['Subject'] = subject&lt;br /&gt;
&lt;br /&gt;
    text = raw_input(&amp;quot;Message: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    msg.attach( MIMEText(text) )&lt;br /&gt;
&lt;br /&gt;
    #Attach files to message&lt;br /&gt;
    for f in files:&lt;br /&gt;
        part = MIMEBase('application', &amp;quot;octet-stream&amp;quot;)&lt;br /&gt;
        part.set_payload( open(f,&amp;quot;rb&amp;quot;).read() )&lt;br /&gt;
        Encoders.encode_base64(part)&lt;br /&gt;
        part.add_header('Content-Disposition', 'attachment; filename=&amp;quot;%s&amp;quot;' % os.path.basename(f))&lt;br /&gt;
        msg.attach(part)&lt;br /&gt;
&lt;br /&gt;
    #Open up a connection to the gmail servers on port 587&lt;br /&gt;
    server = smtplib.SMTP('smtp.gmail.com',587) #port 465 or 587&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    server.starttls()&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    #password = getpass()&lt;br /&gt;
    password=&amp;quot;beagleece497&amp;quot;&lt;br /&gt;
    server.login(send_from, password)&lt;br /&gt;
    server.sendmail(send_from,&amp;quot;,&amp;quot;.join(send_to),msg.as_string())&lt;br /&gt;
    server.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    send_mail()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Web Interface using HTML and NodeJS&lt;br /&gt;
&lt;br /&gt;
== Parts ==&lt;br /&gt;
&lt;br /&gt;
[http://beagleboard.org/bone Beagle Bone]&lt;br /&gt;
&lt;br /&gt;
[http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html PlayStation Eye]&lt;br /&gt;
&lt;br /&gt;
[http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]&lt;br /&gt;
&lt;br /&gt;
[http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger]&lt;br /&gt;
&lt;br /&gt;
[http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&amp;lt;br&amp;gt; Need More Cake&lt;br /&gt;
&lt;br /&gt;
{{BeagleVNSFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-11-02T16:01:00Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* User Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{BeagleVNSHead}}&lt;br /&gt;
[[File:BeagleVNS.png|thumb|]]&lt;br /&gt;
&lt;br /&gt;
Team members:[[User:atniptw | Tom Atnip]],[[User:Geislekj | Kevin Geisler]],[[user:Ruff | Ruffin White]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:WhereIsYoder.png|thumb|Where is Dr. Yoder?]]&lt;br /&gt;
[[File:WhereIsYoder2.png|thumb|I'll leave him a message]]&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
At this time, we have a method for capturing audio for a specified amount of time and encoding that recording into a mp3 file.  We also have python script that allows the user to send email messages to another email by running a script.  We also have a working external power source for the beagle.&lt;br /&gt;
&lt;br /&gt;
The wireless usb adapter does not work at this time.  We are still trying to get recompile the kernel to install and enable the driver for this wireless adapter.&lt;br /&gt;
&lt;br /&gt;
Overall we are looking at creating a c program that will record the audio while the button is being pressed.  Once the button has been released the program will encode the raw audio into mp3 format, and then attach it via an email and send it to the owner of the Beagle VNS system.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
*'''github'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the project code for the Beagle VNS, you will need github installed in order to download the code.  If you do not have github there are instruction on how to install it on the [[EBC Exercise 16 git |ECE Exercise 16]] web page.&lt;br /&gt;
&lt;br /&gt;
::To download the code for the Beagle VNS run the following code:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''git clone https://github.com/geislekj/BeagleBoardVNS.git'''&lt;br /&gt;
&lt;br /&gt;
*'''Python'''&lt;br /&gt;
&lt;br /&gt;
::Python is natively installed on the Beagle operating system.  However it is important to note that the program will be using a python script to send email.&lt;br /&gt;
&lt;br /&gt;
*'''ALSA'''&lt;br /&gt;
&lt;br /&gt;
::The project uses ALSA drivers in order to record audio from a microphone device.&lt;br /&gt;
&lt;br /&gt;
::In order to download the ALSA drivers you will need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg update'''&lt;br /&gt;
 beagle$ '''opkg install alsa-utils-aplay alsa-utils-amixer'''&lt;br /&gt;
&lt;br /&gt;
*'''Lame'''&lt;br /&gt;
&lt;br /&gt;
::Lame is a audio encoder that will take raw audio and convert it into an mp3 format.&lt;br /&gt;
&lt;br /&gt;
::To install the lame onto the beagle board you will need to run the following command.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg install lame'''&lt;br /&gt;
&lt;br /&gt;
*GStreamer&lt;br /&gt;
&lt;br /&gt;
::GStreamer is an application that allows the user to capture video from a camera for multiple types of solutions.  For this project, it is being used to capture an image of the person leaving a message.&lt;br /&gt;
&lt;br /&gt;
::Instructions to install GStreamer is still in the process of being developed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_256x249.jpg|320px|thumb|right|BeagleBone]]&lt;br /&gt;
[[File:PlayStation-Eye.png|320px|thumb|right|PlayStation Eye]]&lt;br /&gt;
[[File:Belkin_N150_Micro_Wireless_USB_Adapter.jpg|320px|thumb|right|Belkin N150 Micro Wireless USB Adapter]]&lt;br /&gt;
&lt;br /&gt;
*BeagleBone&lt;br /&gt;
&lt;br /&gt;
::This project is design primarily for the BeagleBone, but could be implemented on any other Beagle Board given the proper driver installation for the USB hardware and available GPIOs. The BeagleBone is applicable for this project due to is small size, low power consumption, and networking capabilities. Make sure to use the A5 image of Ångström as the A6 image is still buggy with respect to audio/video capturing, as well as using the USB WiFi drivers.&lt;br /&gt;
&lt;br /&gt;
::Further BeagleBone documentation can be found on the official [http://beagleboard.org Beagle Board] website.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [https://www.adafruit.com/products/513 here]  &lt;br /&gt;
&lt;br /&gt;
*Camera&lt;br /&gt;
&lt;br /&gt;
::In this project tutorial, we will be using the [http://en.wikipedia.org/wiki/PlayStation_Eye  PlayStation Eye] as the audio and video source to recod messages and capture face images. The PlayStation Eye is very compatible with the A5 image of Ångström and used in many other Beagle embedded Linux projects.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html here]  &lt;br /&gt;
&lt;br /&gt;
*Wifi dongle&lt;br /&gt;
&lt;br /&gt;
::Here we would like to use a WiFi dongle to easily connect to surrounding wireless networks for ease of installation and placement in the remote stretches of hallways and doorframes. We will need we will need network connectivity to transmit e-mails and recording attachments over to an available e-mail server account. In particularly we are using the [http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]. &lt;br /&gt;
&lt;br /&gt;
::Although this device is not natively supported with the stock A5 image of Ångström, a brief tutorial has already been made on how to compile and install the device drivers for this particular wireless USB adapter: [http://embeddedgeeks.wordpress.com/2012/01/03/belkin-micro-wifi-usb-dongle-on-the-beagleboard/ Belkin Micro Wi-Fi USB dongle on the BeagleBoard]&lt;br /&gt;
&lt;br /&gt;
*Battery Pack and USB Hub&lt;br /&gt;
&lt;br /&gt;
::To again better a ease installation and quick deployment for our system we are using a battery pack to provide power for the BeagleBone, the WiFi dongle and the USB camera. Due to the hottest limitations of the Beagle bones single USB port, in addition to the limited amount of current that the single USB port can provide, we will also use a USB hub with power adapter to solve both issues.&lt;br /&gt;
&lt;br /&gt;
::Specific products we are using included [http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger] and [http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
*Doorbell&lt;br /&gt;
&lt;br /&gt;
::In order for the end user to trigger the recording sequence, we will implement a traditional mechanical momentary pushbutton that will connect to the BeagleBone’s GPIO using the enabled internal pull-up resistors.&lt;br /&gt;
&lt;br /&gt;
*LED&lt;br /&gt;
&lt;br /&gt;
::As a simple display, our project will utilize a simple LED as an indicator for the user that the audio is currently being recorded and that a face capture will be taken.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
*'''Basic Command Line Examples'''&lt;br /&gt;
&lt;br /&gt;
:: In order to give you a feel to how the program is capturing and sending emails.  Here is a short run down of how the program works&lt;br /&gt;
&lt;br /&gt;
:*'''Audio Capture'''&lt;br /&gt;
&lt;br /&gt;
::: In order to capture audio, the project uses arecord.  This application allows you to grab audio from a microphone that is attached to your device and save to the current directory in a raw format.  &lt;br /&gt;
&lt;br /&gt;
:::Here is an example command that allows you to record audio and then pipe the audio into aplay to instantaneously hear feedback:&lt;br /&gt;
&lt;br /&gt;
 beagle$ arecord -D plughw:1,0 | aplay&lt;br /&gt;
&lt;br /&gt;
:::In order to encode the audio into mp3 format, you will need to pipe the audio into lame instead of aplay.&lt;br /&gt;
&lt;br /&gt;
:::Here is an example of this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ arecord -D plughw:2,0 -r 16000 -f S16_LE -c 2 -t raw -d 3 | lame  -s 16 -r - blackbird.mp3&lt;br /&gt;
&lt;br /&gt;
::: For more information about ALSA and how to use many of its interesting features visit [http://www.lvr.com/access_usb_devices_from_linux.htm | Jan Axelson's Lakeview Research web page]&lt;br /&gt;
&lt;br /&gt;
:*'''Email Script'''&lt;br /&gt;
&lt;br /&gt;
::: A python mail client that prompts the user for information to send an email with optional attachments.&lt;br /&gt;
&lt;br /&gt;
  python smtp-mail-client-attachments.py&lt;br /&gt;
&lt;br /&gt;
  Send To (Separated by a comma): &lt;br /&gt;
  Files (Separated by a comma): &lt;br /&gt;
  Send From: &lt;br /&gt;
  Subject: &lt;br /&gt;
  Message:&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
# Acquire Hardware - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
# Set up project page - Tom &amp;amp; Kevin&lt;br /&gt;
:::Page made and updated&lt;br /&gt;
# Get USB wireless to work - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is not working at this time for A6 image&lt;br /&gt;
# Get PlayStation Eye to work - Tom&lt;br /&gt;
:::Audio working, need to use A5 image&lt;br /&gt;
# Get BeagleBoard Bone to run off a battery pack - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
# Register an email for the BeagleBoard - Ruffin&lt;br /&gt;
:::Google acound made, along with Gmail and Google vouice accounts&lt;br /&gt;
# Create an email script to send email with attachments - Tom&lt;br /&gt;
:::Email sending, google is blocking attachments however&lt;br /&gt;
# Encode the raw audio from ALSA into mp3 format - Kevin&lt;br /&gt;
:::Able to record on bone, use lame to convert file, and SCP to send to PC and listen to the recording&lt;br /&gt;
# Capture an image using GStreamer - Kevin &amp;amp; Tom&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
# Create a C program to capture the audio and listen for GPIO inputs - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
# Putting all the pieces together - Tom, Kevin, &amp;amp; Ruffin&lt;br /&gt;
:::Making c file for initializing GPIOs, interrupts and start up scripts for VNS server&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import smtplib, os&lt;br /&gt;
from email.MIMEMultipart import MIMEMultipart&lt;br /&gt;
from email.MIMEBase import MIMEBase&lt;br /&gt;
from email.MIMEText import MIMEText&lt;br /&gt;
from email.Utils import COMMASPACE, formatdate&lt;br /&gt;
from email import Encoders&lt;br /&gt;
&lt;br /&gt;
def send_mail():&lt;br /&gt;
    #This version promts the user to specify recipient, files,&lt;br /&gt;
    #subject, and message. The version for incorperating in the&lt;br /&gt;
    #notifier will need to read from a preferences file that &lt;br /&gt;
    #should be modifiable by the user.&lt;br /&gt;
&lt;br /&gt;
    send_to = raw_input(&amp;quot;Send To (Separated by a comma): &amp;quot;)&lt;br /&gt;
    files = raw_input(&amp;quot;Files (Separated by a comma): &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    send_to=send_to.split(',')&lt;br /&gt;
    files=filter(None, files.split(','))&lt;br /&gt;
&lt;br /&gt;
    #Make sure that we are working with a list&lt;br /&gt;
    assert type(send_to)==list&lt;br /&gt;
    assert type(files)==list&lt;br /&gt;
&lt;br /&gt;
    send_from = raw_input(&amp;quot;Send From: &amp;quot;)&lt;br /&gt;
    subject = raw_input(&amp;quot;Subject: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    #Create a message object that we will be sending&lt;br /&gt;
    msg = MIMEMultipart()&lt;br /&gt;
    msg['From'] = send_from&lt;br /&gt;
    msg['To'] = COMMASPACE.join(send_to)&lt;br /&gt;
    msg['Date'] = formatdate(localtime=True)&lt;br /&gt;
    msg['Subject'] = subject&lt;br /&gt;
&lt;br /&gt;
    text = raw_input(&amp;quot;Message: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    msg.attach( MIMEText(text) )&lt;br /&gt;
&lt;br /&gt;
    #Attach files to message&lt;br /&gt;
    for f in files:&lt;br /&gt;
        part = MIMEBase('application', &amp;quot;octet-stream&amp;quot;)&lt;br /&gt;
        part.set_payload( open(f,&amp;quot;rb&amp;quot;).read() )&lt;br /&gt;
        Encoders.encode_base64(part)&lt;br /&gt;
        part.add_header('Content-Disposition', 'attachment; filename=&amp;quot;%s&amp;quot;' % os.path.basename(f))&lt;br /&gt;
        msg.attach(part)&lt;br /&gt;
&lt;br /&gt;
    #Open up a connection to the gmail servers on port 587&lt;br /&gt;
    server = smtplib.SMTP('smtp.gmail.com',587) #port 465 or 587&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    server.starttls()&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    #password = getpass()&lt;br /&gt;
    password=&amp;quot;beagleece497&amp;quot;&lt;br /&gt;
    server.login(send_from, password)&lt;br /&gt;
    server.sendmail(send_from,&amp;quot;,&amp;quot;.join(send_to),msg.as_string())&lt;br /&gt;
    server.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    send_mail()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Web Interface using HTML and NodeJS&lt;br /&gt;
&lt;br /&gt;
== Parts ==&lt;br /&gt;
&lt;br /&gt;
[http://beagleboard.org/bone Beagle Bone]&lt;br /&gt;
&lt;br /&gt;
[http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html PlayStation Eye]&lt;br /&gt;
&lt;br /&gt;
[http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]&lt;br /&gt;
&lt;br /&gt;
[http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger]&lt;br /&gt;
&lt;br /&gt;
[http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&amp;lt;br&amp;gt; Need More Cake&lt;br /&gt;
&lt;br /&gt;
{{BeagleVNSFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-11-02T15:55:05Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Python */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{BeagleVNSHead}}&lt;br /&gt;
[[File:BeagleVNS.png|thumb|]]&lt;br /&gt;
&lt;br /&gt;
Team members:[[User:atniptw | Tom Atnip]],[[User:Geislekj | Kevin Geisler]],[[user:Ruff | Ruffin White]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:WhereIsYoder.png|thumb|Where is Dr. Yoder?]]&lt;br /&gt;
[[File:WhereIsYoder2.png|thumb|I'll leave him a message]]&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
At this time, we have a method for capturing audio for a specified amount of time and encoding that recording into a mp3 file.  We also have python script that allows the user to send email messages to another email by running a script.  We also have a working external power source for the beagle.&lt;br /&gt;
&lt;br /&gt;
The wireless usb adapter does not work at this time.  We are still trying to get recompile the kernel to install and enable the driver for this wireless adapter.&lt;br /&gt;
&lt;br /&gt;
Overall we are looking at creating a c program that will record the audio while the button is being pressed.  Once the button has been released the program will encode the raw audio into mp3 format, and then attach it via an email and send it to the owner of the Beagle VNS system.&lt;br /&gt;
&lt;br /&gt;
== Software ==&lt;br /&gt;
&lt;br /&gt;
*'''github'''&lt;br /&gt;
&lt;br /&gt;
::In order to use the project code for the Beagle VNS, you will need github installed in order to download the code.  If you do not have github there are instruction on how to install it on the [[EBC Exercise 16 git |ECE Exercise 16]] web page.&lt;br /&gt;
&lt;br /&gt;
::To download the code for the Beagle VNS run the following code:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''git clone https://github.com/geislekj/BeagleBoardVNS.git'''&lt;br /&gt;
&lt;br /&gt;
*'''Python'''&lt;br /&gt;
&lt;br /&gt;
::Python is natively installed on the Beagle operating system.  However it is important to note that the program will be using a python script to send email.&lt;br /&gt;
&lt;br /&gt;
*'''ALSA'''&lt;br /&gt;
&lt;br /&gt;
::The project uses ALSA drivers in order to record audio from a microphone device.&lt;br /&gt;
&lt;br /&gt;
::In order to download the ALSA drivers you will need to run the following commands:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg update'''&lt;br /&gt;
 beagle$ '''opkg install alsa-utils-aplay alsa-utils-amixer'''&lt;br /&gt;
&lt;br /&gt;
*'''Lame'''&lt;br /&gt;
&lt;br /&gt;
::Lame is a audio encoder that will take raw audio and convert it into an mp3 format.&lt;br /&gt;
&lt;br /&gt;
::To install the lame onto the beagle board you will need to run the following command.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''opkg install lame'''&lt;br /&gt;
&lt;br /&gt;
*GStreamer&lt;br /&gt;
&lt;br /&gt;
::GStreamer is an application that allows the user to capture video from a camera for multiple types of solutions.  For this project, it is being used to capture an image of the person leaving a message.&lt;br /&gt;
&lt;br /&gt;
::Instructions to install GStreamer is still in the process of being developed.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_256x249.jpg|320px|thumb|right|BeagleBone]]&lt;br /&gt;
[[File:PlayStation-Eye.png|320px|thumb|right|PlayStation Eye]]&lt;br /&gt;
[[File:Belkin_N150_Micro_Wireless_USB_Adapter.jpg|320px|thumb|right|Belkin N150 Micro Wireless USB Adapter]]&lt;br /&gt;
&lt;br /&gt;
*BeagleBone&lt;br /&gt;
&lt;br /&gt;
::This project is design primarily for the BeagleBone, but could be implemented on any other Beagle Board given the proper driver installation for the USB hardware and available GPIOs. The BeagleBone is applicable for this project due to is small size, low power consumption, and networking capabilities. Make sure to use the A5 image of Ångström as the A6 image is still buggy with respect to audio/video capturing, as well as using the USB WiFi drivers.&lt;br /&gt;
&lt;br /&gt;
::Further BeagleBone documentation can be found on the official [http://beagleboard.org Beagle Board] website.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [https://www.adafruit.com/products/513 here]  &lt;br /&gt;
&lt;br /&gt;
*Camera&lt;br /&gt;
&lt;br /&gt;
::In this project tutorial, we will be using the [http://en.wikipedia.org/wiki/PlayStation_Eye  PlayStation Eye] as the audio and video source to recod messages and capture face images. The PlayStation Eye is very compatible with the A5 image of Ångström and used in many other Beagle embedded Linux projects.&lt;br /&gt;
&lt;br /&gt;
::This device can be found available [http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html here]  &lt;br /&gt;
&lt;br /&gt;
*Wifi dongle&lt;br /&gt;
&lt;br /&gt;
::Here we would like to use a WiFi dongle to easily connect to surrounding wireless networks for ease of installation and placement in the remote stretches of hallways and doorframes. We will need we will need network connectivity to transmit e-mails and recording attachments over to an available e-mail server account. In particularly we are using the [http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]. &lt;br /&gt;
&lt;br /&gt;
::Although this device is not natively supported with the stock A5 image of Ångström, a brief tutorial has already been made on how to compile and install the device drivers for this particular wireless USB adapter: [http://embeddedgeeks.wordpress.com/2012/01/03/belkin-micro-wifi-usb-dongle-on-the-beagleboard/ Belkin Micro Wi-Fi USB dongle on the BeagleBoard]&lt;br /&gt;
&lt;br /&gt;
*Battery Pack and USB Hub&lt;br /&gt;
&lt;br /&gt;
::To again better a ease installation and quick deployment for our system we are using a battery pack to provide power for the BeagleBone, the WiFi dongle and the USB camera. Due to the hottest limitations of the Beagle bones single USB port, in addition to the limited amount of current that the single USB port can provide, we will also use a USB hub with power adapter to solve both issues.&lt;br /&gt;
&lt;br /&gt;
::Specific products we are using included [http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger] and [http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
*Doorbell&lt;br /&gt;
&lt;br /&gt;
::In order for the end user to trigger the recording sequence, we will implement a traditional mechanical momentary pushbutton that will connect to the BeagleBone’s GPIO using the enabled internal pull-up resistors.&lt;br /&gt;
&lt;br /&gt;
*LED&lt;br /&gt;
&lt;br /&gt;
::As a simple display, our project will utilize a simple LED as an indicator for the user that the audio is currently being recorded and that a face capture will be taken.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
*'''Basic Command Line Examples'''&lt;br /&gt;
&lt;br /&gt;
:: In order to give you a feel to how the program is capturing and sending emails.  Here is a short run down of how the program works&lt;br /&gt;
&lt;br /&gt;
:*'''Audio Capture'''&lt;br /&gt;
&lt;br /&gt;
::: In order to capture audio, the project uses arecord.  This application allows you to grab audio from a microphone that is attached to your device and save to the current directory in a raw format.  &lt;br /&gt;
&lt;br /&gt;
:::Here is an example command that allows you to record audio and then pipe the audio into aplay to instantaneously hear feedback:&lt;br /&gt;
&lt;br /&gt;
 beagle$ arecord -D plughw:1,0 | aplay&lt;br /&gt;
&lt;br /&gt;
:::In order to encode the audio into mp3 format, you will need to pipe the audio into lame instead of aplay.&lt;br /&gt;
&lt;br /&gt;
:::Here is an example of this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ arecord -D plughw:2,0 -r 16000 -f S16_LE -c 2 -t raw -d 3 | lame  -s 16 -r - blackbird.mp3&lt;br /&gt;
&lt;br /&gt;
::: For more information about ALSA and how to use many of its interesting features visit [http://www.lvr.com/access_usb_devices_from_linux.htm | Jan Axelson's Lakeview Research web page]&lt;br /&gt;
&lt;br /&gt;
:*'''Email Script'''&lt;br /&gt;
&lt;br /&gt;
::: Instructions for this section are being developed.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
# Acquire Hardware - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
# Set up project page - Tom &amp;amp; Kevin&lt;br /&gt;
:::Page made and updated&lt;br /&gt;
# Get USB wireless to work - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is not working at this time for A6 image&lt;br /&gt;
# Get PlayStation Eye to work - Tom&lt;br /&gt;
:::Audio working, need to use A5 image&lt;br /&gt;
# Get BeagleBoard Bone to run off a battery pack - Ruffin&lt;br /&gt;
:::Done&lt;br /&gt;
# Register an email for the BeagleBoard - Ruffin&lt;br /&gt;
:::Google acound made, along with Gmail and Google vouice accounts&lt;br /&gt;
# Create an email script to send email with attachments - Tom&lt;br /&gt;
:::Email sending, google is blocking attachments however&lt;br /&gt;
# Encode the raw audio from ALSA into mp3 format - Kevin&lt;br /&gt;
:::Able to record on bone, use lame to convert file, and SCP to send to PC and listen to the recording&lt;br /&gt;
# Capture an image using GStreamer - Kevin &amp;amp; Tom&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
# Create a C program to capture the audio and listen for GPIO inputs - Kevin &amp;amp; Ruffin&lt;br /&gt;
:::This is still being developed&lt;br /&gt;
# Putting all the pieces together - Tom, Kevin, &amp;amp; Ruffin&lt;br /&gt;
:::Making c file for initializing GPIOs, interrupts and start up scripts for VNS server&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
import smtplib, os&lt;br /&gt;
from email.MIMEMultipart import MIMEMultipart&lt;br /&gt;
from email.MIMEBase import MIMEBase&lt;br /&gt;
from email.MIMEText import MIMEText&lt;br /&gt;
from email.Utils import COMMASPACE, formatdate&lt;br /&gt;
from email import Encoders&lt;br /&gt;
&lt;br /&gt;
def send_mail():&lt;br /&gt;
    #This version promts the user to specify recipient, files,&lt;br /&gt;
    #subject, and message. The version for incorperating in the&lt;br /&gt;
    #notifier will need to read from a preferences file that &lt;br /&gt;
    #should be modifiable by the user.&lt;br /&gt;
&lt;br /&gt;
    send_to = raw_input(&amp;quot;Send To (Separated by a comma): &amp;quot;)&lt;br /&gt;
    files = raw_input(&amp;quot;Files (Separated by a comma): &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    send_to=send_to.split(',')&lt;br /&gt;
    files=filter(None, files.split(','))&lt;br /&gt;
&lt;br /&gt;
    #Make sure that we are working with a list&lt;br /&gt;
    assert type(send_to)==list&lt;br /&gt;
    assert type(files)==list&lt;br /&gt;
&lt;br /&gt;
    send_from = raw_input(&amp;quot;Send From: &amp;quot;)&lt;br /&gt;
    subject = raw_input(&amp;quot;Subject: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    #Create a message object that we will be sending&lt;br /&gt;
    msg = MIMEMultipart()&lt;br /&gt;
    msg['From'] = send_from&lt;br /&gt;
    msg['To'] = COMMASPACE.join(send_to)&lt;br /&gt;
    msg['Date'] = formatdate(localtime=True)&lt;br /&gt;
    msg['Subject'] = subject&lt;br /&gt;
&lt;br /&gt;
    text = raw_input(&amp;quot;Message: &amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    msg.attach( MIMEText(text) )&lt;br /&gt;
&lt;br /&gt;
    #Attach files to message&lt;br /&gt;
    for f in files:&lt;br /&gt;
        part = MIMEBase('application', &amp;quot;octet-stream&amp;quot;)&lt;br /&gt;
        part.set_payload( open(f,&amp;quot;rb&amp;quot;).read() )&lt;br /&gt;
        Encoders.encode_base64(part)&lt;br /&gt;
        part.add_header('Content-Disposition', 'attachment; filename=&amp;quot;%s&amp;quot;' % os.path.basename(f))&lt;br /&gt;
        msg.attach(part)&lt;br /&gt;
&lt;br /&gt;
    #Open up a connection to the gmail servers on port 587&lt;br /&gt;
    server = smtplib.SMTP('smtp.gmail.com',587) #port 465 or 587&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    server.starttls()&lt;br /&gt;
    server.ehlo()&lt;br /&gt;
    #password = getpass()&lt;br /&gt;
    password=&amp;quot;beagleece497&amp;quot;&lt;br /&gt;
    server.login(send_from, password)&lt;br /&gt;
    server.sendmail(send_from,&amp;quot;,&amp;quot;.join(send_to),msg.as_string())&lt;br /&gt;
    server.close()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
if __name__ == '__main__':&lt;br /&gt;
    send_mail()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Web Interface using HTML and NodeJS&lt;br /&gt;
&lt;br /&gt;
== Parts ==&lt;br /&gt;
&lt;br /&gt;
[http://beagleboard.org/bone Beagle Bone]&lt;br /&gt;
&lt;br /&gt;
[http://us.playstation.com/ps3/accessories/playstation-eye-camera-ps3.html PlayStation Eye]&lt;br /&gt;
&lt;br /&gt;
[http://www.belkin.com/us/p/P-F7D1102 Belkin N150 Micro Wireless USB Adapter]&lt;br /&gt;
&lt;br /&gt;
[http://www.duracell.com/en-US/product/instant-usb-charger.jspx  Duracell Instant USB Charger]&lt;br /&gt;
&lt;br /&gt;
[http://www.radioshack.com/product/index.jsp?productId=2476717 Gigaware® USB 4-Port Hub]&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&amp;lt;br&amp;gt; Need More Cake&lt;br /&gt;
&lt;br /&gt;
{{BeagleVNSFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-10-17T23:34:16Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Wiring */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:SparkFun]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 1, Don't just repeat the manual, tell me what you did.&lt;br /&gt;
Wiring:   0, Give details on how to wire it up.  Show a diagram.&lt;br /&gt;
Code:     1, Comment you code and give details of how to use it.&lt;br /&gt;
git:      0, put in git&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    4/10&lt;br /&gt;
Comments: Many details are missing.  What would you need to tell a beginner&lt;br /&gt;
how to get this to go?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
I found this tutorial very helpful: [http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:PIRMotionSensor.jpg|thumb|]]&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V. For the best results I found that I needed to power the sensor using the constant 5V power source on the BeagleBoard Bone Rail. This has the side effect of the device producing a 5V signal, which is to high to run through the gpio pins on the rail. To fix this the output signal needs to be reduced. Also, when wiring up the device the power pin needs a 10k pull-up resistor.&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
The GPIO pins the you connect the senor to, is taken in as an argument to the program.&lt;br /&gt;
Program found at https://github.com/atniptw/ECE497/tree/master/MiniProjects/Project2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*Standard C Libraries*/&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*Library I made to assist with GPIO handling*/&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
                /* From the example code for doing interupts */&lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
                        /* A change in the signal means that there was motion detected */&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
                        /* The sensor needs a moment to re-calibrate after it was been tripped */&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-10-17T23:27:06Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Sample C Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:SparkFun]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 1, Don't just repeat the manual, tell me what you did.&lt;br /&gt;
Wiring:   0, Give details on how to wire it up.  Show a diagram.&lt;br /&gt;
Code:     1, Comment you code and give details of how to use it.&lt;br /&gt;
git:      0, put in git&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    4/10&lt;br /&gt;
Comments: Many details are missing.  What would you need to tell a beginner&lt;br /&gt;
how to get this to go?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
I found this tutorial very helpful: [http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:PIRMotionSensor.jpg|thumb|]]&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V. For the best results I found that I needed to power the sensor using the constant 5V power source on the BeagleBoard Bone Rail. This has the side effect of the device producing a 5V signal, which is to high to run through the gpio pins on the rail. To fix this the output signal needs to be reduced.&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
The GPIO pins the you connect the senor to, is taken in as an argument to the program.&lt;br /&gt;
Program found at https://github.com/atniptw/ECE497/tree/master/MiniProjects/Project2&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*Standard C Libraries*/&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*Library I made to assist with GPIO handling*/&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
                /* From the example code for doing interupts */&lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
                        /* A change in the signal means that there was motion detected */&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
                        /* The sensor needs a moment to re-calibrate after it was been tripped */&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-10-17T23:25:35Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:SparkFun]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 1, Don't just repeat the manual, tell me what you did.&lt;br /&gt;
Wiring:   0, Give details on how to wire it up.  Show a diagram.&lt;br /&gt;
Code:     1, Comment you code and give details of how to use it.&lt;br /&gt;
git:      0, put in git&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    4/10&lt;br /&gt;
Comments: Many details are missing.  What would you need to tell a beginner&lt;br /&gt;
how to get this to go?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
I found this tutorial very helpful: [http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:PIRMotionSensor.jpg|thumb|]]&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V. For the best results I found that I needed to power the sensor using the constant 5V power source on the BeagleBoard Bone Rail. This has the side effect of the device producing a 5V signal, which is to high to run through the gpio pins on the rail. To fix this the output signal needs to be reduced.&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
The GPIO pins the you connect the senor to, is taken in as an argument to the program.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*Standard C Libraries*/&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*Library I made to assist with GPIO handling*/&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
                /* From the example code for doing interupts */&lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
                        /* A change in the signal means that there was motion detected */&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
                        /* The sensor needs a moment to re-calibrate after it was been tripped */&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-10-17T23:24:48Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:SparkFun]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 1, Don't just repeat the manual, tell me what you did.&lt;br /&gt;
Wiring:   0, Give details on how to wire it up.  Show a diagram.&lt;br /&gt;
Code:     1, Comment you code and give details of how to use it.&lt;br /&gt;
git:      0, put in git&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    4/10&lt;br /&gt;
Comments: Many details are missing.  What would you need to tell a beginner&lt;br /&gt;
how to get this to go?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
I found this tutorial very helpful: [http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:PIRMotionSensor.jpg|thumb|]]&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V. For the best results I found that I needed to power the sensor using the constant 5V power source on the BeagleBoard Bone Rail. This has the side effect of the device producing a 5V signal, which is to high to run through the gpio pins on the rail. To fix this the output signal needs to be reduced.&lt;br /&gt;
&lt;br /&gt;
== Bone Usage ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
The GPIO pins the you connect the senor to, is taken in as an argument to the program.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*Standard C Libraries*/&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*Library I made to assist with GPIO handling*/&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
                /* From the example code for doing interupts */&lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
                        /* A change in the signal means that there was motion detected */&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
                        /* The sensor needs a moment to re-calibrate after it was been tripped */&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-10-17T23:24:13Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:SparkFun]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 1, Don't just repeat the manual, tell me what you did.&lt;br /&gt;
Wiring:   0, Give details on how to wire it up.  Show a diagram.&lt;br /&gt;
Code:     1, Comment you code and give details of how to use it.&lt;br /&gt;
git:      0, put in git&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    4/10&lt;br /&gt;
Comments: Many details are missing.  What would you need to tell a beginner&lt;br /&gt;
how to get this to go?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
I found this tutorial very helpful: [http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:PIRMotionSensor.png|thumb|]]&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V. For the best results I found that I needed to power the sensor using the constant 5V power source on the BeagleBoard Bone Rail. This has the side effect of the device producing a 5V signal, which is to high to run through the gpio pins on the rail. To fix this the output signal needs to be reduced.&lt;br /&gt;
&lt;br /&gt;
== Bone Usage ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
The GPIO pins the you connect the senor to, is taken in as an argument to the program.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*Standard C Libraries*/&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*Library I made to assist with GPIO handling*/&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
                /* From the example code for doing interupts */&lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
                        /* A change in the signal means that there was motion detected */&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
                        /* The sensor needs a moment to re-calibrate after it was been tripped */&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/File:PIRMotionSensor.jpg</id>
		<title>File:PIRMotionSensor.jpg</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/File:PIRMotionSensor.jpg"/>
				<updated>2012-10-17T23:20:05Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: Wiring picture&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Wiring picture&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-10-17T23:12:39Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Sample C Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:SparkFun]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 1, Don't just repeat the manual, tell me what you did.&lt;br /&gt;
Wiring:   0, Give details on how to wire it up.  Show a diagram.&lt;br /&gt;
Code:     1, Comment you code and give details of how to use it.&lt;br /&gt;
git:      0, put in git&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    4/10&lt;br /&gt;
Comments: Many details are missing.  What would you need to tell a beginner&lt;br /&gt;
how to get this to go?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
I found this tutorial very helpful: [http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V. For the best results I found that I needed to power the sensor using the constant 5V power source on the BeagleBoard Bone Rail. This has the side effect of the device producing a 5V signal, which is to high to run through the gpio pins on the rail. To fix this the output signal needs to be reduced.&lt;br /&gt;
&lt;br /&gt;
== Bone Usage ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
The GPIO pins the you connect the senor to, is taken in as an argument to the program.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*Standard C Libraries*/&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*Library I made to assist with GPIO handling*/&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
                /* From the example code for doing interupts */&lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
                        /* A change in the signal means that there was motion detected */&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
                        /* The sensor needs a moment to re-calibrate after it was been tripped */&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-10-17T23:05:57Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Inputs and Outputs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:SparkFun]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 1, Don't just repeat the manual, tell me what you did.&lt;br /&gt;
Wiring:   0, Give details on how to wire it up.  Show a diagram.&lt;br /&gt;
Code:     1, Comment you code and give details of how to use it.&lt;br /&gt;
git:      0, put in git&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    4/10&lt;br /&gt;
Comments: Many details are missing.  What would you need to tell a beginner&lt;br /&gt;
how to get this to go?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
I found this tutorial very helpful: [http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V. For the best results I found that I needed to power the sensor using the constant 5V power source on the BeagleBoard Bone Rail. This has the side effect of the device producing a 5V signal, which is to high to run through the gpio pins on the rail. To fix this the output signal needs to be reduced.&lt;br /&gt;
&lt;br /&gt;
== Bone Usage ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
/* {&amp;quot;gpio1_6&amp;quot;, &amp;quot;gpio1_7&amp;quot;, &amp;quot;gpio1_2&amp;quot;, &amp;quot;gpio1_3&amp;quot;, &amp;quot;gpio1_13&amp;quot;, &amp;quot;gpio1_12&amp;quot;, &amp;quot;gpio1_15&amp;quot;, &amp;quot;gpio1_14&amp;quot;} */&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
            &lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-10-17T22:54:35Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:SparkFun]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 1, Don't just repeat the manual, tell me what you did.&lt;br /&gt;
Wiring:   0, Give details on how to wire it up.  Show a diagram.&lt;br /&gt;
Code:     1, Comment you code and give details of how to use it.&lt;br /&gt;
git:      0, put in git&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    4/10&lt;br /&gt;
Comments: Many details are missing.  What would you need to tell a beginner&lt;br /&gt;
how to get this to go?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
I found this tutorial very helpful: [http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V.&lt;br /&gt;
&lt;br /&gt;
== Bone Usage ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
/* {&amp;quot;gpio1_6&amp;quot;, &amp;quot;gpio1_7&amp;quot;, &amp;quot;gpio1_2&amp;quot;, &amp;quot;gpio1_3&amp;quot;, &amp;quot;gpio1_13&amp;quot;, &amp;quot;gpio1_12&amp;quot;, &amp;quot;gpio1_15&amp;quot;, &amp;quot;gpio1_14&amp;quot;} */&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
            &lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-10-15T19:08:22Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Conclusions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Yoder|Mark A. Yoder]], (List all the team members here with link to their eLinux User page.  Use my format.&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what works.&lt;br /&gt;
Nothing&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what isn't working.&lt;br /&gt;
All of it&lt;br /&gt;
&lt;br /&gt;
End with a two sentence conclusion.&lt;br /&gt;
We will probably learn things&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Give step by step instructions on how to install your project on the SPEd2 image.  &lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Acquire Hardware - Ruffin&lt;br /&gt;
# Set up project page - Tom&amp;amp;Kevin&lt;br /&gt;
# Get USB wireless to work&lt;br /&gt;
# Get PlayStation Eye to work&lt;br /&gt;
# Get BeagleBoard Bone to run off a battery pack&lt;br /&gt;
# Register an email for the BeagleBoard&lt;br /&gt;
# Program stuff....&lt;br /&gt;
# Build stuff......&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Flame decals&lt;br /&gt;
# Spoiler&lt;br /&gt;
# Bigger Engine&lt;br /&gt;
# Sentient&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&amp;lt;br&amp;gt; Need More Cake&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-10-15T19:07:52Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Conclusions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Yoder|Mark A. Yoder]], (List all the team members here with link to their eLinux User page.  Use my format.&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what works.&lt;br /&gt;
Nothing&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what isn't working.&lt;br /&gt;
All of it&lt;br /&gt;
&lt;br /&gt;
End with a two sentence conclusion.&lt;br /&gt;
We will probably learn things&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Give step by step instructions on how to install your project on the SPEd2 image.  &lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Acquire Hardware - Ruffin&lt;br /&gt;
# Set up project page - Tom&amp;amp;Kevin&lt;br /&gt;
# Get USB wireless to work&lt;br /&gt;
# Get PlayStation Eye to work&lt;br /&gt;
# Get BeagleBoard Bone to run off a battery pack&lt;br /&gt;
# Register an email for the BeagleBoard&lt;br /&gt;
# Program stuff....&lt;br /&gt;
# Build stuff......&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Flame decals&lt;br /&gt;
# Spoiler&lt;br /&gt;
# Bigger Engine&lt;br /&gt;
# Sentient&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.\n Need More Cake&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-10-15T19:07:20Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Future Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Yoder|Mark A. Yoder]], (List all the team members here with link to their eLinux User page.  Use my format.&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what works.&lt;br /&gt;
Nothing&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what isn't working.&lt;br /&gt;
All of it&lt;br /&gt;
&lt;br /&gt;
End with a two sentence conclusion.&lt;br /&gt;
We will probably learn things&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Give step by step instructions on how to install your project on the SPEd2 image.  &lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Acquire Hardware - Ruffin&lt;br /&gt;
# Set up project page - Tom&amp;amp;Kevin&lt;br /&gt;
# Get USB wireless to work&lt;br /&gt;
# Get PlayStation Eye to work&lt;br /&gt;
# Get BeagleBoard Bone to run off a battery pack&lt;br /&gt;
# Register an email for the BeagleBoard&lt;br /&gt;
# Program stuff....&lt;br /&gt;
# Build stuff......&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
# Flame decals&lt;br /&gt;
# Spoiler&lt;br /&gt;
# Bigger Engine&lt;br /&gt;
# Sentient&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-10-15T19:04:59Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Work Breakdown */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Yoder|Mark A. Yoder]], (List all the team members here with link to their eLinux User page.  Use my format.&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what works.&lt;br /&gt;
Nothing&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what isn't working.&lt;br /&gt;
All of it&lt;br /&gt;
&lt;br /&gt;
End with a two sentence conclusion.&lt;br /&gt;
We will probably learn things&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Give step by step instructions on how to install your project on the SPEd2 image.  &lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Acquire Hardware - Ruffin&lt;br /&gt;
# Set up project page - Tom&amp;amp;Kevin&lt;br /&gt;
# Get USB wireless to work&lt;br /&gt;
# Get PlayStation Eye to work&lt;br /&gt;
# Get BeagleBoard Bone to run off a battery pack&lt;br /&gt;
# Register an email for the BeagleBoard&lt;br /&gt;
# Program stuff....&lt;br /&gt;
# Build stuff......&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-10-15T19:04:01Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Work Breakdown */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Yoder|Mark A. Yoder]], (List all the team members here with link to their eLinux User page.  Use my format.&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what works.&lt;br /&gt;
Nothing&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what isn't working.&lt;br /&gt;
All of it&lt;br /&gt;
&lt;br /&gt;
End with a two sentence conclusion.&lt;br /&gt;
We will probably learn things&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Give step by step instructions on how to install your project on the SPEd2 image.  &lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Acquire Hardware - Ruffin&lt;br /&gt;
2. Set up project page - Tom&amp;amp;Kevin&lt;br /&gt;
3. Get USB wireless to work&lt;br /&gt;
4. Get PlayStation Eye to work&lt;br /&gt;
5. Get BeagleBoard Bone to run off a battery pack&lt;br /&gt;
6. Register an email for the BeagleBoard&lt;br /&gt;
7. Program stuff....&lt;br /&gt;
8. Build stuff......&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Beagle_VNS</id>
		<title>ECE497 Beagle VNS</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Beagle_VNS"/>
				<updated>2012-10-15T18:59:08Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Executive Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Yoder|Mark A. Yoder]], (List all the team members here with link to their eLinux User page.  Use my format.&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
We wanted a way for students to be able to leave audio (and possibly video) messages for professors when they are out of their office. Using a BeagleBoard Bone, we plan to connect a wireless USB device and a PlayStation Eye to achieve this. Students will be able to walk up to the device and press a button to record their message which will then be available for the professor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what works.&lt;br /&gt;
Nothing&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what isn't working.&lt;br /&gt;
All of it&lt;br /&gt;
&lt;br /&gt;
End with a two sentence conclusion.&lt;br /&gt;
We will probably learn things&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Give step by step instructions on how to install your project on the SPEd2 image.  &lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-09-27T15:51:30Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:Sparkfun]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
[http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V.&lt;br /&gt;
&lt;br /&gt;
== Bone Usage ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
/* {&amp;quot;gpio1_6&amp;quot;, &amp;quot;gpio1_7&amp;quot;, &amp;quot;gpio1_2&amp;quot;, &amp;quot;gpio1_3&amp;quot;, &amp;quot;gpio1_13&amp;quot;, &amp;quot;gpio1_12&amp;quot;, &amp;quot;gpio1_15&amp;quot;, &amp;quot;gpio1_14&amp;quot;} */&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
            &lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-09-27T15:49:16Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Sparkfun]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
[http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V.&lt;br /&gt;
&lt;br /&gt;
== Bone Usage ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
/* {&amp;quot;gpio1_6&amp;quot;, &amp;quot;gpio1_7&amp;quot;, &amp;quot;gpio1_2&amp;quot;, &amp;quot;gpio1_3&amp;quot;, &amp;quot;gpio1_13&amp;quot;, &amp;quot;gpio1_12&amp;quot;, &amp;quot;gpio1_15&amp;quot;, &amp;quot;gpio1_14&amp;quot;} */&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
            &lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-09-27T15:48:49Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497, Sparkfun]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
[http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V.&lt;br /&gt;
&lt;br /&gt;
== Bone Usage ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
/* {&amp;quot;gpio1_6&amp;quot;, &amp;quot;gpio1_7&amp;quot;, &amp;quot;gpio1_2&amp;quot;, &amp;quot;gpio1_3&amp;quot;, &amp;quot;gpio1_13&amp;quot;, &amp;quot;gpio1_12&amp;quot;, &amp;quot;gpio1_15&amp;quot;, &amp;quot;gpio1_14&amp;quot;} */&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
            &lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-09-24T15:07:19Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
[http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V.&lt;br /&gt;
&lt;br /&gt;
== Bone Usage ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
/* {&amp;quot;gpio1_6&amp;quot;, &amp;quot;gpio1_7&amp;quot;, &amp;quot;gpio1_2&amp;quot;, &amp;quot;gpio1_3&amp;quot;, &amp;quot;gpio1_13&amp;quot;, &amp;quot;gpio1_12&amp;quot;, &amp;quot;gpio1_15&amp;quot;, &amp;quot;gpio1_14&amp;quot;} */&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
            &lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/EBC_Mini_Project_02</id>
		<title>EBC Mini Project 02</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/EBC_Mini_Project_02"/>
				<updated>2012-09-23T21:39:20Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Mini02]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Pick one of the senors from the [https://www.sparkfun.com/products/11016 SparkFun Sensor Kit] or from [http://adafruit.com Adafruit] and interface it to the Bone. Create a wiki page describing how to use the sensor.&lt;br /&gt;
&lt;br /&gt;
Add your name next to the sensor/display you want to use and pick it up from me.&lt;br /&gt;
&lt;br /&gt;
== Sparkfun ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! Name&lt;br /&gt;
! Sensor&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Josh Dugan&lt;br /&gt;
| HMC5883L - Triple-Axis Magnetometer Breakout Board&lt;br /&gt;
| An accurate, simple-to-use digital magnetometer with an I2C interface.&lt;br /&gt;
|-&lt;br /&gt;
| Ross Hansen&lt;br /&gt;
| ADXL335 - Triple-Axis Accelerometer Breakout Board&lt;br /&gt;
| Senses acceleration along all three axes, with a range of up to ±3g. Fully analog interface. [[Sparkfun:_ADXL335,_three-axis_accelerometer]]&lt;br /&gt;
ITG-3200&lt;br /&gt;
|-&lt;br /&gt;
| Ruffin White&lt;br /&gt;
| Triple-Axis Gyro Breakout Board&lt;br /&gt;
| Senses angular velocity along three axes of rotation. Fully digital interface with a range of up to ±2000°/s.&lt;br /&gt;
|-&lt;br /&gt;
| Kevin Geisler&lt;br /&gt;
| [[Large Piezo Vibration Sensor - With Mass]]&lt;br /&gt;
| A flexible film able to sense for vibration, touch, shock, etc. When the film moves back and forth an AC wave is created, with a voltage of up to ±90.&lt;br /&gt;
|-&lt;br /&gt;
| Mark A. Yoder&lt;br /&gt;
| Reed Switch&lt;br /&gt;
| Senses magnetic fields, makes for a great non-contact switch.&lt;br /&gt;
|-&lt;br /&gt;
| Mark A. Yoder&lt;br /&gt;
| 0.25&amp;quot; Magnet Square&lt;br /&gt;
| Plays nicely with the reed switch. Embed the magnet into stuffed animals or inside a box to create a hidden actuator to the reed switch.&lt;br /&gt;
|-&lt;br /&gt;
| Stephen Shinn&lt;br /&gt;
| 0.5&amp;quot; Force Sensitive Resistor&lt;br /&gt;
| A force sensing resistor with a 0.5&amp;quot; diameter sensing area. Great for sensing pressure (i.e. if it's being squeezed).&lt;br /&gt;
|-&lt;br /&gt;
| Tom Atnip&lt;br /&gt;
| [[Sparkfun:_PIR_Motion_Sensor]]&lt;br /&gt;
| Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| Ultrasonic Rangefinder - Maxbotix LV-EZ1&lt;br /&gt;
| Distance sensor with both analog and RS-232 interfaces, providing sonar range information from 6 to 254 inches.&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| HIH-4030 Humidity Sensor&lt;br /&gt;
| A high precision humidity sensor with an analog output.&lt;br /&gt;
|-&lt;br /&gt;
| Andrew Miller&lt;br /&gt;
| IR Receiver Breakout Board&lt;br /&gt;
| An analog interfaced IR receiver, sensitive to a wide range of IR waves. Great for 'listening' to TV remotes.&lt;br /&gt;
|-&lt;br /&gt;
| James Popenhagen&lt;br /&gt;
| [[Mini Photocell]]&lt;br /&gt;
| The photocell will vary its resistance based on how much light it's exposed to. Will vary from 1kΩ in the light to 10kΩ in the dark.&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| Optical Detector/Phototransistor&lt;br /&gt;
| An all-in-one infrared emitter and detector. Ideal for sensing black-to-white transitions or can be used to detect nearby objects.&lt;br /&gt;
|-&lt;br /&gt;
| Jesse Brannon&lt;br /&gt;
| BMP085 Barometric Pressure Sensor&lt;br /&gt;
| Low power, high precision barometric pressure sensor with I2C output.&lt;br /&gt;
|-&lt;br /&gt;
| James Popenhagen&lt;br /&gt;
| [[Flex Sensor]]&lt;br /&gt;
| As the sensor is flexed, the resistance across the sensor increases. Useful for sensing motion or positioning&lt;br /&gt;
|-&lt;br /&gt;
| Chris Good&lt;br /&gt;
| SoftPot&lt;br /&gt;
| These are very thin variable potentiometers. By pressing on various positions along the strip, you vary the resistance&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Adafruit ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
! Name&lt;br /&gt;
! Device&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| Matthew Moravec &amp;amp; Yue Zhang&lt;br /&gt;
| [https://www.adafruit.com/products/512 Analog 2-axis Thumb Joystick]&lt;br /&gt;
| Analog 2-axis Thumb Joystick with Select Button + Breakout Board&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| [https://www.adafruit.com/products/377 Rotary Encoder]&lt;br /&gt;
| This rotary encoder is a high quality 24-pulse encoder, with detents and a nice feel. This encoder also has a push-button built into it so you can press onto the knob to close a separate switch. One side has a 3 pin connector (ground and two coding pins) and the other side has two pins for a normally-open switch.&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| [https://www.adafruit.com/products/333 Touch screen (Nintendo DSL digitizer)]&lt;br /&gt;
| This resistive touch screen can be used with a stylus or fingertip and is easy to use with a microcontroller. &lt;br /&gt;
600 ohms across X pins, 300 ohms across Y pins&lt;br /&gt;
4 wire resistive display, on a 0.5mm FPC connector&lt;br /&gt;
|-&lt;br /&gt;
|Xinyu Cheng &lt;br /&gt;
| [https://www.adafruit.com/products/871 Mini 8x8 LED Matrix w/I2C - Yellow]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Mike Junge &amp;amp; Peter Ngo&lt;br /&gt;
|[https://www.adafruit.com/products/959 Mini 8x8 LED Matrix w/I2C - Blue]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Xia Li&lt;br /&gt;
|[https://www.adafruit.com/products/870 Mini 8x8 LED Matrix w/I2C - Red]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Alex Drane&lt;br /&gt;
|[https://www.adafruit.com/products/902 Bicolor LED Square Pixel Matrix]&lt;br /&gt;
| The matrices use a driver chip that does all the heavy lifting for you: They have a built in clock so they multiplex the display. They use constant-current drivers for ultra-bright, consistent color, 1/16 step display dimming, all via a simple I2C interface.&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| [https://www.adafruit.com/products/812 Green 7-segment clock display]&lt;br /&gt;
| These displays are multiplexed, common-cathode. What that means it that you can use a 74HC595.  Sorry, I didn't order the version with i2c.&lt;br /&gt;
|-&lt;br /&gt;
| Sean Richardson&lt;br /&gt;
| [https://www.adafruit.com/products/306 Digital Addressable RGB LED]&lt;br /&gt;
| These LED strips are fun and glowy. There are 32 RGB LEDs per meter, and you can control each LED individually! We have 5 meters worth!&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
|Greg Larmore&lt;br /&gt;
| [https://www.adafruit.com/products/555 16x24 Red LED Matrix Panel]&lt;br /&gt;
| These LED panels take care of all the work of making a big matrix display. Each panel has six 8x8 red matrix modules, for a 16x24 matrix. The panel has a HT1632C chip on the back with does all the multiplexing work for you and has a 3-pin SPI-like serial interface to talk to it and set LEDs on or off (you cannot set the LED to be individually dimmed, as in 'grayscale'). There's a few extras as well, such as being able to change the brightness of the entire display, or blink the entire display at 1 Hz.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|John Lobdell&lt;br /&gt;
| [https://www.adafruit.com/products/377 Rotary Encoder]&lt;br /&gt;
|These rotary encoders rotate all the way around continuously, and are divided up into 24 'segments'. Each segment has a click-y feeling to it, and each movement clockwise or counter-clockwise causes the two switches to open and close. There is no way to know what the current 'position' is - instead you would use a microcontroller to count how many 'clicks' left or right it has been turned. If you need to detect rotational 'position' a potentiometer would be a better choice.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-09-23T21:23:21Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
[http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V.&lt;br /&gt;
&lt;br /&gt;
== Bone Usage ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
The code shown below is sample code to demonstrate reading analog output from the ADXL335.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
/* {&amp;quot;gpio1_6&amp;quot;, &amp;quot;gpio1_7&amp;quot;, &amp;quot;gpio1_2&amp;quot;, &amp;quot;gpio1_3&amp;quot;, &amp;quot;gpio1_13&amp;quot;, &amp;quot;gpio1_12&amp;quot;, &amp;quot;gpio1_15&amp;quot;, &amp;quot;gpio1_14&amp;quot;} */&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
            &lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-09-23T21:22:57Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Sensors/Proximity/SE-10.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
[http://bildr.org/2011/06/pir_arduino/ Arduino Tutorial]&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
This unit works great from 5 to 12V (datasheet shows 12V). You can also install a jumper wire past the 5V regulator on board to make this unit work at 3.3V. Sensor uses 1.6mA@3.3V.&lt;br /&gt;
&lt;br /&gt;
== Bone Usage ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Reading and Interpreting Analog Input Data ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
The code shown below is sample code to demonstrate reading analog output from the ADXL335.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (3 * 1000) /* 3 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
/* {&amp;quot;gpio1_6&amp;quot;, &amp;quot;gpio1_7&amp;quot;, &amp;quot;gpio1_2&amp;quot;, &amp;quot;gpio1_3&amp;quot;, &amp;quot;gpio1_13&amp;quot;, &amp;quot;gpio1_12&amp;quot;, &amp;quot;gpio1_15&amp;quot;, &amp;quot;gpio1_14&amp;quot;} */&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * main&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[2];&lt;br /&gt;
	int nfds = 2;&lt;br /&gt;
	int gpio_fd, timeout, rc;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	unsigned int gpio;&lt;br /&gt;
	int len;&lt;br /&gt;
&lt;br /&gt;
	if (argc &amp;lt; 2) {&lt;br /&gt;
		printf(&amp;quot;Usage: gpio-int &amp;lt;gpio-pin&amp;gt;\n\n&amp;quot;);&lt;br /&gt;
		printf(&amp;quot;Waits for a change in the GPIO pin voltage level or input on stdin\n&amp;quot;);&lt;br /&gt;
		exit(-1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	gpio = atoi(argv[1]);&lt;br /&gt;
&lt;br /&gt;
	gpio_export(gpio);&lt;br /&gt;
	gpio_set_dir(gpio, 0);&lt;br /&gt;
	gpio_set_edge(gpio, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_fd = gpio_fd_open(gpio);&lt;br /&gt;
&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = STDIN_FILENO;&lt;br /&gt;
		fdset[0].events = POLLIN;&lt;br /&gt;
      &lt;br /&gt;
		fdset[1].fd = gpio_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, timeout);      &lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0) {&lt;br /&gt;
			printf(&amp;quot;\npoll() failed!\n&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
      &lt;br /&gt;
		if (rc == 0) {&lt;br /&gt;
			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
            &lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
			printf(&amp;quot;\nMotion Detected, value=%c, len=%d\n&amp;quot;,&lt;br /&gt;
				 buf[0], len);&lt;br /&gt;
			usleep(5000000);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN) {&lt;br /&gt;
			(void)read(fdset[0].fd, buf, 1);&lt;br /&gt;
			printf(&amp;quot;\npoll() stdin read 0x%2.2X\n&amp;quot;, (unsigned int) buf[0]);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Sparkfun:_PIR_Motion_Sensor</id>
		<title>Sparkfun: PIR Motion Sensor</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Sparkfun:_PIR_Motion_Sensor"/>
				<updated>2012-09-23T21:11:22Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: Created page with &amp;quot;Category:ECE497  == Overview ==  The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Compon...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The PIR Motion Sensor can be purchased from [https://www.sparkfun.com/products/8630 SparkFun]. The [http://www.sparkfun.com/datasheets/Components/SMD/adxl335.pdf datasheet] describes it:&lt;br /&gt;
&lt;br /&gt;
''Easy-to-use motion detector with an analog interface. Power it with 5-12VDC, and you'll be alerted of any movement.''&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
The ADXL335 takes a supply voltage (Vs) of 1.8-3.6 V. The analog outputs are scaled proportionally to the supply voltage; at Vs = 3.6 V, the output will change by 2x for the same acceleration as compared to Vs = 1.8 V. Although the output sensitivity is scaled proportionally to the input voltage, noise is not, so higher supply voltages are advisable to reduce the impact of noise.&lt;br /&gt;
&lt;br /&gt;
At all supply voltages, 0 g acceleration corresponds to an output voltage of Vs/2. At Vs = 3.6 V, the datasheet specs the typical sensitivity at 360 mV / g, with g as standard gravitational acceleration.&lt;br /&gt;
&lt;br /&gt;
== Bone Usage ==&lt;br /&gt;
&lt;br /&gt;
Because the ADXL335 has analog outputs, data can be read into the Bone via the analog input pins. Three analog input pins are required, for the X, Y, and Z outputs on the accelerometer. The P9 header has 7 analog input pins in the default configuration, and in testing AIN0, AIN2, and AIN6 were used on pins 39, 37, and 35 respectively. The ADXL335 can be supplied either with the 1.8 V output on Pin 32 of P9, or with the standard 3.3 V supply. See the picture on the right for an example wiring configuration. &lt;br /&gt;
&lt;br /&gt;
[[File:Adxl335Bone.jpg|thumb|Wiring example for ADXL335 on a Bone]]&lt;br /&gt;
&lt;br /&gt;
''Note: ''The maximum voltage for the Bone analog input is 1.8 V, so if the 3.3 V supply is chosen to power the ADXL335, a voltage divider must be used to reduce the output voltages to under 1.8 V. Two 10kOhm resistors have been used successfully for this purpose in the past.&lt;br /&gt;
&lt;br /&gt;
=== Reading and Interpreting Analog Input Data ===&lt;br /&gt;
&lt;br /&gt;
If an accelerometer output is connected to AIN0 as described above, it can be read from the shell with the command &amp;quot;cat /sys/devices/platform/omap/tsc/ain1&amp;quot;. The file &amp;quot;ain1&amp;quot; is read, as opposed to ain0, because the analog pins are indexed from 1 in software, but from 0 in hardware. AIN0-&amp;gt;ain1, AIN1-&amp;gt;ain2, etc. Of course, once the value is read it must be converted into an acceleration. &lt;br /&gt;
&lt;br /&gt;
The datasheet specs the sensitivity at Vs = 3.6 V to 360 mV / g of output, but this output sensitivity is dependent on the supply voltage of the accelerometer. For a Bone supply voltage of 1.8 V or 3.3 V, the output sensitivity will be different. Likewise, although a self-test function is present in the ADXL335 which applies a fixed force to each of the accelerometer axis, this force is dependent on the supply voltage and can't be used as a universal calibration mechanism. Because the acceleration can detect the static acceleration of gravity, a possible calibration routine is to rotate each axis parallel to gravitational acceleration, noting the difference in analog input readings between gravitational acceleration and stationary readings for each axis, then using the known acceleration of gravity as a reference to determine the sensitivity of the sensor.&lt;br /&gt;
&lt;br /&gt;
=== Sample C Code ===&lt;br /&gt;
&lt;br /&gt;
The code shown below is sample code to demonstrate reading analog output from the ADXL335.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/***************************************&lt;br /&gt;
#* adxl335.c&lt;br /&gt;
#* &lt;br /&gt;
#* This file demonstrates the usage of the ADXL335 accelerometer.&lt;br /&gt;
#* &lt;br /&gt;
#* With the proper accelerometer axis inputs defined below, &lt;br /&gt;
#* this application will output and constantly update the readings&lt;br /&gt;
#* from the accelerometer&lt;br /&gt;
#*&lt;br /&gt;
***************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;sys/time.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define ANINX 7&lt;br /&gt;
#define ANINY 3&lt;br /&gt;
#define ANINZ 1&lt;br /&gt;
&lt;br /&gt;
int keepGoing = 1;&lt;br /&gt;
&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepGoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
*	int read_anin(char * fileName)&lt;br /&gt;
*&lt;br /&gt;
*	The argument is the fileName instead of the integer because this will be called a lot for only 3 filenames,&lt;br /&gt;
*	so we want to save ourselves the work of constructing the filename each time.&lt;br /&gt;
*&lt;br /&gt;
*/&lt;br /&gt;
int read_anin(char * fileName){&lt;br /&gt;
	FILE *fp;&lt;br /&gt;
	char readValue[5];&lt;br /&gt;
&lt;br /&gt;
	if ((fp = fopen(fileName,  &amp;quot;r&amp;quot;)) == NULL) {&lt;br /&gt;
		printf(&amp;quot;Cannot open anin file: %s.\n&amp;quot;, fileName);&lt;br /&gt;
		exit(1);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	//Set pointer to begining of the file&lt;br /&gt;
	rewind(fp);&lt;br /&gt;
	//Write our value of &amp;quot;out&amp;quot; to the file&lt;br /&gt;
	fread(readValue, sizeof(char), 10, fp);&lt;br /&gt;
	readValue[4] = '\0'; //for some reason when reading 4 digit numbers you get weird garbage after the value&lt;br /&gt;
	fclose(fp);&lt;br /&gt;
&lt;br /&gt;
	return atoi(readValue);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char **argv, char **envp){&lt;br /&gt;
	int i;&lt;br /&gt;
&lt;br /&gt;
	char fileNameX[50], fileNameY[50], fileNameZ[50];&lt;br /&gt;
	sprintf(fileNameX, &amp;quot;/sys/devices/platform/omap/tsc/ain%d&amp;quot;, ANINX);&lt;br /&gt;
	sprintf(fileNameY, &amp;quot;/sys/devices/platform/omap/tsc/ain%d&amp;quot;, ANINY);&lt;br /&gt;
	sprintf(fileNameZ, &amp;quot;/sys/devices/platform/omap/tsc/ain%d&amp;quot;, ANINZ);&lt;br /&gt;
	&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
	while(keepGoing){&lt;br /&gt;
		printf(&amp;quot;X: %d | Y: %d | Z: %d\r&amp;quot;, read_anin(fileNameX), read_anin(fileNameY), read_anin(fileNameZ));&lt;br /&gt;
		usleep(10000);&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code can be compiled with the command ''gcc adxl335.c -o adxl335''&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Contributions_and_Project_Status_here</id>
		<title>ECE497 Contributions and Project Status here</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Contributions_and_Project_Status_here"/>
				<updated>2012-09-11T19:40:12Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|- &lt;br /&gt;
! Name&lt;br /&gt;
! git repository&lt;br /&gt;
|-&lt;br /&gt;
| [[User:hansenrl | Ross Hansen]]&lt;br /&gt;
| [https://github.com/hansenrl/ece497.git MiniProject01]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:atniptw | Tom Atnip]]&lt;br /&gt;
| [https://github.com/atniptw/ECE497 ECE497_Repo]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Contributions_and_Project_Status_here</id>
		<title>ECE497 Contributions and Project Status here</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Contributions_and_Project_Status_here"/>
				<updated>2012-09-11T19:39:47Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|- &lt;br /&gt;
! Name&lt;br /&gt;
! git repository&lt;br /&gt;
|-&lt;br /&gt;
| [[User:hansenrl | Ross Hansen]]&lt;br /&gt;
| [https://github.com/hansenrl/ece497.git MiniProject01]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:atniptw | Tom Atnip]]&lt;br /&gt;
| [[https://github.com/atniptw/ECE497 | ECE497 Repo]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Contributions_and_Project_Status_here</id>
		<title>ECE497 Contributions and Project Status here</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Contributions_and_Project_Status_here"/>
				<updated>2012-09-11T19:39:26Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|- &lt;br /&gt;
! Name&lt;br /&gt;
! git repository&lt;br /&gt;
|-&lt;br /&gt;
| [[User:hansenrl | Ross Hansen]]&lt;br /&gt;
| [https://github.com/hansenrl/ece497.git MiniProject01]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:atniptw | Tom Atnip]]&lt;br /&gt;
| [https://github.com/atniptw/ECE497 | ECE497 Repo]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Contributions_and_Project_Status_here</id>
		<title>ECE497 Contributions and Project Status here</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Contributions_and_Project_Status_here"/>
				<updated>2012-09-11T19:38:56Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|&lt;br /&gt;
|- &lt;br /&gt;
! Name&lt;br /&gt;
! git repository&lt;br /&gt;
|-&lt;br /&gt;
| [[User:hansenrl | Ross Hansen]]&lt;br /&gt;
| [https://github.com/hansenrl/ece497.git MiniProject01]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:atniptw | Tom Atnip]]&lt;br /&gt;
| [https://github.com/atniptw/ECE497]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/User:Atniptw</id>
		<title>User:Atniptw</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/User:Atniptw"/>
				<updated>2012-09-10T15:52:53Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Thomas Atnip&lt;br /&gt;
&lt;br /&gt;
Computer Science &amp;amp;&amp;amp; Software Engineering Major, Class of 2013.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Project topics I'm interested in:&lt;br /&gt;
* Autonomous Drones - Beyond the scope of this class, but an area I find interesting&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mini-projects == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How To ==&lt;br /&gt;
* [[ECE497: How to install Ubuntu on the Beagleboard]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Derived from [[User:Mayhewsw | Stephen Mayhew]] page&lt;br /&gt;
[[Category:ECE497]]&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/EBC_Exercise_10_Flashing_an_LED</id>
		<title>EBC Exercise 10 Flashing an LED</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/EBC_Exercise_10_Flashing_an_LED"/>
				<updated>2012-09-09T17:55:27Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: /* Analog in - bone */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:EmbeddedBeagleClass]]&lt;br /&gt;
[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
The [http://en.wikipedia.org/wiki/Hello_world_program &amp;quot;Hello World&amp;quot;] program is the traditional first program for many classes.  Flashing an LED is the embedded equivalent.  Here we will explore a few ways to flash and LED on the Beagle and explore General Purpose I/O (gpio) along the way.  This will call be done from the command line of the Beagle, so there is no need for the host computer.&lt;br /&gt;
&lt;br /&gt;
== gpio via the Shell Command Line and sysfs ==&lt;br /&gt;
&lt;br /&gt;
('''Note''':  Draw the new diagrams with [http://engineersofthecorn.blogspot.com/2012/06/fritzing-part-for-beaglebone.html this].)&lt;br /&gt;
&lt;br /&gt;
The easiest way to do general purpose I/O (gpio) on the Beagle is through a terminal window and a shell prompt. In Linux most everything is treated as a file.  Even things that aren't files. In our class we'll use a virtual file system called '''sysfs'''.  sysfs exposes the drivers for the hardware so you get easily use them.&lt;br /&gt;
&lt;br /&gt;
Try this, open a terminal and type:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd /sys'''&lt;br /&gt;
 beagle$ '''ls -F'''&lt;br /&gt;
 block/  bus/  class/  dev/  devices/  firmware/  fs/  kernel/  module/  power/&lt;br /&gt;
&lt;br /&gt;
Here we see several directories that represent hardware we can control. Explore a bit and see what you find.&lt;br /&gt;
&lt;br /&gt;
Now try:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd /sys/class'''&lt;br /&gt;
 beagle$ '''ls -F'''&lt;br /&gt;
 bccat/      hwmon/        mtd/             scsi_disk/     usb_device/&lt;br /&gt;
 bdi/        i2c-adapter/  net/             scsi_generic/  usbmon/&lt;br /&gt;
 block/      i2c-dev/      omap-previewer/  scsi_host/     vc/&lt;br /&gt;
 bluetooth/  input/        omap-resizer/    sound/         video4linux/&lt;br /&gt;
 bsg/        leds/         pvr/             spi_master/    vtconsole/&lt;br /&gt;
 display/    mdio_bus/     regulator/       spidev/&lt;br /&gt;
 firmware/   mem/          rfkill/          thermal/&lt;br /&gt;
 gpio/       misc/         rtc/             tty/&lt;br /&gt;
 graphics/   mmc_host/     scsi_device/     ubi/&lt;br /&gt;
&lt;br /&gt;
Explore some.  What do you find?  In '''graphics''' you will see the 3 frame buffers supported by the processor.  In '''sound''' you'll see the [http://www.alsa-project.org/main/index.php/Main_Page alsa] sound devices.&lt;br /&gt;
&lt;br /&gt;
== Flashing the user LEDs ==&lt;br /&gt;
&lt;br /&gt;
The Beagle xM has two user LEDS, '''user0''' and '''user1''', that you can control.  The Bone has 4. Try this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd /sys/class/leds'''&lt;br /&gt;
 beagle$ '''ls -F'''&lt;br /&gt;
 beaglebeagleboard::pmu_stat@  beagleboard::usr0@  beagleboard::usr1@&lt;br /&gt;
&lt;br /&gt;
Here you see the directories for controlling each of the usr LEDs. By default, usr0 flashes a heartbeat pattern and usr1 flashes when the micro SD card is accessed.  Let's control usr0.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd beagleboard\:\:usr0'''&lt;br /&gt;
 beagle$ '''ls -F'''&lt;br /&gt;
 brightness  device@  max_brightness  power/  subsystem@  trigger  uevent&lt;br /&gt;
&lt;br /&gt;
See what's in '''brightness''', '''max_brightness''' and '''trigger''' by using the &amp;lt;code&amp;gt;cat&amp;lt;/code&amp;gt; command.  For example:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cat trigger'''&lt;br /&gt;
 none nand-disk mmc0 [heartbeat]&lt;br /&gt;
&lt;br /&gt;
This shows trigger can have 4 values.  The present value is '''heartbeat'''.  Check the LED, is the beating?  You can stop the heartbeat via:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''echo none &amp;gt; trigger'''&lt;br /&gt;
 beagle$ '''cat trigger'''&lt;br /&gt;
 [none] nand-disk mmc0 heartbeat &lt;br /&gt;
&lt;br /&gt;
Did it stop beating?  You can now turn it on and off with:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''echo 1 &amp;gt; brightness'''&lt;br /&gt;
 beagle$ '''echo 0 &amp;gt; brightness'''&lt;br /&gt;
&lt;br /&gt;
Is it responding correctly?&lt;br /&gt;
&lt;br /&gt;
The Bone has more trigger options.  Try:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cat trigger'''&lt;br /&gt;
 [none] mmc0 timer heartbeat backlight gpio default-on &lt;br /&gt;
 beagle$ '''echo timer &amp;gt; trigger'''&lt;br /&gt;
 brightness  delay_on  max_brightness  subsystem  uevent&lt;br /&gt;
 delay_off   device    power           trigger&lt;br /&gt;
 beagle$ '''echo 100 &amp;gt; delay_on'''&lt;br /&gt;
 beagle$ '''echo 900 &amp;gt; delay_off'''&lt;br /&gt;
&lt;br /&gt;
What does this do?&lt;br /&gt;
&lt;br /&gt;
== Adding your own LED - bone ==&lt;br /&gt;
&lt;br /&gt;
It's not hard to use the gpio pins to control your own LED. All you need is an LED and a 220&amp;amp;Omega; resistor. Here's a picture of how it's wired. We are just doing the LED at the top of the breadboard for now.&lt;br /&gt;
&lt;br /&gt;
[[File:Bone gpio.JPG|300px]]&lt;br /&gt;
[[File:BoneGPIO.png|300px]]&lt;br /&gt;
&lt;br /&gt;
So how do you know where to connect it?  The BeagleBone [http://beagleboard.org/static/beaglebone/latest/Docs/Hardware/BONE_SRM.pdf System Reference Manual] has the details.  Figure 3 on page 18 of RevA5.01 shows:&lt;br /&gt;
&lt;br /&gt;
[[File:Beagle Bone.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
There at two expansion headers, P8 and P9.  Look at the bottom of the left header and you'll see it's labeled '''P9'''. Table 11 on page 59 shows the pinout for P9.&lt;br /&gt;
&lt;br /&gt;
[[File:Bone P9 pinout.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
On the first photo above you can see that pin 1 (Ground) is wired to the '''-''' bus and pin 3 (3.3V) is wired to the '''+''' bus. The 220&amp;amp;Omega; resistor is wired to the '''-''' bus and the other end is attached to the negative lead of the LED.  The positive lead is attached to pin 12 which, as shown in Table 11, is attached to '''gpio1_28'''.  The gpio pins are in banks of 32 each, so to find the gpio number to use on the Beagle, use 1*32+28='''60'''.  Here's how you turn it on&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd /sys/class/gpio'''&lt;br /&gt;
 beagle$ '''ls'''&lt;br /&gt;
 export  gpiochip0  gpiochip32  gpiochip64  gpiochip96  unexport&lt;br /&gt;
&lt;br /&gt;
Presently no gpio pins are visible.  You need to tell it which pin to export&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''echo 60 &amp;gt; export'''&lt;br /&gt;
 beagle$ '''ls'''&lt;br /&gt;
 gpio60  gpiochip0  gpiochip32  gpiochip64  gpiochip96&lt;br /&gt;
&lt;br /&gt;
Notice '''gpio60''' has appeared.  All we need to do is tell it which direction and then turn it on.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd gpio60'''&lt;br /&gt;
 beagle$ '''echo out &amp;gt; direction'''&lt;br /&gt;
 beagle$ '''echo 1 &amp;gt; value'''&lt;br /&gt;
&lt;br /&gt;
Your LED should be on!  When you are done you can unexport the pin and it will disappear.&lt;br /&gt;
 beagle$ cd ..&lt;br /&gt;
 beagle$ '''echo 60 &amp;gt; unexport'''&lt;br /&gt;
&lt;br /&gt;
== Reading a switch - bone ==&lt;br /&gt;
&lt;br /&gt;
Now that you have an LED working, wiring in a switch is easy.  The picture above shows a push button switch wired in at the bottom of the P9 header.  Attach the '''+''' bus to one pole on the switch with a wire.  The other end of the switch is attached to pin 42 which is '''gpio0_7'''. &lt;br /&gt;
&lt;br /&gt;
Based on what you saw above, show how to read the switch.&lt;br /&gt;
&lt;br /&gt;
Once you have the switch and LED working you can use the following scripts to play with them.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd ~/exercises/gpio'''&lt;br /&gt;
 beagle$ '''./togglegpio.sh 60 0.1'''&lt;br /&gt;
&lt;br /&gt;
The LED should be blinking on and off.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''./readgpio.sh 7'''&lt;br /&gt;
&lt;br /&gt;
Push the pushbutton and see what happens.&lt;br /&gt;
&lt;br /&gt;
How can this work without a pulldown resistor? It turns out the Bone has an internal pulldown (and up) resistor that can be software enabled.  Try:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd /sys/kernel/debug/omap_mux'''&lt;br /&gt;
 beagle$ '''ls'''&lt;br /&gt;
 ain0               gpmc_ad2        lcd_data3      mii1_txd2&lt;br /&gt;
 ain1               gpmc_ad3        lcd_data4      mii1_txd3&lt;br /&gt;
 ain2               gpmc_ad4        lcd_data5      mii1_txen&lt;br /&gt;
 ain3               gpmc_ad5        lcd_data6      mmc0_clk&lt;br /&gt;
 ain4               gpmc_ad6        lcd_data7      mmc0_cmd&lt;br /&gt;
 ain5               gpmc_ad7        lcd_data8      mmc0_dat0&lt;br /&gt;
 ain6               gpmc_ad8        lcd_data9      mmc0_dat1&lt;br /&gt;
 ain7               gpmc_ad9        lcd_hsync      mmc0_dat2&lt;br /&gt;
 board              gpmc_advn_ale   lcd_pclk       mmc0_dat3&lt;br /&gt;
 ecap0_in_pwm0_out  gpmc_ben0_cle   lcd_vsync      rmii1_refclk&lt;br /&gt;
 emu0               gpmc_ben1       mcasp0_aclkr   spi0_cs0&lt;br /&gt;
 emu1               gpmc_clk        mcasp0_aclkx   spi0_cs1&lt;br /&gt;
 gpmc_a0            gpmc_csn0       mcasp0_ahclkr  spi0_d0&lt;br /&gt;
 gpmc_a1            gpmc_csn1       mcasp0_ahclkx  spi0_d1&lt;br /&gt;
 gpmc_a10           gpmc_csn2       mcasp0_axr0    spi0_sclk&lt;br /&gt;
 gpmc_a11           gpmc_csn3       mcasp0_axr1    uart0_ctsn&lt;br /&gt;
 gpmc_a2            gpmc_oen_ren    mcasp0_fsr     uart0_rtsn&lt;br /&gt;
 gpmc_a3            gpmc_wait0      mcasp0_fsx     uart0_rxd&lt;br /&gt;
 gpmc_a4            gpmc_wen        mdio_clk       uart0_txd&lt;br /&gt;
 gpmc_a5            gpmc_wpn        mdio_data      uart1_ctsn&lt;br /&gt;
 gpmc_a6            i2c0_scl        mii1_col       uart1_rtsn&lt;br /&gt;
 gpmc_a7            i2c0_sda        mii1_crs       uart1_rxd&lt;br /&gt;
 gpmc_a8            lcd_ac_bias_en  mii1_rxclk     uart1_txd&lt;br /&gt;
 gpmc_a9            lcd_data0       mii1_rxd0      usb0_drvvbus&lt;br /&gt;
 gpmc_ad0           lcd_data1       mii1_rxd1      usb1_drvvbus&lt;br /&gt;
 gpmc_ad1           lcd_data10      mii1_rxd2      vrefn&lt;br /&gt;
 gpmc_ad10          lcd_data11      mii1_rxd3      vrefp&lt;br /&gt;
 gpmc_ad11          lcd_data12      mii1_rxdv      xdma_event_intr0&lt;br /&gt;
 gpmc_ad12          lcd_data13      mii1_rxerr     xdma_event_intr1&lt;br /&gt;
 gpmc_ad13          lcd_data14      mii1_txclk&lt;br /&gt;
 gpmc_ad14          lcd_data15      mii1_txd0&lt;br /&gt;
 gpmc_ad15          lcd_data2       mii1_txd1&lt;br /&gt;
 beagle$ '''ls | wc'''&lt;br /&gt;
    125     125    1220&lt;br /&gt;
&lt;br /&gt;
Here you will find a list of how all the pin muxes are set. There are some 125 of them!&lt;br /&gt;
How do you find which one is gpio0_7?&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''grep gpio0_7 *'''&lt;br /&gt;
 ecap0_in_pwm0_out:name: ecap0_in_pwm0_out.gpio0_7 (0x44e10964/0x964 = 0x0027), b NA, t NA&lt;br /&gt;
 ''ecap0_in_pwm0_out'':signals: ecap0_in_pwm0_out | uart3_txd | spi1_cs1 | pr1_ecap0_ecap_capin_apwm_o | spi1_sclk | mmc0_sdwp | xdma_event_intr2 | ''gpio0_7''&lt;br /&gt;
&lt;br /&gt;
'''ecap0_in_pwm0_out''' is the file that contains gpio0_7.  Look up gpio0_7&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cat ecap0_in_pwm0_out'''&lt;br /&gt;
 name: ecap0_in_pwm0_out.gpio0_7 (0x44e10964/0x964 = 0x0027), b NA, t NA&lt;br /&gt;
 mode: ''OMAP_PIN_INPUT_PULLDOWN'' | OMAP_MUX_MODE7&lt;br /&gt;
 signals: ecap0_in_pwm0_out | uart3_txd | spi1_cs1 | pr1_ecap0_ecap_capin_apwm_o | spi1_sclk | mmc0_sdwp | xdma_event_intr2 | gpio0_7&lt;br /&gt;
&lt;br /&gt;
It's set to be a PULLDOWN.  Sectiion 9.2.2.2, Page 877 of the AM335x Technical Reference manual discusses Pull Selection and tells which bits do what.  The '''0x0027''' is the code that says which MODE is used and how the pull up/down resistor is set. (There seems to be a mismatch between the manual and the bone.  The manual says bit 3 of 0x0027 enables the pull up/down.  Bit 3 isn’t set, but the pull down is working.)&lt;br /&gt;
&lt;br /&gt;
You can switch the gpio pin to pullup.  Try&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''echo 0x0037 &amp;gt; ecap0_in_pwm0_out'''&lt;br /&gt;
 beagle$ '''cat ecap0_in_pwm0_out''' &lt;br /&gt;
 name: ecap0_in_pwm0_out.gpio0_7 (0x44e10964/0x964 = 0x0037), b NA, t NA&lt;br /&gt;
 mode: OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE7&lt;br /&gt;
 signals: ecap0_in_pwm0_out | uart3_txd | spi1_cs1 | pr1_ecap0_ecap_capin_apwm_o | spi1_sclk | mmc0_sdwp | xdma_event_intr2 | gpio0_7&lt;br /&gt;
&lt;br /&gt;
Does it act like a pullup resistor is attached?&lt;br /&gt;
&lt;br /&gt;
=== Challenge ===&lt;br /&gt;
&lt;br /&gt;
* Can you modify the scripts above to read the switch and turn the LED on and off?&lt;br /&gt;
* Rewire your switch to work will a pullup resistor.&lt;br /&gt;
&lt;br /&gt;
== Analog in - bone ==&lt;br /&gt;
&lt;br /&gt;
(This is based on [http://www.gigamegablog.com/2012/01/22/beaglebone-coding-101-using-the-serial-and-analog-pins/ this].)&lt;br /&gt;
&lt;br /&gt;
The bone has eight Analog Inputs.  Several are exposed on P9.  They are labeled '''AIN''' in table 11 above.  How many do you find?&lt;br /&gt;
&lt;br /&gt;
The AIN pins are sampled at 12 bits and 100k samples per second.  The input voltage is between 0 and 1.8V.  Fortunately, both voltages are available on P9.&lt;br /&gt;
&lt;br /&gt;
The photo above shows a small potentiometer wired to the bone.  One end goes to the analog ground (pin 34), the other analog 1.8V (pin 32). The wiper is attached to '''AIN5''' which is pin 36.&lt;br /&gt;
&lt;br /&gt;
You interact with the analog in much like the gpio, but it appears in a different location.  How do you find that location?  One approach is the '''find''' command.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''find / -name ain5'''&lt;br /&gt;
 /sys/devices/platform/omap/tsc/ain5&lt;br /&gt;
 /sys/kernel/debug/omap_mux/ain5&lt;br /&gt;
 '''^C'''&lt;br /&gt;
&lt;br /&gt;
I used '''Ctrl-C''' to interrupt since it already found what I wanted.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd /sys/devices/platform/omap/tsc'''&lt;br /&gt;
 beagle$ '''ls'''&lt;br /&gt;
 ain1  ain3  ain5  ain7  driver    power      uevent&lt;br /&gt;
 ain2  ain4  ain6  ain8  modalias  subsystem&lt;br /&gt;
&lt;br /&gt;
There are the various analog inputs, but watch out.  This interface starts numbering at '''1''' and Table 11 starts at '''0''', so to read AIN5 you need to look at '''ain6'''!&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cat ain6'''&lt;br /&gt;
 1185&lt;br /&gt;
&lt;br /&gt;
(Unfortunately the interface doesn't print a RETURN after the value.)&lt;br /&gt;
Change the pot and rerun the cat.  What's the min and max value you get?  Is it 12 bits?&lt;br /&gt;
&lt;br /&gt;
=== Challenge ===&lt;br /&gt;
Rewrite the scripts from before to read an AIN pin and continuously display it's value.&lt;br /&gt;
&lt;br /&gt;
== Reading a gpio pin with an Oscilloscope - xM ==&lt;br /&gt;
&lt;br /&gt;
You can easily access many of the gpio pins via the Main Expansion Header.  Page 107 of the [http://beagleboard.org/static/BBxMSRM_latest.pdf BeagleBoard-xM System Reference Manual] has this figure.&lt;br /&gt;
[[File:MainHeader.png | 750px]]&lt;br /&gt;
&lt;br /&gt;
Unfortunately the gpio pins don't appear here.  It turns out the processor has more internal I/O lines than it has physical pins.  Each physical pin can can be connected to up to 8 internal lines.  [[BeagleBoardPinMux]] does a nice job of explaining it all.  The big clue is here [[BeagleBoardPinMux#Beagle]] which references Table 22 on page 108 of the -xM [http://beagleboard.org/static/BBSRM_latest.pdf System Reference Manual].&lt;br /&gt;
&lt;br /&gt;
[[File:ExpansionSignals.png‎]]&lt;br /&gt;
&lt;br /&gt;
Note that gpio130 appears on pin 21 of the Expansion Header. Also note that pins 27 and 28 are ground.  Attach your scope probe to these.  Now, let's put a signal on the pin.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd /sys/class/gpio'''&lt;br /&gt;
 beagle$ '''ls -F'''&lt;br /&gt;
 export      gpiochip128@  gpiochip192@  gpiochip64@  unexport&lt;br /&gt;
 gpiochip0@  gpiochip160@  gpiochip32@   gpiochip96@&lt;br /&gt;
&lt;br /&gt;
Notice there is no folder for gpio130.  Create it with:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''echo 130 &amp;gt; export'''&lt;br /&gt;
 beagle$ '''ls -F'''&lt;br /&gt;
 export    gpiochip0@    gpiochip160@  gpiochip32@  gpiochip96@&lt;br /&gt;
 gpio130@  gpiochip128@  gpiochip192@  gpiochip64@  unexport&lt;br /&gt;
&lt;br /&gt;
Update your exercises folder and cd to gpio directory.&lt;br /&gt;
&lt;br /&gt;
  beagle$ '''cd'''&lt;br /&gt;
  beagle$ '''cd exercises/gpio'''&lt;br /&gt;
  beagle$ '''git pull'''&lt;br /&gt;
  beagle$ '''gedit togglegpio.sh'''&lt;br /&gt;
&lt;br /&gt;
Can you tell what the program is doing?  Try running it:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''togglegpio 130 0.05'''&lt;br /&gt;
&lt;br /&gt;
Note that if you are the root user (which is the default case for Angstrom), you will have to type the following command:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''./togglegpio 130 0.05'''&lt;br /&gt;
&lt;br /&gt;
The first argument tells which gpio port to toggle, the second tells how long to delay between toggling.  In this example 0.05 s is 50 ms, which should give a period around 100ms. Measure the signal on an oscilloscope.&lt;br /&gt;
&lt;br /&gt;
== Assignment: gpio from the shell ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span style=&amp;quot;color:green;&amp;quot;&amp;gt;Measuring a gpio pin on an Oscilloscope &amp;lt;/span&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Answer the following questions about gpio measurements.&lt;br /&gt;
&lt;br /&gt;
# What's the min and max voltage?  &lt;br /&gt;
# What period is it?  &lt;br /&gt;
# How close is it to 100ms?  &lt;br /&gt;
# Why do they differ?&lt;br /&gt;
# Run '''htop''' and see how much processor you are using.&lt;br /&gt;
# Try different values for the sleep time (2nd argument). What's the shortest period you can get? Make a table of the values you try and the corresponding period and processor usage.&lt;br /&gt;
# How stable is the period?  &lt;br /&gt;
# Try launching something like '''mplayer'''. How stable is the period?&lt;br /&gt;
# Try cleaning up togglegpio and removing unneeded lines.  Does it impact the period?&lt;br /&gt;
# togglegpio uses bash (first line in file).  Try using sh.  Is the period shorter?&lt;br /&gt;
# What's the shortest period you can get?&lt;br /&gt;
&lt;br /&gt;
=== Toggling the LEDs ===&lt;br /&gt;
&lt;br /&gt;
Modify togglegpio (call it toggleLED) to toggle the LEDs.  Can you get the LED to appear to dim by changing the duty cycle of the toggling?&lt;br /&gt;
&lt;br /&gt;
=== User Button to gpio 130 ===&lt;br /&gt;
&lt;br /&gt;
Write a shell script that reads the User Button and outputs it value on gpio pin 130.&lt;br /&gt;
&lt;br /&gt;
=== Count the User Button Presses ===&lt;br /&gt;
&lt;br /&gt;
Write a shell script that displays a count of the number of times the User Button has been pressed.&lt;br /&gt;
&lt;br /&gt;
=== Copy gpio 130 to gpio 131 ===&lt;br /&gt;
&lt;br /&gt;
Write a shell script that copies the value of gpio pin 130 to gpio pin 131.  How much CPU time does it take?  What's the delay from the time the input changes until the output changes?  How constant is the delay?&lt;br /&gt;
&lt;br /&gt;
== Additional Exercises ==&lt;br /&gt;
&lt;br /&gt;
=== Reading the Keyboard and Mouse ===&lt;br /&gt;
Try this:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd /sys/class/input'''&lt;br /&gt;
 beagle$ '''ls -F'''&lt;br /&gt;
 beagle$ '''evtest /dev/input/event2'''&lt;br /&gt;
 Hit ctrl-C to stop&lt;br /&gt;
&lt;br /&gt;
Now move your mouse around, or try you keyboard.  My mouse is plugged into the bottom left USB port and event2 responds to it.  Where do your keyboard and mouse appear?&lt;br /&gt;
&lt;br /&gt;
=== Reading the User Button ===&lt;br /&gt;
('''Note''': This may not work on some versions of the OS. In these versions another program is controlling the gpio port that the User button is attached to.)&lt;br /&gt;
&lt;br /&gt;
The Beagle has a couple of push buttons. One reboots the whole board.  Use with care.  One is for you to use, it's to the right of the Reset button, between the two stacks of USB ports.&lt;br /&gt;
[[File:BeagleUserButton.png]]&lt;br /&gt;
&lt;br /&gt;
It's attached to gpio port 4.  You can read it via:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd /sys/class/gpio'''&lt;br /&gt;
 beagle$ '''ls -F'''&lt;br /&gt;
 export    gpio133@  gpio137@  gpio141@      gpiochip160@  gpiochip96@&lt;br /&gt;
 gpio130@  gpio134@  gpio138@  gpio162@      gpiochip192@  unexport&lt;br /&gt;
 gpio131@  gpio135@  gpio139@  gpiochip0@    gpiochip32@&lt;br /&gt;
 gpio132@  gpio136@  gpio140@  gpiochip128@  gpiochip64@&lt;br /&gt;
&lt;br /&gt;
Notice there is no gpio4.  Here's how you can create it, set it to an input port and read its value:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''echo 4 &amp;gt; export'''&lt;br /&gt;
 beagle$ '''ls'''&lt;br /&gt;
 beagle$ '''cd gpio4'''&lt;br /&gt;
 beagle$ '''echo in &amp;gt; direction'''&lt;br /&gt;
 beagle$ '''cat value'''&lt;br /&gt;
&lt;br /&gt;
Try holding down the switch and doing &amp;lt;code&amp;gt;cat value&amp;lt;/code&amp;gt; again.  Does the value change?  There's a shell script called '''readgpio''' that repeatedly reads the switch.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''readgpio 4'''&lt;br /&gt;
&lt;br /&gt;
Try pushing the switch.  Does it work?  Hit ctrl-C to stop.  Look at readgpio.  How does it work?&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''which readgpio'''&lt;br /&gt;
 beagle$ '''cp /usr/bin/readgpio ~'''&lt;br /&gt;
 beagle$ '''gedit ~/readgpio'''&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
# [http://wh1t3s.com/2009/05/14/reading-beagleboard-gpio/ Here] is wh1ts article on flashing an LED.  It is referenced in the '''readgpio''' file that comes on the Beagle.&lt;br /&gt;
# [http://blog.makezine.com/archive/2009/02/blinking-leds-with-the-beagle-board.html?CMP=OTC-0D6B48984890 This] Make magazine article has a few more details.&lt;br /&gt;
# [http://www.avrfreaks.net/wiki/index.php/Documentation:Linux/GPIO#Getting_access_to_a_GPIO Here] in a gpio reference for Linux in general. It includes sample 'C' code for flashing at 1 Hz.&lt;br /&gt;
# [https://groups.google.com/forum/?hl=en#!msg/beagleboard/20rM-r8C2YY/hVZiN2ahI8YJ Here] is a posting in the Beagle Google group about gpio.&lt;br /&gt;
# [http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/gpio.txt;h=36af58eba136bac198ea3b1f33f34236be9ce5df;hb=HEAD Here] is some information about gpio from the kernel point of view.&lt;br /&gt;
# [http://wiki.gumstix.org/index.php?title=GPIO_Event_Driver Here] is some info on a GPIO Event Driver&lt;br /&gt;
# [https://www.ridgerun.com/developer/wiki/index.php/How_to_use_GPIO_signals Here] is info on how to set '''edge''' to falling and poll() the pin.&lt;br /&gt;
# [http://www.kernel.org/doc/Documentation/gpio.txt Here] is the kernel Documentation on gpio.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Contributions_and_Project_Status</id>
		<title>ECE497 Contributions and Project Status</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Contributions_and_Project_Status"/>
				<updated>2012-09-04T15:56:12Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Contributions]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
== Fall 2012 ==&lt;br /&gt;
&lt;br /&gt;
=== Project Status ===&lt;br /&gt;
&lt;br /&gt;
Please edit this page and add your project to this list. Copy my [[ECE497 Project Template]] to your own eLinux page and include the title of your project in the name of the page.  &lt;br /&gt;
&lt;br /&gt;
Please make the list alphabetical by family name.&lt;br /&gt;
&lt;br /&gt;
Take a look at what you and others have contributed.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
! Name&lt;br /&gt;
! Contributions&lt;br /&gt;
! Project&lt;br /&gt;
! git repository&lt;br /&gt;
|-&lt;br /&gt;
| [[User:atniptw | Tom Atnip]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
| [https://github.com/atniptw/ atniptw]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:larmorgs | Greg Larmore]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:jessebrannon | Jesse Brannon]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:duganje | Josh Dugan]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 duganje Project | My Beagle Project]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:Geislekj | Kevin Geisler]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
| [https://github.com/geislekj/ geislekj]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:chris.good | Christopher A Good]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:hansenrl | Ross Hansen]]&lt;br /&gt;
| [[Special:Contributions/hansenrl|contrib]]&lt;br /&gt;
| [[ECE497 hansenrl Project | My Beagle Project]]&lt;br /&gt;
| [https://github.com/hansenrl/ Hansenrl]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:jungeml | Michael Junge]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 jungeml Project | My Beagle Project]]&lt;br /&gt;
| [https://github.com/jungeml/ Jungeml]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:mmoravec | Matthew Moravec]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 mmoravec Project | My Beagle Project]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[User:ngop | Peter Ngo]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 ngop Project | My Beagle Project]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[User:shinnsm|Stephen Shinn]]&lt;br /&gt;
| [[Special:Contributions/shinnsm|contrib]]&lt;br /&gt;
| Project TBD&lt;br /&gt;
| [https://github.com/shinnsm shinnsm]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:ruff | Ruffin White]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 ruff Project | My Beagle Project]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Yoder | Mark A. Yoder]]&lt;br /&gt;
| [[Special:Contributions/Yoder | contrib]]&lt;br /&gt;
| [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
| [https://github.com/MarkAYoder MarkAYoder]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Popenhjc | James Popenhagen]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 popenhjc Project | My Beagle Project]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Whiteer | Elias White]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 whiteer Project | My Beagle Project]]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:Richarsm | Sean Richardson]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 richarsm Project | My Beagle Project]]&lt;br /&gt;
| [https://github.com/seanrich Sean Richardson]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Millerap | Andrew Miller]]&lt;br /&gt;
|&lt;br /&gt;
| [[ECE 497 millerap Project | My Beagle Project]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Winter 2011-2012 ==&lt;br /&gt;
&lt;br /&gt;
=== Contributions ===&lt;br /&gt;
&lt;br /&gt;
# [[Special:Contributions/Yuming | Yuming Cao]]&lt;br /&gt;
# [[Special:Contributions/Yifei | Yifei Li]]&lt;br /&gt;
# [[Special:Contributions/Harrisgw | Greg Harrison]]&lt;br /&gt;
# [[Special:Contributions/mac | Jack Ma]]&lt;br /&gt;
# [[Special:Contributions/Gemini91 | Guanqun Wang]]&lt;br /&gt;
# [[Special:Contributions/Yanj | Mona Yan]]&lt;br /&gt;
# [[Special:Contributions/Yoder | Mark A. Yoder]]&lt;br /&gt;
# [[Special:Contributions/Yuhasmj | Michael Yuhas]]&lt;br /&gt;
# [[Special:Contributions/Ziyi Zhang | Ziyi Zhang]]&lt;br /&gt;
# [[Special:Contributions/Zitnikdj | David Zitnik]]&lt;br /&gt;
# [[Special:Contributions/Zitnikdj | Alex Drane]]&lt;br /&gt;
# [[Special:Contributions/jessebrannon | Jesse Brannon]]&lt;br /&gt;
&lt;br /&gt;
=== Project Status ===&lt;br /&gt;
&lt;br /&gt;
# [[User:Yoder | Mark A. Yoder]], [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
# [[user:Yanj|Mona Yan]] and [[user:Harrisgw| Greg Harrison]], [[PS EYE QT PROJECT | Playstation Eye Audio with Qt]]&lt;br /&gt;
# [[user:Caogecym | Yuming Cao]] and [[user:Ziyi Zhang | Ziyi Zhang]], [[Node.js Weather Station]]&lt;br /&gt;
# [[user:Yifei| Yifei Li]] and [[user:Gemini91| Guanqun Wang]], [[ Kinect Project | Play games using Kinect on Beagleboard]]&lt;br /&gt;
# [[user:Yuhasmj| Michael J. Yuhas]] and [[user:mac | Jack Ma]], [[ Multiple Partitions via U-boot | Multiple Partitions via U-boot ]]&lt;br /&gt;
# [[user:Zitnikdj| David Zitnik]], [[ ECE497 Project: Twitter Java Application | Twitter Java Application ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Contributions_and_Project_Status</id>
		<title>ECE497 Contributions and Project Status</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Contributions_and_Project_Status"/>
				<updated>2012-07-20T23:42:59Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Contributions]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
== Fall 2012 ==&lt;br /&gt;
&lt;br /&gt;
=== Contributions ===&lt;br /&gt;
Please edit this page and add your user name, alphabetically by last name, to this list.&lt;br /&gt;
&lt;br /&gt;
Take a look at what you and others have contributed.&lt;br /&gt;
&lt;br /&gt;
# [[Special:Contributions/Yoder | Mark A. Yoder]]&lt;br /&gt;
&lt;br /&gt;
=== Project Status ===&lt;br /&gt;
&lt;br /&gt;
Please edit this page and add your project to this list. Copy my [[ECE497 Project Template]] to your own eLinux page and include the title of your project in the name of the page.  &lt;br /&gt;
&lt;br /&gt;
# [[User:atniptw | Tom Atnip]], [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
# [[User:Yoder | Mark A. Yoder]], [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
&lt;br /&gt;
== Winter 2011-2012 ==&lt;br /&gt;
&lt;br /&gt;
=== Contributions ===&lt;br /&gt;
&lt;br /&gt;
# [[Special:Contributions/Yuming | Yuming Cao]]&lt;br /&gt;
# [[Special:Contributions/Yifei | Yifei Li]]&lt;br /&gt;
# [[Special:Contributions/Harrisgw | Greg Harrison]]&lt;br /&gt;
# [[Special:Contributions/mac | Jack Ma]]&lt;br /&gt;
# [[Special:Contributions/Gemini91 | Guanqun Wang]]&lt;br /&gt;
# [[Special:Contributions/Yanj | Mona Yan]]&lt;br /&gt;
# [[Special:Contributions/Yoder | Mark A. Yoder]]&lt;br /&gt;
# [[Special:Contributions/Yuhasmj | Michael Yuhas]]&lt;br /&gt;
# [[Special:Contributions/Ziyi Zhang | Ziyi Zhang]]&lt;br /&gt;
# [[Special:Contributions/Zitnikdj | David Zitnik]]&lt;br /&gt;
&lt;br /&gt;
=== Project Status ===&lt;br /&gt;
&lt;br /&gt;
# [[User:Yoder | Mark A. Yoder]], [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
# [[user:Yanj|Mona Yan]] and [[user:Harrisgw| Greg Harrison]], [[PS EYE QT PROJECT | Playstation Eye Audio with Qt]]&lt;br /&gt;
# [[user:Caogecym | Yuming Cao]] and [[user:Ziyi Zhang | Ziyi Zhang]], [[Node.js Weather Station]]&lt;br /&gt;
# [[user:Yifei| Yifei Li]] and [[user:Gemini91| Guanqun Wang]], [[ Kinect Project | Play games using Kinect on Beagleboard]]&lt;br /&gt;
# [[user:Yuhasmj| Michael J. Yuhas]] and [[user:mac | Jack Ma]], [[ Multiple Partitions via U-boot | Multiple Partitions via U-boot ]]&lt;br /&gt;
# [[user:Zitnikdj| David Zitnik]], [[ ECE497 Project: Twitter Java Application | Twitter Java Application ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/User:Atniptw</id>
		<title>User:Atniptw</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/User:Atniptw"/>
				<updated>2012-07-20T23:40:44Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Thomas Atnip&lt;br /&gt;
&lt;br /&gt;
Computer Science &amp;amp;&amp;amp; Software Engineering Major, Class of 2013.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Project topics I'm interested in:&lt;br /&gt;
* Autonomous Drones - Beyond the scope of this class, but an area I find interesting&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mini-projects == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How To ==&lt;br /&gt;
* [[ECE497: How to install Ubuntu on the Beagleboard]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Derived from [[User:Mayhewsw | Stephen Mayhew]] page&lt;br /&gt;
[[Category:ECE497Spring2011]]&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/User:Atniptw</id>
		<title>User:Atniptw</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/User:Atniptw"/>
				<updated>2012-07-20T23:40:03Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Thomas Atnip&lt;br /&gt;
&lt;br /&gt;
Computer Science &amp;amp;&amp;amp; Software Engineering Major, Class of 2013.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Project topics I'm interested in:&lt;br /&gt;
* Autonomous Drones - Beyond the scope of this class, but an area I find interesting&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mini-projects == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How To ==&lt;br /&gt;
* [[ECE497: How to install Ubuntu on the Beagleboard]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Derived from [[User:Mayhewsw]] page&lt;br /&gt;
[[Category:ECE497Spring2011]]&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/User:Atniptw</id>
		<title>User:Atniptw</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/User:Atniptw"/>
				<updated>2012-07-20T23:37:58Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: Created page with &amp;quot;Thomas Atnip  Computer Science &amp;amp;&amp;amp; Software Engineering Major, Class of 2013.  == Projects == Project topics I'm interested in: * Autonomous Drones - Beyond the scope of this clas...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Thomas Atnip&lt;br /&gt;
&lt;br /&gt;
Computer Science &amp;amp;&amp;amp; Software Engineering Major, Class of 2013.&lt;br /&gt;
&lt;br /&gt;
== Projects ==&lt;br /&gt;
Project topics I'm interested in:&lt;br /&gt;
* Autonomous Drones - Beyond the scope of this class, but an area I find interesting&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Mini-projects == &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How To ==&lt;br /&gt;
* [[ECE497: How to install Ubuntu on the Beagleboard]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:ECE497Spring2011]]&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Editing_a_Wiki</id>
		<title>ECE497 Editing a Wiki</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Editing_a_Wiki"/>
				<updated>2012-07-20T23:34:02Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Here is a wiki you can practice editing.  Before you can edit it you will have to create an login.  Pick something that will make it easy for me to identify you as part of my class.  Then just add your name and date on the end of the table.&lt;br /&gt;
&lt;br /&gt;
You can get help here: [[Help:Contents]].&lt;br /&gt;
&lt;br /&gt;
If you need help with syntax check out the [[Editing Quickstart Guide|eLinux guide]] or the [http://en.wikipedia.org/wiki/Wikipedia:Cheatsheet Wikipedia Cheatsheet].&lt;br /&gt;
&lt;br /&gt;
== Fall 2012 ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| [[user:Yoder | Mark A. Yoder]]&lt;br /&gt;
| 18-July-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[user:atniptw | Tom Atnip]]&lt;br /&gt;
| 20-July-2012&lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Winter 2011-2012 ==&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| [[user:Yoder | Mark A. Yoder]]&lt;br /&gt;
| 21-Nov-2011&lt;br /&gt;
|-&lt;br /&gt;
| [[user:Yuming | Yuming Cao]]&lt;br /&gt;
| 21-Nov-2011&lt;br /&gt;
|-&lt;br /&gt;
| [[user:Yuhasmj | Michael Yuhas]]&lt;br /&gt;
| 21-Nov-2011&lt;br /&gt;
|-&lt;br /&gt;
| [[user:Yifei | Yifei Li]]&lt;br /&gt;
| 22-Nov-2011&lt;br /&gt;
|-&lt;br /&gt;
| [[user:Ziyi Zhang | Ziyi Zhang]]&lt;br /&gt;
| 24-Nov-2011&lt;br /&gt;
|-&lt;br /&gt;
|[[user: mac | Jack Ma]]&lt;br /&gt;
| 28-Nov-2011&lt;br /&gt;
|-&lt;br /&gt;
| [[user:Zitnikdj | David Zitnik]]&lt;br /&gt;
| 25-Nov-2011&lt;br /&gt;
|-&lt;br /&gt;
| [[user:Harrisgw | Greg Harrison]]&lt;br /&gt;
| 26-Nov-2011&lt;br /&gt;
|-&lt;br /&gt;
| [[user:Yanj | Mona J Yan]]&lt;br /&gt;
| 27-Nov-2011&lt;br /&gt;
|-&lt;br /&gt;
| [[user:Gemini91 | Guanqun Wang]]&lt;br /&gt;
| 28-Nov-2011&lt;br /&gt;
|-&lt;br /&gt;
| [[user:vsn1985 | Narayanan VS]]&lt;br /&gt;
| 28-Nov-2011&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Signup</id>
		<title>ECE497 Signup</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Signup"/>
				<updated>2012-04-27T02:18:42Z</updated>
		
		<summary type="html">&lt;p&gt;Atniptw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
&lt;br /&gt;
This page is for those who are interested in my ECE497 class.  Please add your name to the list by copying the blank line at the end and adding your information.  Please leave a blank line at the end.&lt;br /&gt;
&lt;br /&gt;
Adding your name here doesn't put you in the class.  I want to talk to you first before adding to the official class list.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;color:green; background-color:#ffffcc;&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Name&lt;br /&gt;
! Major&lt;br /&gt;
! Year&lt;br /&gt;
! Have you had an OS class? Which one(s)?&lt;br /&gt;
! Have you had an embedded class? Which one(s)?&lt;br /&gt;
! Linux experience&lt;br /&gt;
&lt;br /&gt;
0 = What's Linux&lt;br /&gt;
&lt;br /&gt;
5 = Used it in OS&lt;br /&gt;
&lt;br /&gt;
10 = Written Drivers&lt;br /&gt;
! Open Source Experience&lt;br /&gt;
|-&lt;br /&gt;
| Mark A. Yoder&lt;br /&gt;
| ECE&lt;br /&gt;
| Faculty&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| 9&lt;br /&gt;
| Much&lt;br /&gt;
|-&lt;br /&gt;
| Matt Fuson&lt;br /&gt;
| ECE&lt;br /&gt;
| Junior&lt;br /&gt;
| No&lt;br /&gt;
| Yes (ECE230,ECE333)&lt;br /&gt;
| 4&lt;br /&gt;
| Program Arduino in spare time. &lt;br /&gt;
|-&lt;br /&gt;
| Tom Atnip&lt;br /&gt;
| CS/SE&lt;br /&gt;
| Junior (Current)&lt;br /&gt;
| Yes (CSSE332)&lt;br /&gt;
| Yes (CSSE232)&lt;br /&gt;
| 7&lt;br /&gt;
| Open Source Project W/ Last Internship  &lt;br /&gt;
|-&lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|    &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Atniptw</name></author>	</entry>

	</feed>