<?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=Lobdeljt&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=Lobdeljt&amp;feedformat=atom"/>
		<link rel="alternate" type="text/html" href="http://elinux.org/Special:Contributions/Lobdeljt"/>
		<updated>2013-05-24T03:00:10Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.21alpha</generator>

	<entry>
		<id>http://elinux.org/EBC_Exercise_22_Cross-Compiling_and_Finding_the_Right_Kernel_-_bitbake</id>
		<title>EBC Exercise 22 Cross-Compiling and Finding the Right Kernel - bitbake</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/EBC_Exercise_22_Cross-Compiling_and_Finding_the_Right_Kernel_-_bitbake"/>
				<updated>2012-11-14T07:10:57Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* meta-angstrom */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category: BeagleBoard]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
This class is about developing software for embedded Linux. So far we have been doing all of our development on the Beagle. This works well for small (and not so small) programs. However, we are now moving into kernel development and that's best done on a more powerful host computer. In [[EBC Exercise 08 Installing Development Tools]] you learned how to download and install the cross-compilers and the source for kernel and u-boot. Now we'll use those tools.&lt;br /&gt;
&lt;br /&gt;
First we'll check everything by compiling the Hello World program, then we'll try the kernel and u-boot.&lt;br /&gt;
&lt;br /&gt;
== Stop Here, the rest hasn't been updated ==&lt;br /&gt;
&lt;br /&gt;
== Cross-compiling Hello World ==&lt;br /&gt;
&lt;br /&gt;
This shows how to setup the paths to use the compiler loaded by bitbake.&lt;br /&gt;
&lt;br /&gt;
Listing 2-4 on page 29 of the text is an embedded version of Hello World. If you've set up your git repository you will find it in '''helloWorld.c''' when you do a''' git pull'''.  Compile and run it on your host to be sure it works.&lt;br /&gt;
&lt;br /&gt;
 host$ '''gcc helloWorld.c'''&lt;br /&gt;
 host$ '''./a.out'''&lt;br /&gt;
 Hello, World! Main is executing at 0x400524&lt;br /&gt;
 This address (0x7fff8260bdf8) is in our stack frame&lt;br /&gt;
 This address (0x601038) is in our bss section&lt;br /&gt;
 This address (0x601020) is in our data section&lt;br /&gt;
&lt;br /&gt;
Now that you know it's working, let's cross compile it. First set the paths to find the cross-compilers. Put the following in a file, call it ~/.oe/'''crossCompileEnvBitbake.sh'''. Make sure the path is correct for your system. This is for a 32-bit linux. &lt;br /&gt;
&lt;br /&gt;
 # add cross tools to your path&lt;br /&gt;
 export ARM_TOOLCHAIN_PATH=~/BeagleBoard/oe/build/tmp-angstrom_v2012_05-eglibc/sysroots/i686-linux/usr/bin/armv7a-angstrom-linux-gnueabi&lt;br /&gt;
 PATH=$PATH:$ARM_TOOLCHAIN_PATH/..&lt;br /&gt;
 PATH=$ARM_TOOLCHAIN_PATH:$PATH  &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=arm-angstrom-linux-gnueabi-&lt;br /&gt;
&lt;br /&gt;
Here it is for 64-bit&lt;br /&gt;
&lt;br /&gt;
 # add cross tools to your path&lt;br /&gt;
 export ARM_TOOLCHAIN_PATH=~/BeagleBoard/oe/build/tmp-angstrom_v2012_05-eglibc/sysroots/x86_64-linux/usr/bin/armv7a-angstrom-linux-gnueabi&lt;br /&gt;
 PATH=$PATH:$ARM_TOOLCHAIN_PATH/..&lt;br /&gt;
 PATH=$ARM_TOOLCHAIN_PATH:$PATH  &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=arm-angstrom-linux-gnueabi-&lt;br /&gt;
&lt;br /&gt;
Now ''source'' the file and compile again. (Note: you only have to source once per terminal session.)&lt;br /&gt;
 host$ '''source ~/.oe/crossCompileEnvBitbake.sh'''&lt;br /&gt;
 host$ '''${CROSS_COMPILE}gcc helloWorld.c'''&lt;br /&gt;
 host$ '''file a.out'''&lt;br /&gt;
 a.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped&lt;br /&gt;
&lt;br /&gt;
The '''file''' command tells what's in the file.  In this case we have an ARM executable.  Success!  Now copy to your Beagle and run&lt;br /&gt;
&lt;br /&gt;
 host$ '''scp a.out root@beagle:.'''&lt;br /&gt;
 host$ '''ssh root@beagle ./a.out'''&lt;br /&gt;
 Hello, World! Main is executing at 0x8374&lt;br /&gt;
 This address (0xbeb32d4c) is in our stack frame&lt;br /&gt;
 This address (0x10650) is in our bss section&lt;br /&gt;
 This address (0x10648) is in our data section&lt;br /&gt;
&lt;br /&gt;
The '''scp''' copies a.out to the beagle and the '''ssh''' runs the a.out on the beagle. Notice the address are very different from the host version.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;br /&gt;
&lt;br /&gt;
== Finding the Kernel and Installing It ==&lt;br /&gt;
&lt;br /&gt;
After doing [[EBC Exercise 08 Installing Development Tools - bitbake]] you have a Beagle kernel on your host computer. Let's see if it works.&lt;br /&gt;
&lt;br /&gt;
Once compiled the kernel is put in a file called '''uImage'''.  You may have seen it in the FAT partition on your SD card.  Let's find it on your host. One way to find it is&lt;br /&gt;
&lt;br /&gt;
 host$ '''cd ~/BeagleBoard/oe'''&lt;br /&gt;
 host$ '''find . -name uImage'''&lt;br /&gt;
 ./build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/linux-mainline-3.2.18-r121b/git/arch/arm/boot/uImage&lt;br /&gt;
 ./build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/linux-mainline-3.2.18-r121b/sysroot-destdir/kernel/uImage&lt;br /&gt;
 ./build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/linux-mainline-3.2.18-r121b/image/kernel/uImage&lt;br /&gt;
 ./build/tmp-angstrom_v2012_05-eglibc/sysroots/beagleboard/kernel/uImage&lt;br /&gt;
&lt;br /&gt;
It looks like I've compile the 3.2.18 version of the kernel.  What version is the beagle running?&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''uname -a'''&lt;br /&gt;
 Linux yoder-bone 3.2.25 #1 Fri Aug 10 10:33:12 CEST 2012 armv7l GNU/Linux&lt;br /&gt;
&lt;br /&gt;
The bone is running 3.2.25.  Here's how to get our sources to match those used to compile the 3.2.25 kernel.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cat /etc/angstrom-build-info''' &lt;br /&gt;
 Configured Openembedded layers:&lt;br /&gt;
 meta-angstrom     = angstrom-v2012.05-yocto1.2:a029f5f5d19f788e2ab17227f35350ff5b6ca125&lt;br /&gt;
 meta-oe           &lt;br /&gt;
 toolchain-layer   &lt;br /&gt;
 meta-efl          &lt;br /&gt;
 meta-gpe          &lt;br /&gt;
 meta-gnome        &lt;br /&gt;
 meta-xfce         &lt;br /&gt;
 meta-initramfs    &lt;br /&gt;
 meta-multimedia   = denzil:b4488f4c012a64604b28bd2b6e93de411c34466d&lt;br /&gt;
 meta-opie         = master:efa3892b20a4ef80274e56e5633ebd62c16f9731&lt;br /&gt;
 meta-java         = master:3386ea6c96096f107f43f282f654e5afa456109e&lt;br /&gt;
 meta-browser      = master:c47f59df2e723495679c751cbdf6a8c6adec4b6a&lt;br /&gt;
 meta-mono         = master:83f8233b0498aadb18bf7605c3ba6c71d9e13a3a&lt;br /&gt;
 meta-kde          = master:5b0882d951cfd71886d423c190faaa7c7f932333&lt;br /&gt;
 meta-ti           = angstrom-staging:5364d0795bb27c2deb5a4e2df7d2f01ffb394cca&lt;br /&gt;
 meta-efikamx      = master:2c09a3a780b23448e8a6ca964256ff7f5ccba65d&lt;br /&gt;
 meta-nslu2        = master:3d9fc951b05b4df476374b6fc3085ebac7f293ee&lt;br /&gt;
 meta-htc          &lt;br /&gt;
 meta-nokia        &lt;br /&gt;
 meta-openmoko     &lt;br /&gt;
 meta-palm         = master:2b106be01228f64298d6cb338f93088806594344&lt;br /&gt;
 meta-handheld     = master:1f05a15aceb4c3a19fa070463b58125b5658b2a9&lt;br /&gt;
 meta-raspberrypi  = denzil:34eef2ea4f5f24630dbb73b386861430167b8431&lt;br /&gt;
 meta-intel        &lt;br /&gt;
 meta-sugarbay     &lt;br /&gt;
 meta-crownbay     &lt;br /&gt;
 meta-emenlow      &lt;br /&gt;
 meta-fishriver    &lt;br /&gt;
 meta-fri2         &lt;br /&gt;
 meta-jasperforest &lt;br /&gt;
 meta-n450         = master:f75f9b6f68473eb0efac802409608f8389be0030&lt;br /&gt;
 meta              = denzil:b052427a6678b1b696f8c64cf0fdc55e6af86c48&lt;br /&gt;
&lt;br /&gt;
This file shows the various repositories that were used to compile the kernel (and the root file system) for the given SD image (the bone A6A image in my case). Yes, the kernel comes from several git repositories.  How many?  &lt;br /&gt;
 host$ '''cd ~/BeagleBoard/oe'''&lt;br /&gt;
 host$ '''find . -name .git'''&lt;br /&gt;
 ./.git&lt;br /&gt;
 ./build/tmp-angstrom_v2012_05-eglibc/buildhistory/.git&lt;br /&gt;
 ./build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/u-boot-2011.12-r8/git/.git&lt;br /&gt;
 ./build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/linux-mainline-3.2.18-r121b/git/.git&lt;br /&gt;
 ./build/tmp-angstrom_v2012_05-eglibc/work/armv7a-angstrom-linux-gnueabi/mtd-utils-1.4.9-r1/git/.git&lt;br /&gt;
 ./sources/meta-xilinx/.git&lt;br /&gt;
 ./sources/meta-intel/.git&lt;br /&gt;
 ./sources/bitbake/.git&lt;br /&gt;
 ./sources/meta-efikamx/.git&lt;br /&gt;
 ./sources/meta-angstrom/.git&lt;br /&gt;
 ./sources/openembedded-core/.git&lt;br /&gt;
 ./sources/meta-handheld/.git&lt;br /&gt;
 ./sources/meta-kde/.git&lt;br /&gt;
 ./sources/meta-nslu2/.git&lt;br /&gt;
 ./sources/meta-openembedded/.git&lt;br /&gt;
 ./sources/meta-raspberrypi/.git&lt;br /&gt;
 ./sources/meta-mono/.git&lt;br /&gt;
 ./sources/meta-java/.git&lt;br /&gt;
 ./sources/meta-ti/.git&lt;br /&gt;
 ./sources/meta-ettus/.git&lt;br /&gt;
 ./sources/meta-openpandora/.git&lt;br /&gt;
 ./sources/meta-smartphone/.git&lt;br /&gt;
 ./sources/meta-opie/.git&lt;br /&gt;
 ./sources/meta-browser/.git&lt;br /&gt;
&lt;br /&gt;
The first '''.git''' is the repository you cloned to do the initial bitbake. The next is the u-boot repository. The next one is the kernel's repository. We'll be using that repository so much you should set up a symbolic link to it so you can find it easily.&lt;br /&gt;
&lt;br /&gt;
 host$ '''ln -s ~/BeagleBoard/oe/build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/linux-mainline-3.2.18-r121b/git/ ~/...'''&lt;br /&gt;
&lt;br /&gt;
Notice several '''.git'''s are in the '''sources''' directory. Note they have many names in common with the contents of '''/etc/angstrom-build-info'''.  These are the repositories where we need to checkout the commits that correspond to the tags above.  Here's how, take the first repository with a tag and '''cd''' to it.&lt;br /&gt;
&lt;br /&gt;
=== meta-angstrom ===&lt;br /&gt;
&lt;br /&gt;
 host$ '''cd sources/meta-angstrom/'''&lt;br /&gt;
 /home/beagle/BeagleBoard/oe/sources/meta-angstrom&lt;br /&gt;
 host$ '''git status'''&lt;br /&gt;
 # On branch angstrom-v2012.05-yocto1.2&lt;br /&gt;
 nothing to commit (working directory clean)&lt;br /&gt;
 host$ '''git remote update'''&lt;br /&gt;
 Fetching origin&lt;br /&gt;
 remote: Counting objects: 132, done.&lt;br /&gt;
 remote: Compressing objects: 100% (57/57), done.&lt;br /&gt;
 remote: Total 105 (delta 53), reused 96 (delta 45)&lt;br /&gt;
 Receiving objects: 100% (105/105), 16.95 KiB, done.&lt;br /&gt;
 Resolving deltas: 100% (53/53), completed with 18 local objects.&lt;br /&gt;
 From git://github.com/Angstrom-distribution/meta-angstrom&lt;br /&gt;
    140671a..784d76b  master     -&amp;gt; origin/master&lt;br /&gt;
&lt;br /&gt;
Now checkout the corresponding tag&lt;br /&gt;
 host$ '''git checkout a029f5f5d19f788e2ab17227f35350ff5b6ca125'''&lt;br /&gt;
 Note: checking out 'a029f5f5d19f788e2ab17227f35350ff5b6ca125'.&lt;br /&gt;
 &lt;br /&gt;
 You are in 'detached HEAD' state. You can look around, make experimental&lt;br /&gt;
 changes and commit them, and you can discard any commits you make in this&lt;br /&gt;
 state without impacting any branches by performing another checkout.&lt;br /&gt;
 &lt;br /&gt;
 If you want to create a new branch to retain commits you create, you may&lt;br /&gt;
 do so (now or later) by using -b with the checkout command again. Example:&lt;br /&gt;
 &lt;br /&gt;
   git checkout -b new_branch_name&lt;br /&gt;
 &lt;br /&gt;
 HEAD is now at a029f5f... base-files bbappend: move /var/run handling to systemd proper&lt;br /&gt;
 host$ '''git status'''&lt;br /&gt;
 # Not currently on any branch.&lt;br /&gt;
 nothing to commit (working directory clean)&lt;br /&gt;
&lt;br /&gt;
Don't worry that your HEAD is detached.  That just means you're not on a branch.  However it is the commit that was used to create the kernel we want.&lt;br /&gt;
&lt;br /&gt;
=== meta-opie ===&lt;br /&gt;
&lt;br /&gt;
Now, repeat this for each of the hash tags in '''/etc/angstrom-build-info'''.  I'll get you started, you finish it.&lt;br /&gt;
&lt;br /&gt;
 host$ '''cd ../meta-opie'''&lt;br /&gt;
 /home/beagle/BeagleBoard/oe/sources/meta-opie&lt;br /&gt;
 host$ '''git remote update'''&lt;br /&gt;
 Fetching origin&lt;br /&gt;
 host$ '''git checkout efa3892b20a4ef80274e56e5633ebd62c16f9731'''&lt;br /&gt;
 HEAD is now at efa3892... opie-packagemanager: fix a couple more quoting issues&lt;br /&gt;
&lt;br /&gt;
=== and so on... ===&lt;br /&gt;
Keep going until you get an error.&lt;br /&gt;
&lt;br /&gt;
=== meta-ti ===&lt;br /&gt;
This repository pulls from more than one place so the checkout will fail.  Here's what to do.&lt;br /&gt;
 host$ '''cd ../meta-ti'''&lt;br /&gt;
 host$ '''git remote update'''&lt;br /&gt;
 host$ '''git checkout 5364d0795bb27c2deb5a4e2df7d2f01ffb394cca'''&lt;br /&gt;
 fatal: reference is not a tree: 5364d0795bb27c2deb5a4e2df7d2f01ffb394cca&lt;br /&gt;
&lt;br /&gt;
So what repository has the tag '''5364d0795bb27c2deb5a4e2df7d2f01ffb394cca'''?  Try google. With a bit of googling, I was able to find https://github.com/Angstrom-distribution/meta-ti/commit/5364d0795bb27c2deb5a4e2df7d2f01ffb394cca.  Add this to the remote repositories.&lt;br /&gt;
 host$ '''git remote add test https://github.com/Angstrom-distribution/meta-ti'''&lt;br /&gt;
 host$ '''git remote update'''&lt;br /&gt;
 host$ '''git checkout 5364d0795bb27c2deb5a4e2df7d2f01ffb394cca'''&lt;br /&gt;
&lt;br /&gt;
Now continue on with the rest of the repositories.&lt;br /&gt;
&lt;br /&gt;
=== Once all the repositories are all up to date ===&lt;br /&gt;
&lt;br /&gt;
Now it's time to bitbake again and the 3.2.25 kernel should appear.&lt;br /&gt;
&lt;br /&gt;
 host$ '''cd ~/BeagleBoard/oe'''&lt;br /&gt;
 host$ '''source ~/.oe/environment-angstromv2012.05'''&lt;br /&gt;
 host$ '''time bitbake virtual/kernel'''&lt;br /&gt;
&lt;br /&gt;
== Finding the Kernel for the ETC 2012 image ==&lt;br /&gt;
We are looking for uImage, but we only want the 2.6.32 version.  The last grep file the file in the '''boot''' directory. Several lines are printed, but the one I'm interested in is:&lt;br /&gt;
 ''./build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/linux-omap-psp-2.6.32-r110b+gitr5fc29e7b2a76a64a739f857858ef0b98294aa155/git''/arch/arm/boot/uImage&lt;br /&gt;
&lt;br /&gt;
The first part of the path (in italics) is the path to the kernel.  Check it out.&lt;br /&gt;
&lt;br /&gt;
 host$ '''cd build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/linux-omap-psp-2.6.32-r110b+gitr5fc29e7b2a76a64a739f857858ef0b98294aa155/git'''&lt;br /&gt;
 host$ '''ls -F'''&lt;br /&gt;
 arch/           drivers/   Kbuild       modules.order   samples/    usr/&lt;br /&gt;
 block/          firmware/  kernel/      Module.symvers  scripts/    virt/&lt;br /&gt;
 COPYING         fs/        lib/         net/            security/   vmlinux*&lt;br /&gt;
 CREDITS         include/   MAINTAINERS  patches/        sound/      vmlinux.o&lt;br /&gt;
 crypto/         init/      Makefile     README          System.map&lt;br /&gt;
 Documentation/  ipc/       mm/          REPORTING-BUGS  tools/&lt;br /&gt;
&lt;br /&gt;
We'll be learning what's in many of these over the next couple of weeks.  Remember this location.  Let's find uImage.&lt;br /&gt;
&lt;br /&gt;
 host$ '''cd arch/arm/boot; ls -shF'''&lt;br /&gt;
 total 13M&lt;br /&gt;
 4.0K bootp/       6.3M Image*      4.0K Makefile  3.0M zImage*&lt;br /&gt;
 4.0K compressed/  4.0K install.sh  3.0M uImage&lt;br /&gt;
 host$ '''ls -l uImage'''&lt;br /&gt;
 -rw-r--r-- 1 beagle beagle 3144300 2011-12-08 01:02 uImage&lt;br /&gt;
&lt;br /&gt;
It should have the date that you did the bitbake.  Let's see if it runs on the Beagle&lt;br /&gt;
 host$ '''scp uImage root@beagle:.'''&lt;br /&gt;
 host$ '''ssh root@beagle'''&lt;br /&gt;
 beagle$ '''cd /boot; ls -F'''&lt;br /&gt;
 total 18M&lt;br /&gt;
 4.0K MLO@&lt;br /&gt;
 372K Module.symvers-2.6.32&lt;br /&gt;
 1.4M System.map-2.6.32&lt;br /&gt;
  80K config-2.6.32&lt;br /&gt;
 4.0K u-boot.bin@&lt;br /&gt;
    0 uImage@&lt;br /&gt;
 3.1M uImage-2.6.32&lt;br /&gt;
 8.9M vmlinux-2.6.32&lt;br /&gt;
 beagle$ '''ls -l uImage'''&lt;br /&gt;
 lrwxrwxrwx 1 www-data www-data 13 May 12  2011 uImage -&amp;gt; uImage-2.6.32&lt;br /&gt;
&lt;br /&gt;
So the uImage that is there is a symbolic link to '''uImage-2.6.32'''.  Let's save the working uImage in a difference file and copy our new uImage in.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''mv uImage-2.6.32 uImage-2.6.32.orig'''&lt;br /&gt;
 beagle$ '''mv ~/uImage uImage-2.6.32'''&lt;br /&gt;
&lt;br /&gt;
And then reboot.&lt;br /&gt;
 beagle$ '''shutdown -r now'''&lt;br /&gt;
&lt;br /&gt;
After a couple of minutes your should be back and running again.  Check and see if you are really running the new kernel.&lt;br /&gt;
 beagle$ '''uname -a'''&lt;br /&gt;
 Linux beagleboard 2.6.32 #3 PREEMPT Thu Dec 8 01:02:13 EST 2011 armv7l GNU/Linux&lt;br /&gt;
&lt;br /&gt;
It worked! That's the date I compiled mine on.&lt;br /&gt;
&lt;br /&gt;
=== Failed Kernel ===&lt;br /&gt;
Here's what I get when trying to run the 3.2.18 kernel on the A6A bone image.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
reading u-boot.img&lt;br /&gt;
reading u-boot.img&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
U-Boot 2011.09-00053-gb423c52 (Aug 10 2012 - 11:26:55)&lt;br /&gt;
&lt;br /&gt;
I2C:   ready&lt;br /&gt;
DRAM:  256 MiB&lt;br /&gt;
WARNING: Caches not enabled&lt;br /&gt;
No daughter card present&lt;br /&gt;
NAND:  HW ECC Hamming Code selected&lt;br /&gt;
No NAND device found!!!&lt;br /&gt;
0 MiB&lt;br /&gt;
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1&lt;br /&gt;
*** Warning - readenv() failed, using default environment&lt;br /&gt;
&lt;br /&gt;
Net:   cpsw&lt;br /&gt;
Hit any key to stop autoboot:  0 &lt;br /&gt;
SD/MMC found on device 0&lt;br /&gt;
reading uEnv.txt&lt;br /&gt;
&lt;br /&gt;
27 bytes read&lt;br /&gt;
Loaded environment from uEnv.txt&lt;br /&gt;
Importing environment from mmc ...&lt;br /&gt;
Loading file &amp;quot;/boot/uImage&amp;quot; from mmc device 0:2 xxa2&lt;br /&gt;
4385656 bytes read&lt;br /&gt;
## Booting kernel from Legacy Image at 80007fc0 ...&lt;br /&gt;
   Image Name:   Linux-3.2.18&lt;br /&gt;
   Image Type:   ARM Linux Kernel Image (uncompressed)&lt;br /&gt;
   Data Size:    4385592 Bytes = 4.2 MiB&lt;br /&gt;
   Load Address: 80008000&lt;br /&gt;
   Entry Point:  80008000&lt;br /&gt;
   Verifying Checksum ... OK&lt;br /&gt;
   XIP Kernel Image ... OK&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
Starting kernel ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing a New U-boot ==&lt;br /&gt;
&lt;br /&gt;
While we're at it, let's install a new U-boot.  Note:  The new U-boot runs for me, but doesn't boot the kernel, yet.&lt;br /&gt;
&lt;br /&gt;
 host$ '''cd ~/BeagleBoard/oe/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/'''&lt;br /&gt;
 host$ '''ls -F'''&lt;br /&gt;
 linux-3.0.9-r110a/&lt;br /&gt;
 linux-omap-psp-2.6.32-r110b+gitr5fc29e7b2a76a64a739f857858ef0b98294aa155/&lt;br /&gt;
 shadow-4.1.4.3-r5/&lt;br /&gt;
 u-boot-2011.09-r4/&lt;br /&gt;
&lt;br /&gt;
There's the U-boot directory.&lt;br /&gt;
&lt;br /&gt;
 host$ cd u-boot-2011.09-r4/git/; ls -F&lt;br /&gt;
 api/        COPYING    fs/          mkconfig*     post/            tools/&lt;br /&gt;
 arch/       CREDITS    include/     mmc_spl/      README           u-boot*&lt;br /&gt;
 board/      disk/      lib/         nand_spl/     rules.mk         '''u-boot.bin'''&lt;br /&gt;
 boards.cfg  doc/       MAINTAINERS  net/          snapshot.commit  u-boot.lds&lt;br /&gt;
 common/     drivers/   MAKEALL*     onenand_ipl/  spl/             u-boot.map&lt;br /&gt;
 config.mk   examples/  Makefile     patches/      System.map       u-boot.srec&lt;br /&gt;
&lt;br /&gt;
The file we want is right on the top level.&lt;br /&gt;
&lt;br /&gt;
 host$ '''scp u-boot.bin root@beagle:.'''&lt;br /&gt;
 host$ '''ssh -X root@beagle'''&lt;br /&gt;
 beagle$ '''cd /media/mmcblk0p1/; ls -F'''&lt;br /&gt;
 MLO*         u-boot.bin.broken*  uEnv.txt*&lt;br /&gt;
 U-BOOT.BIN*  UIMAGE*             uEnv/&lt;br /&gt;
&lt;br /&gt;
Be sure you are logged into the Beagle via the serial port, rather than using ssh. Otherwise you won't see the boot sequence that appears before the kernel is running.&lt;br /&gt;
&lt;br /&gt;
Here we've changed to the FAT partition which is where u-boot lives.  Back it up and install the new one.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''mv U-BOOT-BIN u-boot-bin.orig'''&lt;br /&gt;
 beagle$ '''mv ~/.u-boot-bin .'''&lt;br /&gt;
 beagle$ '''shutdown -r now'''&lt;br /&gt;
&lt;br /&gt;
You should now see the new u-boot running if you are logged in via the serial port.&lt;br /&gt;
&lt;br /&gt;
== Compile via make ==&lt;br /&gt;
&lt;br /&gt;
When you use bitbake it sets up all the paths to use the correct cross compilers.  You can also build the kernel or u-boot by using '''make''' if you set the paths like we did above.  &lt;br /&gt;
&lt;br /&gt;
If you haven't already, ''source'' the file and ''cd'' to the kernel directory and try a ''make''.&lt;br /&gt;
&lt;br /&gt;
 host$ '''source ~/.oe/crossCompileEnv.sh'''&lt;br /&gt;
 host$ '''cd ~/BeagleBoard/oe/build/tmp-angstrom_2010_x-eglibc/work/beagleboard-angstrom-linux-gnueabi/linux-omap-psp-2.6.32-r110b+gitr5fc29e7b2a76a64a739f857858ef0b98294aa155/git'''&lt;br /&gt;
 host$ '''make xconfig'''&lt;br /&gt;
&lt;br /&gt;
([[EBC Exercise 13 Configuring the Kernel]] has details on configuring the kernel.)&lt;br /&gt;
&lt;br /&gt;
To make the kernel run&lt;br /&gt;
&lt;br /&gt;
 host$ '''make uImage'''&lt;br /&gt;
&lt;br /&gt;
Now, follow the instructions above to install your freshly compiled kernel.&lt;br /&gt;
&lt;br /&gt;
== Getting the A6A Kernel ==&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cat /etc/angstrom-build-info''' &lt;br /&gt;
 Configured Openembedded layers:&lt;br /&gt;
 meta-angstrom     = angstrom-v2012.05-yocto1.2:a029f5f5d19f788e2ab17227f35350ff5b6ca125&lt;br /&gt;
 meta-oe           &lt;br /&gt;
 toolchain-layer   &lt;br /&gt;
 meta-efl          &lt;br /&gt;
 meta-gpe          &lt;br /&gt;
 meta-gnome        &lt;br /&gt;
 meta-xfce         &lt;br /&gt;
 meta-initramfs    &lt;br /&gt;
 meta-multimedia   = denzil:b4488f4c012a64604b28bd2b6e93de411c34466d&lt;br /&gt;
 meta-opie         = master:efa3892b20a4ef80274e56e5633ebd62c16f9731&lt;br /&gt;
 meta-java         = master:3386ea6c96096f107f43f282f654e5afa456109e&lt;br /&gt;
 meta-browser      = master:c47f59df2e723495679c751cbdf6a8c6adec4b6a&lt;br /&gt;
 meta-mono         = master:83f8233b0498aadb18bf7605c3ba6c71d9e13a3a&lt;br /&gt;
 meta-kde          = master:5b0882d951cfd71886d423c190faaa7c7f932333&lt;br /&gt;
 meta-ti           = angstrom-staging:5364d0795bb27c2deb5a4e2df7d2f01ffb394cca&lt;br /&gt;
 meta-efikamx      = master:2c09a3a780b23448e8a6ca964256ff7f5ccba65d&lt;br /&gt;
 meta-nslu2        = master:3d9fc951b05b4df476374b6fc3085ebac7f293ee&lt;br /&gt;
 meta-htc          &lt;br /&gt;
 meta-nokia        &lt;br /&gt;
 meta-openmoko     &lt;br /&gt;
 meta-palm         = master:2b106be01228f64298d6cb338f93088806594344&lt;br /&gt;
 meta-handheld     = master:1f05a15aceb4c3a19fa070463b58125b5658b2a9&lt;br /&gt;
 meta-raspberrypi  = denzil:34eef2ea4f5f24630dbb73b386861430167b8431&lt;br /&gt;
 meta-intel        &lt;br /&gt;
 meta-sugarbay     &lt;br /&gt;
 meta-crownbay     &lt;br /&gt;
 meta-emenlow      &lt;br /&gt;
 meta-fishriver    &lt;br /&gt;
 meta-fri2         &lt;br /&gt;
 meta-jasperforest &lt;br /&gt;
 meta-n450         = master:f75f9b6f68473eb0efac802409608f8389be0030&lt;br /&gt;
 meta              = denzil:b052427a6678b1b696f8c64cf0fdc55e6af86c48 &lt;br /&gt;
&lt;br /&gt;
 host$ '''cd BeagleBoard/oe/sources/meta-ti'''&lt;br /&gt;
 host$ '''git checkout master'''&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T06:58:59Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Future Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdell]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the browser's VLC Plugin. We have tested this with 4 webcams on the xM board.&lt;br /&gt;
&lt;br /&gt;
Operating with four webcams hooked to the board causes many failures of the system to stream back the video information. We determined that this was due to the physical cameras and the overhead of the devices by testing the system with only two we cams where the issues experienced regularly with the four camera setup greatly reduced in frequency.&lt;br /&gt;
&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort largely due to the infancy of HTML5 Related standards(sockets.io and MediaStream). In the end we decided to utilize the vlc plugin when the HTML5 proved unfeasible at its current level of development. Implementing the four cameras did seem to cause some device issues that caused the webpage to not sync with the incoming feed, but this appears to be hardware related only and not from the implementation (a further explanation is later on).&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ mkdir WebcamFeed&lt;br /&gt;
xm$ git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed&lt;br /&gt;
xm$ cd WebcamFeed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install nodejs&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install gstreamer&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following to get the xM's IP address. It is needed quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ ifconfig&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ cd ./WebcamFeeds/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current code does not automatically direct the VLC plugin to play from the correct IP address; it relies instead on passing a hard-coded IP address to the client in the WebcamFeed.html file. Modify the following code in the file to use your xM's IP address:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;embed&lt;br /&gt;
         type=&amp;quot;application/x-vlc-plugin&amp;quot;&lt;br /&gt;
         name=&amp;quot;videoplayer&amp;quot;&lt;br /&gt;
         autoplay=&amp;quot;yes&amp;quot; loop=&amp;quot;no&amp;quot; hidden=&amp;quot;no&amp;quot;&lt;br /&gt;
         width=&amp;quot;320&amp;quot; height=&amp;quot;240&amp;quot;&lt;br /&gt;
         target=&amp;quot;tcp://[YOUR_BEAGLE_IP]:8080&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the installation is done, the program is ready. Run it using:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ node WebcamFeed.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are four buttons for convenience. These function identically as entering the number's 0 though 3 into the text box and clicking Set Cam for each number.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
This program implements node.js and GStreamer working together to accomplish the video output and control over which video device to be viewed.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used. We only access one webcam at any given time and so the only increasing overhead on the system is that which is associated with the individual USB webcam's. &lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation]. A picture of the test setup is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebFeed_demo_setup.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
This video starts out very slow and illustrates some of the hardware related issues that were encountered. While the most effective implementation currently is the two camera version we wished to show that four camera feeds could be accessed on the xM.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
The project uses [http://gstreamer.freedesktop.org/ GStreamer] to capture video from a webcam, convert it to video/ogg format, and stream it through Transmission Control Protocol (TCP). A diagram of the GStreamer pipeline is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Gstreamer_pipeline.png|400px|Web Cam Feed - GStreamer Pipeline]]&lt;br /&gt;
&lt;br /&gt;
The client system connects to a node.js server running on the xM. The server embeds the video stream into the web page and also contains controls for selecting a webcam for the stream.&lt;br /&gt;
&lt;br /&gt;
When the server begins running the node.js script, it launches the GStreamer pipeline discussed above. When the client connects, they receive a web page containing controls for the video source and the embedded video that gets played using the [http://www.videolan.org/vlc/index.html VLC] web plugin.&lt;br /&gt;
&lt;br /&gt;
When the client uses the controls to change the video source, the server kills the current GStreamer process and launches a new one using the new video source. It then makes the client's page refresh to make the embedded video player use the new stream.&lt;br /&gt;
&lt;br /&gt;
A block diagram of the system is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Block_Diagram.png|400px|Web Cam Feed Block Diagram]]&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdell investigated using GStreamer to accomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdell used his research to get GStreamer to stream a video or camera input onto port 8080 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an HTML document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was identified by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the VLC viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allowed for a simplified approach to running the needed utilities without having to port code into the Javascript language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the xM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the VLC plugin.&lt;br /&gt;
&lt;br /&gt;
Solving the interesting problem with the random stream failure. This issue arises when switching between streams. Occasionally the video receiver does not receive the stream even though the stream is playing across the network. From experimentation we found that as cameras were added the performance of the entire program greatly decreased. Since we only access one camera at a time the only explanation we could find was that the OS was devoting resources to the devices when they were connected thus creating a much greater overhead as cameras were added. When the cameras were disconnected the performance returned to their previous levels. With four cameras operating a noticeable increase in stream failures was observed. With only two cameras operating about 1/5 of attempts would be unsuccessful. With four cameras the failure rate was significantly higher (as much as 1/3 of attempts would fail). One possible explanation of this is the overhead causing a slow down in setup time for the video out thread compared to the load up time of the browser. While this is set up to go first if the system hanged due to lack of resources this could cause the video stream to start after the HTML file stopped looking for it. Occasionally the camera just won't turn on. We have found that signaling it again usually fixes the problem without much effort. After trying to figure out what was causing the problem we could not definitively pin down the root cause of the problem and we found no simple or effective solution for it but would like to see it fixed.&lt;br /&gt;
&lt;br /&gt;
The server should automatically detect its external IP and then use it to direct the client's VLC plugin to the video stream.&lt;br /&gt;
&lt;br /&gt;
The video should stream through UDP rather than TCP. UDP would have better performance, and data loss is not a major concern for low-resolution video.&lt;br /&gt;
&lt;br /&gt;
Audio can be added to the video stream.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T06:50:17Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* User Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdell]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the browser's VLC Plugin. We have tested this with 4 webcams on the xM board.&lt;br /&gt;
&lt;br /&gt;
Operating with four webcams hooked to the board causes many failures of the system to stream back the video information. We determined that this was due to the physical cameras and the overhead of the devices by testing the system with only two we cams where the issues experienced regularly with the four camera setup greatly reduced in frequency.&lt;br /&gt;
&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort largely due to the infancy of HTML5 Related standards(sockets.io and MediaStream). In the end we decided to utilize the vlc plugin when the HTML5 proved unfeasible at its current level of development. Implementing the four cameras did seem to cause some device issues that caused the webpage to not sync with the incoming feed, but this appears to be hardware related only and not from the implementation (a further explanation is later on).&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ mkdir WebcamFeed&lt;br /&gt;
xm$ git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed&lt;br /&gt;
xm$ cd WebcamFeed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install nodejs&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install gstreamer&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following to get the xM's IP address. It is needed quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ ifconfig&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ cd ./WebcamFeeds/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The current code does not automatically direct the VLC plugin to play from the correct IP address; it relies instead on passing a hard-coded IP address to the client in the WebcamFeed.html file. Modify the following code in the file to use your xM's IP address:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;embed&lt;br /&gt;
         type=&amp;quot;application/x-vlc-plugin&amp;quot;&lt;br /&gt;
         name=&amp;quot;videoplayer&amp;quot;&lt;br /&gt;
         autoplay=&amp;quot;yes&amp;quot; loop=&amp;quot;no&amp;quot; hidden=&amp;quot;no&amp;quot;&lt;br /&gt;
         width=&amp;quot;320&amp;quot; height=&amp;quot;240&amp;quot;&lt;br /&gt;
         target=&amp;quot;tcp://[YOUR_BEAGLE_IP]:8080&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the installation is done, the program is ready. Run it using:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ node WebcamFeed.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are four buttons for convenience. These function identically as entering the number's 0 though 3 into the text box and clicking Set Cam for each number.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
This program implements node.js and GStreamer working together to accomplish the video output and control over which video device to be viewed.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used. We only access one webcam at any given time and so the only increasing overhead on the system is that which is associated with the individual USB webcam's. &lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation]. A picture of the test setup is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebFeed_demo_setup.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
This video starts out very slow and illustrates some of the hardware related issues that were encountered. While the most effective implementation currently is the two camera version we wished to show that four camera feeds could be accessed on the xM.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
The project uses [http://gstreamer.freedesktop.org/ GStreamer] to capture video from a webcam, convert it to video/ogg format, and stream it through Transmission Control Protocol (TCP). A diagram of the GStreamer pipeline is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Gstreamer_pipeline.png|400px|Web Cam Feed - GStreamer Pipeline]]&lt;br /&gt;
&lt;br /&gt;
The client system connects to a node.js server running on the xM. The server embeds the video stream into the web page and also contains controls for selecting a webcam for the stream.&lt;br /&gt;
&lt;br /&gt;
When the server begins running the node.js script, it launches the GStreamer pipeline discussed above. When the client connects, they receive a web page containing controls for the video source and the embedded video that gets played using the [http://www.videolan.org/vlc/index.html VLC] web plugin.&lt;br /&gt;
&lt;br /&gt;
When the client uses the controls to change the video source, the server kills the current GStreamer process and launches a new one using the new video source. It then makes the client's page refresh to make the embedded video player use the new stream.&lt;br /&gt;
&lt;br /&gt;
A block diagram of the system is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Block_Diagram.png|400px|Web Cam Feed Block Diagram]]&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdell investigated using GStreamer to accomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdell used his research to get GStreamer to stream a video or camera input onto port 8080 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an HTML document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was identified by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the VLC viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allowed for a simplified approach to running the needed utilities without having to port code into the Javascript language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the XM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the vlc-plugin.&lt;br /&gt;
&lt;br /&gt;
Solving the interesting problem with the random stream failure. This issue arises when switching between streams. Occasionally the video receiver does not receive the stream even though the stream is playing across the network. From experimentation we found that as cameras were added the performance of the entire program greatly decreased. Since we only access one camera at a time the only explanation we could find was that the OS was devoting resources to the devices when they were connected thus creating a much greater overhead as cameras were added. When the cameras were disconnected the performance returned to their previous levels. With four cameras operating a noticeable increase in stream failures was observed. With only two cameras operating about 1/5 of attempts would be unsuccessful. With four cameras the failure rate was significantly higher (as much as 1/3 of attempts would fail). One possible explanation of this is the overhead causing a slow down in setup time for the video out thread compared to the load up time of the browser. While this is set up to go first if the system hanged due to lack of resources this could cause the video stream to start after the html file stopped looking for it. Occasionally the camera just won't turn on. We have found that signaling it again usually fixes the problem without much effort. After trying to figure out what was causing the problem we could not definitively pin down the root cause of the problem and we found no simple or effective solution for it but would like to see it fixed.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T06:44:58Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdell]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the browser's VLC Plugin. We have tested this with 4 webcams on the xM board.&lt;br /&gt;
&lt;br /&gt;
Operating with four webcams hooked to the board causes many failures of the system to stream back the video information. We determined that this was due to the physical cameras and the overhead of the devices by testing the system with only two we cams where the issues experienced regularly with the four camera setup greatly reduced in frequency.&lt;br /&gt;
&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort largely due to the infancy of HTML5 Related standards(sockets.io and MediaStream). In the end we decided to utilize the vlc plugin when the HTML5 proved unfeasible at its current level of development. Implementing the four cameras did seem to cause some device issues that caused the webpage to not sync with the incoming feed, but this appears to be hardware related only and not from the implementation (a further explanation is later on).&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ mkdir WebcamFeed&lt;br /&gt;
xm$ git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed&lt;br /&gt;
xm$ cd WebcamFeed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install nodejs&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install gstreamer&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following to get the xM's IP address. It is needed quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ ifconfig&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ cd ./WebcamFeeds/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the instillation is done the program can be ran&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ node WebcamFeed.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are four buttons for convenience. These function identically as entering the number's 0 though 3 into the text box and clicking Set Cam for each number.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
This program implements node.js and GStreamer working together to accomplish the video output and control over which video device to be viewed.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used. We only access one webcam at any given time and so the only increasing overhead on the system is that which is associated with the individual USB webcam's. &lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation]. A picture of the test setup is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebFeed_demo_setup.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
This video starts out very slow and illustrates some of the hardware related issues that were encountered. While the most effective implementation currently is the two camera version we wished to show that four camera feeds could be accessed on the xM.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
The project uses [http://gstreamer.freedesktop.org/ GStreamer] to capture video from a webcam, convert it to video/ogg format, and stream it through Transmission Control Protocol (TCP). A diagram of the GStreamer pipeline is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Gstreamer_pipeline.png|400px|Web Cam Feed - GStreamer Pipeline]]&lt;br /&gt;
&lt;br /&gt;
The client system connects to a node.js server running on the xM. The server embeds the video stream into the web page and also contains controls for selecting a webcam for the stream.&lt;br /&gt;
&lt;br /&gt;
When the server begins running the node.js script, it launches the GStreamer pipeline discussed above. When the client connects, they receive a web page containing controls for the video source and the embedded video that gets played using the [http://www.videolan.org/vlc/index.html VLC] web plugin.&lt;br /&gt;
&lt;br /&gt;
When the client uses the controls to change the video source, the server kills the current GStreamer process and launches a new one using the new video source. It then makes the client's page refresh to make the embedded video player use the new stream.&lt;br /&gt;
&lt;br /&gt;
A block diagram of the system is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Block_Diagram.png|400px|Web Cam Feed Block Diagram]]&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdell investigated using GStreamer to accomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdell used his research to get GStreamer to stream a video or camera input onto port 8080 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an HTML document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was identified by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the VLC viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allowed for a simplified approach to running the needed utilities without having to port code into the Javascript language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the XM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the vlc-plugin.&lt;br /&gt;
&lt;br /&gt;
Solving the interesting problem with the random stream failure. This issue arises when switching between streams. Occasionally the video receiver does not receive the stream even though the stream is playing across the network. From experimentation we found that as cameras were added the performance of the entire program greatly decreased. Since we only access one camera at a time the only explanation we could find was that the OS was devoting resources to the devices when they were connected thus creating a much greater overhead as cameras were added. When the cameras were disconnected the performance returned to their previous levels. With four cameras operating a noticeable increase in stream failures was observed. With only two cameras operating about 1/5 of attempts would be unsuccessful. With four cameras the failure rate was significantly higher (as much as 1/3 of attempts would fail). One possible explanation of this is the overhead causing a slow down in setup time for the video out thread compared to the load up time of the browser. While this is set up to go first if the system hanged due to lack of resources this could cause the video stream to start after the html file stopped looking for it. Occasionally the camera just won't turn on. We have found that signaling it again usually fixes the problem without much effort. After trying to figure out what was causing the problem we could not definitively pin down the root cause of the problem and we found no simple or effective solution for it but would like to see it fixed.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T06:26:58Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Highlights */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdell]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the browser's VLC Plugin. We have tested this with 4 webcams on the xM board.&lt;br /&gt;
&lt;br /&gt;
Operating with four webcams hooked to the board causes many failures of the system to stream back the video information. We determined that this was due to the physical cameras and the overhead of the devices by testing the system with only two we cams where the issues experienced regularly with the four camera setup greatly reduced in frequency.&lt;br /&gt;
&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort largely due to the infancy of HTML5 Related standards(sockets.io and MediaStream). In the end we decided to utilize the vlc plugin when the HTML5 proved unfeasible at its current level of development. Implementing the four cameras did seem to cause some device issues that caused the webpage to not sync with the incoming feed, but this appears to be hardware related only and not from the implementation (a further explanation is later on).&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ mkdir WebcamFeed&lt;br /&gt;
xm$ git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed&lt;br /&gt;
xm$ cd WebcamFeed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install nodejs&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install gstreamer&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following you will need it quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ ifconfig&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Take note of the IP Address as you will need to enter it in your user's web browser and to align to the video feed. (This is due to the address being in the client HTML file and not able to be easily informed of its source IP Address.)&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ cd ./WebcamFeeds/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the instillation is done the program can be ran&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ node WebcamFeed.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are four buttons for convenience. These function identically as entering the number's 0 though 3 into the text box and clicking Set Cam for each number.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
This program implements node.js and GStreamer working together to accomplish the video output and control over which video device to be viewed.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used. We only access one webcam at any given time and so the only increasing overhead on the system is that which is associated with the individual USB webcam's. &lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation]. A picture of the test setup is shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebFeed_demo_setup.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
This video starts out very slow and illustrates some of the hardware related issues that were encountered. While the most effective implementation currently is the two camera version we wished to show that four camera feeds could be accessed on the xM.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
The project uses [http://gstreamer.freedesktop.org/ GStreamer] to capture video from a webcam, convert it to video/ogg format, and stream it through Transmission Control Protocol (TCP). A diagram of the GStreamer pipeline is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Gstreamer_pipeline.png|400px|Web Cam Feed - GStreamer Pipeline]]&lt;br /&gt;
&lt;br /&gt;
The client system connects to a node.js server running on the xM. The server embeds the video stream into the web page and also contains controls for selecting a webcam for the stream.&lt;br /&gt;
&lt;br /&gt;
When the server begins running the node.js script, it launches the GStreamer pipeline discussed above. When the client connects, they receive a web page containing controls for the video source and the embedded video that gets played using the [http://www.videolan.org/vlc/index.html VLC] web plugin.&lt;br /&gt;
&lt;br /&gt;
When the client uses the controls to change the video source, the server kills the current GStreamer process and launches a new one using the new video source. It then makes the client's page refresh to make the embedded video player use the new stream.&lt;br /&gt;
&lt;br /&gt;
A block diagram of the system is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Block_Diagram.png|400px|Web Cam Feed Block Diagram]]&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdell investigated using GStreamer to accomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdell used his research to get GStreamer to stream a video or camera input onto port 8080 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an HTML document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was identified by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the VLC viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allowed for a simplified approach to running the needed utilities without having to port code into the Javascript language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the XM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the vlc-plugin.&lt;br /&gt;
&lt;br /&gt;
Solving the interesting problem with the random stream failure. This issue arises when switching between streams. Occasionally the video receiver does not receive the stream even though the stream is playing across the network. From experimentation we found that as cameras were added the performance of the entire program greatly decreased. Since we only access one camera at a time the only explanation we could find was that the OS was devoting resources to the devices when they were connected thus creating a much greater overhead as cameras were added. When the cameras were disconnected the performance returned to their previous levels. With four cameras operating a noticeable increase in stream failures was observed. With only two cameras operating about 1/5 of attempts would be unsuccessful. With four cameras the failure rate was significantly higher (as much as 1/3 of attempts would fail). One possible explanation of this is the overhead causing a slow down in setup time for the video out thread compared to the load up time of the browser. While this is set up to go first if the system hanged due to lack of resources this could cause the video stream to start after the html file stopped looking for it. Occasionally the camera just won't turn on. We have found that signaling it again usually fixes the problem without much effort. After trying to figure out what was causing the problem we could not definitively pin down the root cause of the problem and we found no simple or effective solution for it but would like to see it fixed.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/File:BbWebFeed_demo_setup.jpg</id>
		<title>File:BbWebFeed demo setup.jpg</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/File:BbWebFeed_demo_setup.jpg"/>
				<updated>2012-11-14T06:25:46Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: Setup for the video demo of the Beagle Board Web Video Feed project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Setup for the video demo of the Beagle Board Web Video Feed project&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T06:07:26Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Work Breakdown */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdell]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the browser's VLC Plugin. We have tested this with 4 webcams on the xM board.&lt;br /&gt;
&lt;br /&gt;
Operating with four webcams hooked to the board causes many failures of the system to stream back the video information. We determined that this was due to the physical cameras and the overhead of the devices by testing the system with only two we cams where the issues experienced regularly with the four camera setup greatly reduced in frequency.&lt;br /&gt;
&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort largely due to the infancy of HTML5 Related standards(sockets.io and MediaStream). In the end we decided to utilize the vlc plugin when the HTML5 proved unfeasible at its current level of development. Implementing the four cameras did seem to cause some device issues that caused the webpage to not sync with the incoming feed, but this appears to be hardware related only and not from the implementation (a further explanation is later on).&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ mkdir WebcamFeed&lt;br /&gt;
xm$ git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed&lt;br /&gt;
xm$ cd WebcamFeed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install nodejs&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install gstreamer&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following you will need it quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ ifconfig&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Take note of the IP Address as you will need to enter it in your user's web browser and to align to the video feed. (This is due to the address being in the client HTML file and not able to be easily informed of its source IP Address.)&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ cd ./WebcamFeeds/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the instillation is done the program can be ran&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ node WebcamFeed.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are four buttons for convenience. These function identically as entering the number's 0 though 3 into the text box and clicking Set Cam for each number.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
This program implements node.js and GStreamer working together to accomplish the video output and control over which video device to be viewed.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used. We only access one webcam at any given time and so the only increasing overhead on the system is that which is associated with the individual USB webcam's. &lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation].&lt;br /&gt;
&lt;br /&gt;
This video starts out very slow and illustrates some of the hardware related issues that were encountered. While the most effective implementation currently is the two camera version we wished to show that four camera feeds could be accessed on the xM.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
The project uses [http://gstreamer.freedesktop.org/ GStreamer] to capture video from a webcam, convert it to video/ogg format, and stream it through Transmission Control Protocol (TCP). A diagram of the GStreamer pipeline is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Gstreamer_pipeline.png|400px|Web Cam Feed - GStreamer Pipeline]]&lt;br /&gt;
&lt;br /&gt;
The client system connects to a node.js server running on the xM. The server embeds the video stream into the web page and also contains controls for selecting a webcam for the stream.&lt;br /&gt;
&lt;br /&gt;
When the server begins running the node.js script, it launches the GStreamer pipeline discussed above. When the client connects, they receive a web page containing controls for the video source and the embedded video that gets played using the [http://www.videolan.org/vlc/index.html VLC] web plugin.&lt;br /&gt;
&lt;br /&gt;
When the client uses the controls to change the video source, the server kills the current GStreamer process and launches a new one using the new video source. It then makes the client's page refresh to make the embedded video player use the new stream.&lt;br /&gt;
&lt;br /&gt;
A block diagram of the system is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Block_Diagram.png|400px|Web Cam Feed Block Diagram]]&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdell investigated using GStreamer to accomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdell used his research to get GStreamer to stream a video or camera input onto port 8080 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an HTML document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was identified by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the VLC viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allowed for a simplified approach to running the needed utilities without having to port code into the Javascript language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the XM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the vlc-plugin.&lt;br /&gt;
&lt;br /&gt;
Solving the interesting problem with the random stream failure. This issue arises when switching between streams. Occasionally the video receiver does not receive the stream even though the stream is playing across the network. From experimentation we found that as cameras were added the performance of the entire program greatly decreased. Since we only access one camera at a time the only explanation we could find was that the OS was devoting resources to the devices when they were connected thus creating a much greater overhead as cameras were added. When the cameras were disconnected the performance returned to their previous levels. With four cameras operating a noticeable increase in stream failures was observed. With only two cameras operating about 1/5 of attempts would be unsuccessful. With four cameras the failure rate was significantly higher (as much as 1/3 of attempts would fail). One possible explanation of this is the overhead causing a slow down in setup time for the video out thread compared to the load up time of the browser. While this is set up to go first if the system hanged due to lack of resources this could cause the video stream to start after the html file stopped looking for it. Occasionally the camera just won't turn on. We have found that signaling it again usually fixes the problem without much effort. After trying to figure out what was causing the problem we could not definitively pin down the root cause of the problem and we found no simple or effective solution for it but would like to see it fixed.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T06:02:50Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Work Breakdown */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdell]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the browser's VLC Plugin. We have tested this with 4 webcams on the xM board.&lt;br /&gt;
&lt;br /&gt;
Operating with four webcams hooked to the board causes many failures of the system to stream back the video information. We determined that this was due to the physical cameras and the overhead of the devices by testing the system with only two we cams where the issues experienced regularly with the four camera setup greatly reduced in frequency.&lt;br /&gt;
&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort largely due to the infancy of HTML5 Related standards(sockets.io and MediaStream). In the end we decided to utilize the vlc plugin when the HTML5 proved unfeasible at its current level of development. Implementing the four cameras did seem to cause some device issues that caused the webpage to not sync with the incoming feed, but this appears to be hardware related only and not from the implementation (a further explanation is later on).&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ mkdir WebcamFeed&lt;br /&gt;
xm$ git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed&lt;br /&gt;
xm$ cd WebcamFeed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install nodejs&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install gstreamer&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following you will need it quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ ifconfig&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Take note of the IP Address as you will need to enter it in your user's web browser and to align to the video feed. (This is due to the address being in the client HTML file and not able to be easily informed of its source IP Address.)&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ cd ./WebcamFeeds/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the instillation is done the program can be ran&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ node WebcamFeed.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are four buttons for convenience. These function identically as entering the number's 0 though 3 into the text box and clicking Set Cam for each number.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
This program implements node.js and GStreamer working together to accomplish the video output and control over which video device to be viewed.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used. We only access one webcam at any given time and so the only increasing overhead on the system is that which is associated with the individual USB webcam's. &lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation].&lt;br /&gt;
&lt;br /&gt;
This video starts out very slow and illustrates some of the hardware related issues that were encountered. While the most effective implementation currently is the two camera version we wished to show that four camera feeds could be accessed on the xM.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
The project uses [http://gstreamer.freedesktop.org/ GStreamer] to capture video from a webcam, convert it to video/ogg format, and stream it through Transmission Control Protocol (TCP). A diagram of the GStreamer pipeline is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Gstreamer_pipeline.png|400px|Web Cam Feed - GStreamer Pipeline]]&lt;br /&gt;
&lt;br /&gt;
The client system connects to a node.js server running on the xM. The server embeds the video stream into the web page and also contains controls for selecting a webcam for the stream.&lt;br /&gt;
&lt;br /&gt;
When the server begins running the node.js script, it launches the GStreamer pipeline discussed above. When the client connects, they receive a web page containing controls for the video source and the embedded video that gets played using the [http://www.videolan.org/vlc/index.html VLC] web plugin.&lt;br /&gt;
&lt;br /&gt;
When the client uses the controls to change the video source, the server kills the current GStreamer process and launches a new one using the new video source. It then makes the client's page refresh to make the embedded video player use the new stream.&lt;br /&gt;
&lt;br /&gt;
A block diagram of the system is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Block_Diagram.png|400px|Web Cam Feed Block Diagram]]&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;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdell investigated using GStreamer to acomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdell used his research to get gstreamer to stream a video or camera input onto port 8081 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an html document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was discovered by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the vlc viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allows for a simplified approach to running the needed utilities without having to port code into the java script language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the XM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the vlc-plugin.&lt;br /&gt;
&lt;br /&gt;
Solving the interesting problem with the random stream failure. This issue arises when switching between streams. Occasionally the video receiver does not receive the stream even though the stream is playing across the network. From experimentation we found that as cameras were added the performance of the entire program greatly decreased. Since we only access one camera at a time the only explanation we could find was that the OS was devoting resources to the devices when they were connected thus creating a much greater overhead as cameras were added. When the cameras were disconnected the performance returned to their previous levels. With four cameras operating a noticeable increase in stream failures was observed. With only two cameras operating about 1/5 of attempts would be unsuccessful. With four cameras the failure rate was significantly higher (as much as 1/3 of attempts would fail). One possible explanation of this is the overhead causing a slow down in setup time for the video out thread compared to the load up time of the browser. While this is set up to go first if the system hanged due to lack of resources this could cause the video stream to start after the html file stopped looking for it. Occasionally the camera just won't turn on. We have found that signaling it again usually fixes the problem without much effort. After trying to figure out what was causing the problem we could not definitively pin down the root cause of the problem and we found no simple or effective solution for it but would like to see it fixed.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T06:02:30Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdell]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the browser's VLC Plugin. We have tested this with 4 webcams on the xM board.&lt;br /&gt;
&lt;br /&gt;
Operating with four webcams hooked to the board causes many failures of the system to stream back the video information. We determined that this was due to the physical cameras and the overhead of the devices by testing the system with only two we cams where the issues experienced regularly with the four camera setup greatly reduced in frequency.&lt;br /&gt;
&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort largely due to the infancy of HTML5 Related standards(sockets.io and MediaStream). In the end we decided to utilize the vlc plugin when the HTML5 proved unfeasible at its current level of development. Implementing the four cameras did seem to cause some device issues that caused the webpage to not sync with the incoming feed, but this appears to be hardware related only and not from the implementation (a further explanation is later on).&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ mkdir WebcamFeed&lt;br /&gt;
xm$ git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed&lt;br /&gt;
xm$ cd WebcamFeed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install nodejs&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install gstreamer&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following you will need it quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ ifconfig&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Take note of the IP Address as you will need to enter it in your user's web browser and to align to the video feed. (This is due to the address being in the client HTML file and not able to be easily informed of its source IP Address.)&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ cd ./WebcamFeeds/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the instillation is done the program can be ran&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ node WebcamFeed.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are four buttons for convenience. These function identically as entering the number's 0 though 3 into the text box and clicking Set Cam for each number.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
This program implements node.js and GStreamer working together to accomplish the video output and control over which video device to be viewed.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used. We only access one webcam at any given time and so the only increasing overhead on the system is that which is associated with the individual USB webcam's. &lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation].&lt;br /&gt;
&lt;br /&gt;
This video starts out very slow and illustrates some of the hardware related issues that were encountered. While the most effective implementation currently is the two camera version we wished to show that four camera feeds could be accessed on the xM.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
The project uses [http://gstreamer.freedesktop.org/ GStreamer] to capture video from a webcam, convert it to video/ogg format, and stream it through Transmission Control Protocol (TCP). A diagram of the GStreamer pipeline is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Gstreamer_pipeline.png|400px|Web Cam Feed - GStreamer Pipeline]]&lt;br /&gt;
&lt;br /&gt;
The client system connects to a node.js server running on the xM. The server embeds the video stream into the web page and also contains controls for selecting a webcam for the stream.&lt;br /&gt;
&lt;br /&gt;
When the server begins running the node.js script, it launches the GStreamer pipeline discussed above. When the client connects, they receive a web page containing controls for the video source and the embedded video that gets played using the [http://www.videolan.org/vlc/index.html VLC] web plugin.&lt;br /&gt;
&lt;br /&gt;
When the client uses the controls to change the video source, the server kills the current GStreamer process and launches a new one using the new video source. It then makes the client's page refresh to make the embedded video player use the new stream.&lt;br /&gt;
&lt;br /&gt;
A block diagram of the system is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Block_Diagram.png|400px|Web Cam Feed Block Diagram]]&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;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdel investigated using GStreamer to acomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdell used his research to get gstreamer to stream a video or camera input onto port 8081 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an html document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was discovered by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the vlc viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allows for a simplified approach to running the needed utilities without having to port code into the java script language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the XM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the vlc-plugin.&lt;br /&gt;
&lt;br /&gt;
Solving the interesting problem with the random stream failure. This issue arises when switching between streams. Occasionally the video receiver does not receive the stream even though the stream is playing across the network. From experimentation we found that as cameras were added the performance of the entire program greatly decreased. Since we only access one camera at a time the only explanation we could find was that the OS was devoting resources to the devices when they were connected thus creating a much greater overhead as cameras were added. When the cameras were disconnected the performance returned to their previous levels. With four cameras operating a noticeable increase in stream failures was observed. With only two cameras operating about 1/5 of attempts would be unsuccessful. With four cameras the failure rate was significantly higher (as much as 1/3 of attempts would fail). One possible explanation of this is the overhead causing a slow down in setup time for the video out thread compared to the load up time of the browser. While this is set up to go first if the system hanged due to lack of resources this could cause the video stream to start after the html file stopped looking for it. Occasionally the camera just won't turn on. We have found that signaling it again usually fixes the problem without much effort. After trying to figure out what was causing the problem we could not definitively pin down the root cause of the problem and we found no simple or effective solution for it but would like to see it fixed.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T06:01:29Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Work Breakdown */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdel]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the browser's VLC Plugin. We have tested this with 4 webcams on the xM board.&lt;br /&gt;
&lt;br /&gt;
Operating with four webcams hooked to the board causes many failures of the system to stream back the video information. We determined that this was due to the physical cameras and the overhead of the devices by testing the system with only two we cams where the issues experienced regularly with the four camera setup greatly reduced in frequency.&lt;br /&gt;
&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort largely due to the infancy of HTML5 Related standards(sockets.io and MediaStream). In the end we decided to utilize the vlc plugin when the HTML5 proved unfeasible at its current level of development. Implementing the four cameras did seem to cause some device issues that caused the webpage to not sync with the incoming feed, but this appears to be hardware related only and not from the implementation (a further explanation is later on).&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ mkdir WebcamFeed&lt;br /&gt;
xm$ git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed&lt;br /&gt;
xm$ cd WebcamFeed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install nodejs&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install gstreamer&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following you will need it quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ ifconfig&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Take note of the IP Address as you will need to enter it in your user's web browser and to align to the video feed. (This is due to the address being in the client HTML file and not able to be easily informed of its source IP Address.)&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ cd ./WebcamFeeds/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the instillation is done the program can be ran&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ node WebcamFeed.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are four buttons for convenience. These function identically as entering the number's 0 though 3 into the text box and clicking Set Cam for each number.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
This program implements node.js and GStreamer working together to accomplish the video output and control over which video device to be viewed.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used. We only access one webcam at any given time and so the only increasing overhead on the system is that which is associated with the individual USB webcam's. &lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation].&lt;br /&gt;
&lt;br /&gt;
This video starts out very slow and illustrates some of the hardware related issues that were encountered. While the most effective implementation currently is the two camera version we wished to show that four camera feeds could be accessed on the xM.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
The project uses [http://gstreamer.freedesktop.org/ GStreamer] to capture video from a webcam, convert it to video/ogg format, and stream it through Transmission Control Protocol (TCP). A diagram of the GStreamer pipeline is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Gstreamer_pipeline.png|400px|Web Cam Feed - GStreamer Pipeline]]&lt;br /&gt;
&lt;br /&gt;
The client system connects to a node.js server running on the xM. The server embeds the video stream into the web page and also contains controls for selecting a webcam for the stream.&lt;br /&gt;
&lt;br /&gt;
When the server begins running the node.js script, it launches the GStreamer pipeline discussed above. When the client connects, they receive a web page containing controls for the video source and the embedded video that gets played using the [http://www.videolan.org/vlc/index.html VLC] web plugin.&lt;br /&gt;
&lt;br /&gt;
When the client uses the controls to change the video source, the server kills the current GStreamer process and launches a new one using the new video source. It then makes the client's page refresh to make the embedded video player use the new stream.&lt;br /&gt;
&lt;br /&gt;
A block diagram of the system is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Block_Diagram.png|400px|Web Cam Feed Block Diagram]]&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;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdel investigated using GStreamer to acomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdell used his research to get gstreamer to stream a video or camera input onto port 8081 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an html document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was discovered by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the vlc viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allows for a simplified approach to running the needed utilities without having to port code into the java script language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the XM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the vlc-plugin.&lt;br /&gt;
&lt;br /&gt;
Solving the interesting problem with the random stream failure. This issue arises when switching between streams. Occasionally the video receiver does not receive the stream even though the stream is playing across the network. From experimentation we found that as cameras were added the performance of the entire program greatly decreased. Since we only access one camera at a time the only explanation we could find was that the OS was devoting resources to the devices when they were connected thus creating a much greater overhead as cameras were added. When the cameras were disconnected the performance returned to their previous levels. With four cameras operating a noticeable increase in stream failures was observed. With only two cameras operating about 1/5 of attempts would be unsuccessful. With four cameras the failure rate was significantly higher (as much as 1/3 of attempts would fail). One possible explanation of this is the overhead causing a slow down in setup time for the video out thread compared to the load up time of the browser. While this is set up to go first if the system hanged due to lack of resources this could cause the video stream to start after the html file stopped looking for it. Occasionally the camera just won't turn on. We have found that signaling it again usually fixes the problem without much effort. After trying to figure out what was causing the problem we could not definitively pin down the root cause of the problem and we found no simple or effective solution for it but would like to see it fixed.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T06:00:22Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Theory of Operation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdel]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the browser's VLC Plugin. We have tested this with 4 webcams on the xM board.&lt;br /&gt;
&lt;br /&gt;
Operating with four webcams hooked to the board causes many failures of the system to stream back the video information. We determined that this was due to the physical cameras and the overhead of the devices by testing the system with only two we cams where the issues experienced regularly with the four camera setup greatly reduced in frequency.&lt;br /&gt;
&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort largely due to the infancy of HTML5 Related standards(sockets.io and MediaStream). In the end we decided to utilize the vlc plugin when the HTML5 proved unfeasible at its current level of development. Implementing the four cameras did seem to cause some device issues that caused the webpage to not sync with the incoming feed, but this appears to be hardware related only and not from the implementation (a further explanation is later on).&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ mkdir WebcamFeed&lt;br /&gt;
xm$ git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed&lt;br /&gt;
xm$ cd WebcamFeed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install nodejs&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install gstreamer&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following you will need it quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ ifconfig&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Take note of the IP Address as you will need to enter it in your user's web browser and to align to the video feed. (This is due to the address being in the client HTML file and not able to be easily informed of its source IP Address.)&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ cd ./WebcamFeeds/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the instillation is done the program can be ran&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ node WebcamFeed.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are four buttons for convenience. These function identically as entering the number's 0 though 3 into the text box and clicking Set Cam for each number.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
This program implements node.js and GStreamer working together to accomplish the video output and control over which video device to be viewed.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used. We only access one webcam at any given time and so the only increasing overhead on the system is that which is associated with the individual USB webcam's. &lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation].&lt;br /&gt;
&lt;br /&gt;
This video starts out very slow and illustrates some of the hardware related issues that were encountered. While the most effective implementation currently is the two camera version we wished to show that four camera feeds could be accessed on the xM.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
The project uses [http://gstreamer.freedesktop.org/ GStreamer] to capture video from a webcam, convert it to video/ogg format, and stream it through Transmission Control Protocol (TCP). A diagram of the GStreamer pipeline is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Gstreamer_pipeline.png|400px|Web Cam Feed - GStreamer Pipeline]]&lt;br /&gt;
&lt;br /&gt;
The client system connects to a node.js server running on the xM. The server embeds the video stream into the web page and also contains controls for selecting a webcam for the stream.&lt;br /&gt;
&lt;br /&gt;
When the server begins running the node.js script, it launches the GStreamer pipeline discussed above. When the client connects, they receive a web page containing controls for the video source and the embedded video that gets played using the [http://www.videolan.org/vlc/index.html VLC] web plugin.&lt;br /&gt;
&lt;br /&gt;
When the client uses the controls to change the video source, the server kills the current GStreamer process and launches a new one using the new video source. It then makes the client's page refresh to make the embedded video player use the new stream.&lt;br /&gt;
&lt;br /&gt;
A block diagram of the system is shown below.&lt;br /&gt;
&lt;br /&gt;
[[File:BbWebcamFeed_Block_Diagram.png|400px|Web Cam Feed Block Diagram]]&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;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdel investigated using GStreamer to acomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdel used his research to get gstreamer to stream a video or camera input onto port 8081 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an html document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was discovered by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the vlc viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allows for a simplified approach to running the needed utilities without having to port code into the java script language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the XM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the vlc-plugin.&lt;br /&gt;
&lt;br /&gt;
Solving the interesting problem with the random stream failure. This issue arises when switching between streams. Occasionally the video receiver does not receive the stream even though the stream is playing across the network. From experimentation we found that as cameras were added the performance of the entire program greatly decreased. Since we only access one camera at a time the only explanation we could find was that the OS was devoting resources to the devices when they were connected thus creating a much greater overhead as cameras were added. When the cameras were disconnected the performance returned to their previous levels. With four cameras operating a noticeable increase in stream failures was observed. With only two cameras operating about 1/5 of attempts would be unsuccessful. With four cameras the failure rate was significantly higher (as much as 1/3 of attempts would fail). One possible explanation of this is the overhead causing a slow down in setup time for the video out thread compared to the load up time of the browser. While this is set up to go first if the system hanged due to lack of resources this could cause the video stream to start after the html file stopped looking for it. Occasionally the camera just won't turn on. We have found that signaling it again usually fixes the problem without much effort. After trying to figure out what was causing the problem we could not definitively pin down the root cause of the problem and we found no simple or effective solution for it but would like to see it fixed.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Adafruit:_Rotary_Encoder</id>
		<title>Adafruit: Rotary Encoder</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Adafruit:_Rotary_Encoder"/>
				<updated>2012-11-14T05:54:05Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Bone Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   1&lt;br /&gt;
Code:     1&lt;br /&gt;
git/Compiles with make: 2&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    8/10&lt;br /&gt;
Comments: How do I do the pull ups?&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Adafruit_Rotary_Encoder.jpg|thumb|Adafruit's Rotary Encoder]]&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
[http://adafru.it/377 Adafruit's Rotary Encoder] is a device that detects rotation. As it rotates, it sends pulses on two pins. By comparing the signals, the direction of rotation can be determined. There are 24 pulses per rotation. The device also acts as a pushbutton switch.&lt;br /&gt;
&lt;br /&gt;
==Inputs and Outputs==&lt;br /&gt;
&lt;br /&gt;
The device has five pins - three on one side and two on the other. The side with three pins is for the encoder and is ordered (from left to right) signal A, ground, and signal B. The side with two pins is for the pushbutton switch. The signal pins require the use of pullup resistors, and the switch should use either a pullup or pulldown resistor. More information can be found on the [http://adafru.it/377 product page] or on the [http://www.adafruit.com/datasheets/pec11.pdf datasheet].&lt;br /&gt;
&lt;br /&gt;
==Bone Usage==&lt;br /&gt;
&lt;br /&gt;
The pins on the device can be difficult to use with a bread board, so it may be useful to solder the device to a perfboard and add connectors. [[File:Adafruit_Rotary_Encoder_With_Connectors.jpg|thumb|Rotary encoder with connectors added]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;color:red&amp;quot;&amp;gt;How do you configure the pullups?&amp;lt;/blockquote&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two signal pins and one of the pushbutton pins can be hooked up directly to any of the GPIO ports on the BeagleBone. The pins should then be configured as pullups for the signal pins and either pullup or pulldown for the switch pin. The remaining pins can be hooked up to GND and +3,3v. The example below uses GPIO1_6 for signal A, GPIO1_15 for signal B, and GPIO1_16 for the pushbutton switch. [[File:Adafruit_Rotary_Encoder_in_BeagleBone.jpg|thumb|Rotary encoder hooked up to the BeagleBone]]&lt;br /&gt;
&lt;br /&gt;
To configure the pull-up resistor, write 0x0037 to the pin's OMAP mux file (in /sys/kernel/debug/omap_mux). For example, the code below writes 0x0037 into /sys/kernel/debug/omap_mux/gpmc_ad6 for the B signal pin. Writing a value of 0x0027 to the file will configure it to use a pull-down resistor.&lt;br /&gt;
&lt;br /&gt;
The C code below demonstrates how to use the encoder with the BeagleBone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
&lt;br /&gt;
Port Congiguration:&lt;br /&gt;
-Encoder A: GPIO1_6 - Header P8, pin 3 - GPIO 38&lt;br /&gt;
-Encoder B: GPIO1_15 - Header P8, pin 15 - GPIO 47&lt;br /&gt;
-Encoder GND: Header P8, pin 1&lt;br /&gt;
&lt;br /&gt;
-Pushbutton Switch: GPIO1_16 - Header P9, pin 15 - GPIO 48&lt;br /&gt;
-Pusshbuton Switch V+: Header P9, pin 3&lt;br /&gt;
&lt;br /&gt;
This program keeps track of an encoder. CW rotation will&lt;br /&gt;
increment the ticks, and CCW will decrement it. The current&lt;br /&gt;
number of ticks is printed when the button is pressed.&lt;br /&gt;
&lt;br /&gt;
The files gpio.h and gpio.c  consist of the GPIO methods copied&lt;br /&gt;
directly from:&lt;br /&gt;
https://www.ridgerun.com/developer/wiki/index.php/Gpio-int-test.c&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define OMAP_DIR &amp;quot;/sys/kernel/debug/omap_mux&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int running = 1;&lt;br /&gt;
&lt;br /&gt;
// Quit when ^C is pressed&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf(&amp;quot;\n&amp;quot;);&lt;br /&gt;
	running = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
	// Polling variables&lt;br /&gt;
	int rc;&lt;br /&gt;
	struct pollfd fdset[3];&lt;br /&gt;
	int nfds = 3;&lt;br /&gt;
	int len;&lt;br /&gt;
	char* buf[MAX_BUF];&lt;br /&gt;
&lt;br /&gt;
	// Keeps track of encoder ticks.&lt;br /&gt;
	int ticks = 0;&lt;br /&gt;
&lt;br /&gt;
	// Variables used to store GPIO values&lt;br /&gt;
	unsigned int enc_a_val;&lt;br /&gt;
	unsigned int enc_b_val;&lt;br /&gt;
	unsigned int sw_val;&lt;br /&gt;
&lt;br /&gt;
	// Handle Ctrl^C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
        // Configure the pins to use internal pull-down resistors&lt;br /&gt;
        FILE *mux_ptr;&lt;br /&gt;
        char pullup_str[10];&lt;br /&gt;
	char pulldown_str[10];&lt;br /&gt;
        strcpy(pullup_str, &amp;quot;0x0037&amp;quot;);&lt;br /&gt;
	strcpy(pulldown_str, &amp;quot;0x0027&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // Configure pull-up for the A signal&lt;br /&gt;
        if ((mux_ptr = fopen(OMAP_DIR &amp;quot;/gpmc_ad6&amp;quot;, &amp;quot;rb+&amp;quot;)) == NULL)&lt;br /&gt;
        {&lt;br /&gt;
                printf(&amp;quot;Failed to open gpmc_ad6. Quitting.\n&amp;quot;);&lt;br /&gt;
                exit(1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
	{&lt;br /&gt;
                fwrite(&amp;amp;pullup_str, sizeof(char), 6, mux_ptr);&lt;br /&gt;
                fclose(mux_ptr);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Configure pull-up for the B signal&lt;br /&gt;
        if ((mux_ptr = fopen(OMAP_DIR &amp;quot;/gpmc_ad15&amp;quot;, &amp;quot;rb+&amp;quot;)) == NULL)&lt;br /&gt;
        {&lt;br /&gt;
                printf(&amp;quot;Failed to open gpmc_ad15. Quitting.\n&amp;quot;);&lt;br /&gt;
                exit(1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
	{&lt;br /&gt;
                fwrite(&amp;amp;pullup_str, sizeof(char), 6, mux_ptr);&lt;br /&gt;
                fclose(mux_ptr);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Configure pull-down for the switch&lt;br /&gt;
        if ((mux_ptr = fopen(OMAP_DIR &amp;quot;/gpmc_a0&amp;quot;, &amp;quot;rb+&amp;quot;)) == NULL)&lt;br /&gt;
        {&lt;br /&gt;
                printf(&amp;quot;Failed to open gpmc_a0. Quitting.\n&amp;quot;);&lt;br /&gt;
                exit(1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
	{&lt;br /&gt;
                fwrite(&amp;amp;pulldown_str, sizeof(char), 6, mux_ptr);&lt;br /&gt;
                fclose(mux_ptr);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
	// Set up GPIO pins&lt;br /&gt;
	unsigned int gpio_a = 38;&lt;br /&gt;
	unsigned int gpio_b = 47;&lt;br /&gt;
	unsigned int gpio_sw = 48;&lt;br /&gt;
&lt;br /&gt;
	int enc_a_fd;&lt;br /&gt;
	int enc_b_fd;&lt;br /&gt;
	int enc_sw_fd;&lt;br /&gt;
&lt;br /&gt;
	printf(&amp;quot;Exporting a... %d\n&amp;quot;, gpio_export(gpio_a));&lt;br /&gt;
	printf(&amp;quot;Exporting b... %d\n&amp;quot;, gpio_export(gpio_b));&lt;br /&gt;
	printf(&amp;quot;Exporting sw... %d\n&amp;quot;, gpio_export(gpio_sw));&lt;br /&gt;
&lt;br /&gt;
	printf(&amp;quot;Setting a direction... %d\n&amp;quot;, gpio_set_dir(gpio_a, 0));&lt;br /&gt;
	printf(&amp;quot;Setting b direction... %d\n&amp;quot;, gpio_set_dir(gpio_b, 0));&lt;br /&gt;
	printf(&amp;quot;Setting sw direction... %d\n&amp;quot;, gpio_set_dir(gpio_sw, 0));&lt;br /&gt;
&lt;br /&gt;
	// Interrupts&lt;br /&gt;
	printf(&amp;quot;setting edge a... %d\n&amp;quot;, gpio_set_edge(gpio_a, &amp;quot;rising&amp;quot;));&lt;br /&gt;
	printf(&amp;quot;setting edge sw... %d\n&amp;quot;, gpio_set_edge(gpio_sw, &amp;quot;rising&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	// Open the file for the encoder A signal&lt;br /&gt;
	enc_a_fd = gpio_fd_open(gpio_a);&lt;br /&gt;
	enc_sw_fd = gpio_fd_open(gpio_sw);&lt;br /&gt;
&lt;br /&gt;
	// Main loop&lt;br /&gt;
	while (running == 1)&lt;br /&gt;
	{&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 = enc_a_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		fdset[2].fd = enc_sw_fd;&lt;br /&gt;
		fdset[2].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, -1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0)&lt;br /&gt;
		{&lt;br /&gt;
//			printf(&amp;quot;poll() failed.\n&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (rc == 0)&lt;br /&gt;
		{&lt;br /&gt;
//			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN)&lt;br /&gt;
		{&lt;br /&gt;
			(void) read(fdset[0].fd, buf, 1);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Encoder click&lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI)&lt;br /&gt;
		{&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
&lt;br /&gt;
			enc_a_val = atoi((const char*) buf);&lt;br /&gt;
			gpio_get_value(gpio_b, &amp;amp;enc_b_val);&lt;br /&gt;
&lt;br /&gt;
			if (enc_a_val == 1) // rising edge&lt;br /&gt;
			{&lt;br /&gt;
				if (enc_b_val == 0) ticks--;&lt;br /&gt;
				else ticks++;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Button press - print the current number of encoder ticks&lt;br /&gt;
		if (fdset[2].revents &amp;amp; POLLPRI)&lt;br /&gt;
		{&lt;br /&gt;
			lseek(fdset[2].fd, 0, SEEK_SET);&lt;br /&gt;
			len = read(fdset[2].fd, buf, MAX_BUF);&lt;br /&gt;
&lt;br /&gt;
			// Very simple debouncing&lt;br /&gt;
			usleep(5000);&lt;br /&gt;
			gpio_get_value(gpio_sw, &amp;amp;sw_val);&lt;br /&gt;
			if (sw_val == 1)&lt;br /&gt;
			{&lt;br /&gt;
				printf(&amp;quot;Ticks: %d\n&amp;quot;, ticks);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(enc_a_fd);&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full code can be found in [https://github.com/jtlobdell/Adafruit_Rotary_Encoder_BeagleBone John Lobdell's Git repository].&lt;br /&gt;
&lt;br /&gt;
==Interfacing with node.js==&lt;br /&gt;
&lt;br /&gt;
Interfacing it with node.js is relatively straight-forward. The code is shwon below, and can be found in [https://github.com/jtlobdell/Adafruit_Rotary_Encoder_BeagleBone John Lobdell's Git repository].&lt;br /&gt;
&lt;br /&gt;
rotary_encoder.js:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// From Getting Started With node.js and socket.io &lt;br /&gt;
// http://codehenge.net/blog/2011/12/getting-started-with-node-js-and-socket-io-v0-7-part-2/&lt;br /&gt;
&amp;quot;use strict&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var http = require('http'),&lt;br /&gt;
    url = require('url'),&lt;br /&gt;
    fs = require('fs'),&lt;br /&gt;
    exec = require('child_process').exec,&lt;br /&gt;
    server,&lt;br /&gt;
    connectCount = 0;	// Number of connections to server&lt;br /&gt;
&lt;br /&gt;
server = http.createServer(function (req, res) {&lt;br /&gt;
// server code&lt;br /&gt;
    var path = url.parse(req.url).pathname;&lt;br /&gt;
    console.log(&amp;quot;path: &amp;quot; + path);&lt;br /&gt;
    switch (path) {&lt;br /&gt;
    case '/':&lt;br /&gt;
        res.writeHead(200, {'Content-Type': 'text/html'});&lt;br /&gt;
        res.write('&amp;lt;h1&amp;gt;John Lobdell - Mini Project 4&amp;lt;/h1&amp;gt;Try&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/rotary_encoder.html&amp;quot;&amp;gt;Rotary Encoder&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;');&lt;br /&gt;
&lt;br /&gt;
        res.end();&lt;br /&gt;
        break;&lt;br /&gt;
&lt;br /&gt;
    default:		// This is so all the files will be sent.&lt;br /&gt;
        fs.readFile(__dirname + path, function (err, data) {&lt;br /&gt;
            if (err) {return send404(res); }&lt;br /&gt;
//            console.log(&amp;quot;path2: &amp;quot; + path);&lt;br /&gt;
            res.write(data, 'utf8');&lt;br /&gt;
            res.end();&lt;br /&gt;
        });&lt;br /&gt;
        break;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
var send404 = function (res) {&lt;br /&gt;
    res.writeHead(404);&lt;br /&gt;
    res.write('404');&lt;br /&gt;
    res.end();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
server.listen(8081);&lt;br /&gt;
&lt;br /&gt;
// socket.io, I choose you&lt;br /&gt;
var io = require('socket.io').listen(server);&lt;br /&gt;
io.set('log level', 2);&lt;br /&gt;
&lt;br /&gt;
// on a 'connection' event&lt;br /&gt;
io.sockets.on('connection', function (socket) {&lt;br /&gt;
    var frameCount = 0;	// Counts the frames from arecord&lt;br /&gt;
    var lastFrame = 0;	// Last frame sent to browser&lt;br /&gt;
    console.log(&amp;quot;Connection &amp;quot; + socket.id + &amp;quot; accepted.&amp;quot;);&lt;br /&gt;
//    console.log(&amp;quot;socket: &amp;quot; + socket);&lt;br /&gt;
&lt;br /&gt;
    // now that we have our connected 'socket' object, we can &lt;br /&gt;
    // define its event handlers&lt;br /&gt;
&lt;br /&gt;
    // Make sure gpio 38, 47, and 48 are available.&lt;br /&gt;
    exec(&amp;quot;echo 38 &amp;gt; /sys/class/gpio/export&amp;quot;);&lt;br /&gt;
    exec(&amp;quot;echo 47 &amp;gt; /sys/class/gpio/export&amp;quot;);&lt;br /&gt;
    exec(&amp;quot;echo 48 &amp;gt; /sys/class/gpio/export&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    // Configure pullup/pulldown resistors&lt;br /&gt;
    exec(&amp;quot;echo 0x0037 &amp;gt; /sys/kernel/debug/omap_mux/gpmc_ad6&amp;quot;); // Pullup for encoder A&lt;br /&gt;
    exec(&amp;quot;echo 0x0037 &amp;gt; /sys/kernel/debug/omap_mux/gpmc_ad15&amp;quot;); // Pullup for encoder B&lt;br /&gt;
    exec(&amp;quot;echo 0x0027 &amp;gt; /sys/kernel/debug/omap_mux/gpmc_a0&amp;quot;); // Pulldown for the switch&lt;br /&gt;
&lt;br /&gt;
    // Handle disconnects&lt;br /&gt;
    socket.on('disconnect', function () {&lt;br /&gt;
        console.log(&amp;quot;Connection &amp;quot; + socket.id + &amp;quot; terminated.&amp;quot;);&lt;br /&gt;
        connectCount--;&lt;br /&gt;
        if(connectCount === 0) {&lt;br /&gt;
        }&lt;br /&gt;
        console.log(&amp;quot;connectCount = &amp;quot; + connectCount);&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
    // Periodically send data&lt;br /&gt;
    var push_interval = 20;&lt;br /&gt;
    function push_data() {&lt;br /&gt;
        // Send encoder A status&lt;br /&gt;
        var gpioPath = &amp;quot;/sys/class/gpio/gpio38/value&amp;quot;;&lt;br /&gt;
        fs.readFile(gpioPath, 'base64', function (err, data) {&lt;br /&gt;
            if (err) throw err;&lt;br /&gt;
            socket.emit('enc_a', data);&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
        // Send encoder B status&lt;br /&gt;
        gpioPath = &amp;quot;/sys/class/gpio/gpio47/value&amp;quot;;&lt;br /&gt;
        fs.readFile(gpioPath, 'base64', function (err, data) {&lt;br /&gt;
            if (err) throw err;&lt;br /&gt;
            socket.emit('enc_b', data);&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        // Send encoder switch status&lt;br /&gt;
        gpioPath = &amp;quot;/sys/class/gpio/gpio48/value&amp;quot;;&lt;br /&gt;
        fs.readFile(gpioPath, 'base64', function (err, data) {&lt;br /&gt;
            if (err) throw err;&lt;br /&gt;
            socket.emit('enc_sw', data);&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
        setTimeout(push_data, push_interval);&lt;br /&gt;
    }&lt;br /&gt;
    push_data();&lt;br /&gt;
&lt;br /&gt;
    connectCount++;&lt;br /&gt;
    console.log(&amp;quot;connectCount = &amp;quot; + connectCount);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
rotary_encoder.html:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;!doctype html&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
  &amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;Rotary Encoder Demo&amp;lt;/title&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script src=&amp;quot;/json.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;!-- for ie --&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;/socket.io/socket.io.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;link href=&amp;quot;layout.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;jquery.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;jquery.flot.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;jquery.flot.navigate.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/head&amp;gt;&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;h1&amp;gt;Rotary Encoder Demo &amp;lt;a href=&amp;quot;http://Rose-Hulman.edu&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;img src=&amp;quot;RoseLogo96.png&amp;quot; width=200 style=&amp;quot;float:right&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
    &amp;lt;button id=&amp;quot;connect&amp;quot; onClick='connect()'/&amp;gt;Connect&amp;lt;/button&amp;gt;&lt;br /&gt;
    &amp;lt;button id=&amp;quot;disconnect&amp;quot; onClick='disconnect()'&amp;gt;Disconnect&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;!--    &amp;lt;button id=&amp;quot;send&amp;quot; onClick='send()'/&amp;gt;Send Message&amp;lt;/button&amp;gt; --&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;div id=&amp;quot;plotTop&amp;quot; style=&amp;quot;width:550px;height:150px;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;samples&amp;lt;/center&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;div id=&amp;quot;plotBot&amp;quot; style=&amp;quot;width:550px;height:150px;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;samples&amp;lt;center&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;a href=&amp;quot;http://beagleboard.org&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;img src=&amp;quot;beagle-hd-logo.gif&amp;quot; width=200 align=&amp;quot;right&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
    &amp;lt;div&amp;gt;&amp;lt;p id=&amp;quot;status&amp;quot;&amp;gt;Waiting for input&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;div&amp;gt;&amp;lt;p id=&amp;quot;ticks&amp;quot;&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;a href=&amp;quot;http://www.ti.com/sitara&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;img src=&amp;quot;hdr_ti_logo.gif&amp;quot; width=200 align=&amp;quot;right&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
By &amp;lt;i&amp;gt;John Lobdell&amp;lt;/i&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    var socket;&lt;br /&gt;
    var firstconnect = true,&lt;br /&gt;
        fs = 8000,&lt;br /&gt;
        Ts = 1/fs*1000,&lt;br /&gt;
        samples = 100,&lt;br /&gt;
        plotTop,&lt;br /&gt;
        enc_a = [], ienc_a = 0,&lt;br /&gt;
	enc_b = [], ienc_b = 0,&lt;br /&gt;
        sw_data = [], isw_data = 0,&lt;br /&gt;
        gpio_enc_a = 38,&lt;br /&gt;
	gpio_enc_b = 47,&lt;br /&gt;
	gpio_sw = 48;&lt;br /&gt;
&lt;br /&gt;
    enc_a[samples] = 0;&lt;br /&gt;
    enc_b[samples] = 0;&lt;br /&gt;
    sw_data[samples] = 0;&lt;br /&gt;
&lt;br /&gt;
    function connect() {&lt;br /&gt;
      if(firstconnect) {&lt;br /&gt;
        socket = io.connect(null);&lt;br /&gt;
&lt;br /&gt;
        socket.on('message', function(data)&lt;br /&gt;
            { status_update(&amp;quot;Received: message&amp;quot;);});&lt;br /&gt;
        socket.on('connect', function()&lt;br /&gt;
            { status_update(&amp;quot;Connected to Server&amp;quot;); });&lt;br /&gt;
        socket.on('disconnect', function()&lt;br /&gt;
            { status_update(&amp;quot;Disconnected from Server&amp;quot;); });&lt;br /&gt;
        socket.on('reconnect', function()&lt;br /&gt;
            { status_update(&amp;quot;Reconnected to Server&amp;quot;); });&lt;br /&gt;
        socket.on('reconnecting', function( nextRetry )&lt;br /&gt;
            { status_update(&amp;quot;Reconnecting in &amp;quot; + nextRetry/1000 + &amp;quot; s&amp;quot;); });&lt;br /&gt;
        socket.on('reconnect_failed', function()&lt;br /&gt;
            { message(&amp;quot;Reconnect Failed&amp;quot;); });&lt;br /&gt;
&lt;br /&gt;
        socket.on('enc_a', enca);&lt;br /&gt;
        socket.on('enc_b', encb);&lt;br /&gt;
        socket.on('enc_sw', encsw);&lt;br /&gt;
        socket.on('set_ticks', setTicks);&lt;br /&gt;
&lt;br /&gt;
        firstconnect = false;&lt;br /&gt;
&lt;br /&gt;
      }&lt;br /&gt;
      else {&lt;br /&gt;
        socket.socket.reconnect();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function disconnect() {&lt;br /&gt;
      socket.disconnect();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // When new data arrives, convert it and plot it.&lt;br /&gt;
    function enca(data) {&lt;br /&gt;
//	status_update(&amp;quot;enc_a &amp;quot; + data);&lt;br /&gt;
        data = atob(data);&lt;br /&gt;
        enc_a[ienc_a] = [ienc_a, data];&lt;br /&gt;
        ienc_a++;&lt;br /&gt;
        if (ienc_a &amp;gt;= samples) {&lt;br /&gt;
            ienc_a = 0;&lt;br /&gt;
            enc_a = [];&lt;br /&gt;
        }&lt;br /&gt;
        plotTop.setData([ enc_a, enc_b ]);&lt;br /&gt;
        plotTop.draw();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function encb(data) {&lt;br /&gt;
//	status_update(&amp;quot;enc_b &amp;quot; + data);&lt;br /&gt;
        data = atob(data);&lt;br /&gt;
        enc_b[ienc_b] = [ienc_b, data];&lt;br /&gt;
        ienc_b++;&lt;br /&gt;
        if (ienc_b &amp;gt;= samples) {&lt;br /&gt;
            ienc_b = 0;&lt;br /&gt;
            enc_b = [];&lt;br /&gt;
        }&lt;br /&gt;
        plotTop.setData([ enc_a, enc_b ]);&lt;br /&gt;
        plotTop.draw();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function encsw(data) {&lt;br /&gt;
//        status_update(&amp;quot;encsw &amp;quot; + data);&lt;br /&gt;
        data = atob(data);&lt;br /&gt;
        sw_data[isw_data] = [isw_data, data];&lt;br /&gt;
        isw_data++;&lt;br /&gt;
        if (isw_data &amp;gt;= samples) {&lt;br /&gt;
            isw_data = 0;&lt;br /&gt;
            sw_data = [];&lt;br /&gt;
        }&lt;br /&gt;
        plotBot.setData([ sw_data ]);&lt;br /&gt;
        plotBot.draw();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function status_update(txt){&lt;br /&gt;
      document.getElementById('status').innerHTML = txt;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function setTicks(numTicks){&lt;br /&gt;
        document.getElementById('ticks').innerHTML = &amp;quot;Ticks: &amp;quot; + numTicks;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    connect();&lt;br /&gt;
&lt;br /&gt;
$(function () {&lt;br /&gt;
&lt;br /&gt;
    function initPlotData() {&lt;br /&gt;
        // zip the generated y values with the x values&lt;br /&gt;
        var result = [];&lt;br /&gt;
        for (var i = 0; i &amp;lt;= samples; i++)&lt;br /&gt;
            result[i] = [i, 0];&lt;br /&gt;
        return result;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // setup plot&lt;br /&gt;
    var optionsTop = {&lt;br /&gt;
        series: { &lt;br /&gt;
            shadowSize: 0, // drawing is faster without shadows&lt;br /&gt;
            points: { show: false},&lt;br /&gt;
            lines:  { show: true, lineWidth: 5},&lt;br /&gt;
        }, &lt;br /&gt;
        yaxis:	{ min: 0, max: 2, &lt;br /&gt;
                  zoomRange: [10, 256], panRange: [-128, 128] },&lt;br /&gt;
        xaxis:	{ show: true, &lt;br /&gt;
                  zoomRange: [10, 100], panRange: [0, 100] },&lt;br /&gt;
        legend:	{ position: &amp;quot;sw&amp;quot; },&lt;br /&gt;
        zoom:	{ interactive: true, amount: 1.1 },&lt;br /&gt;
        pan:	{ interactive: true }&lt;br /&gt;
    };&lt;br /&gt;
    plotTop = $.plot($(&amp;quot;#plotTop&amp;quot;), &lt;br /&gt;
        [ &lt;br /&gt;
          { data:  initPlotData(), &lt;br /&gt;
            label: &amp;quot;Encoder A&amp;quot; },&lt;br /&gt;
          { data:  initPlotData(),&lt;br /&gt;
            label: &amp;quot;Encoder B&amp;quot; }&lt;br /&gt;
        ],&lt;br /&gt;
            optionsTop);&lt;br /&gt;
&lt;br /&gt;
    var optionsBot = {&lt;br /&gt;
        series: {&lt;br /&gt;
            shadowSize: 0, // drawing is faster without shadows&lt;br /&gt;
            points: { show: false},&lt;br /&gt;
            lines:  { show: true, lineWidth: 5},&lt;br /&gt;
            color: 2&lt;br /&gt;
        },&lt;br /&gt;
        yaxis:  { min: 0, max: 2,&lt;br /&gt;
                  zoomRange: [10, 256], panRange: [-128, 128] },&lt;br /&gt;
        xaxis:  { show: true,&lt;br /&gt;
                  zoomRange: [10, 100], panRange: [0, 100] },&lt;br /&gt;
        legend: { position: &amp;quot;sw&amp;quot; },&lt;br /&gt;
        zoom:   { interactive: true, amount: 1.1 },&lt;br /&gt;
        pan:    { interactive: true }&lt;br /&gt;
    };&lt;br /&gt;
    plotBot = $.plot($(&amp;quot;#plotBot&amp;quot;),&lt;br /&gt;
        [&lt;br /&gt;
            { data:  initPlotData(),&lt;br /&gt;
              label: &amp;quot;Encoder Switch&amp;quot;}&lt;br /&gt;
        ],&lt;br /&gt;
            optionsBot);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/File:BbWebcamFeed_Block_Diagram.png</id>
		<title>File:BbWebcamFeed Block Diagram.png</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/File:BbWebcamFeed_Block_Diagram.png"/>
				<updated>2012-11-14T05:41:28Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: A block diagram for the Beagle Bone Webcam Feed project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A block diagram for the Beagle Bone Webcam Feed project&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T05:40:41Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Theory of Operation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdel]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the browser's VLC Plugin. We have tested this with 4 webcams on the xM board.&lt;br /&gt;
&lt;br /&gt;
Operating with four webcams hooked to the board causes many failures of the system to stream back the video information. We determined that this was due to the physical cameras and the overhead of the devices by testing the system with only two we cams where the issues experienced regularly with the four camera setup greatly reduced in frequency.&lt;br /&gt;
&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort largely due to the infancy of HTML5 Related standards(sockets.io and MediaStream). In the end we decided to utilize the vlc plugin when the HTML5 proved unfeasible at its current level of development. Implementing the four cameras did seem to cause some device issues that caused the webpage to not sync with the incoming feed, but this appears to be hardware related only and not from the implementation (a further explanation is later on).&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ mkdir WebcamFeed&lt;br /&gt;
xm$ git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed&lt;br /&gt;
xm$ cd WebcamFeed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install nodejs&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install gstreamer&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following you will need it quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ ifconfig&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Take note of the IP Address as you will need to enter it in your user's web browser and to align to the video feed. (This is due to the address being in the client HTML file and not able to be easily informed of its source IP Address.)&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
xm$ '''cd ./WebcamFeeds/'''&lt;br /&gt;
&lt;br /&gt;
Once the instillation is done the program can be ran&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ node WebcamFeed.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are two buttons for convenience. These function identically as entering the number's 1 or 0 into the text box and clicking Set Cam.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used.&lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation].&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
The project uses [http://gstreamer.freedesktop.org/ GStreamer] to capture video from a webcam, convert it to video/ogg format, and stream it through Transmission Control Protocol (TCP). A diagram of the GStreamer pipeline is shown below.&lt;br /&gt;
&lt;br /&gt;
TODO add picture of GStreamer pipeline&lt;br /&gt;
&lt;br /&gt;
The client system connects to a node.js server running on the xM. The server embeds the video stream into the web page and also contains controls for selecting a webcam for the stream.&lt;br /&gt;
&lt;br /&gt;
When the server begins running the node.js script, it launches the GStreamer pipeline discussed above. When the client connects, they receive a web page containing controls for the video source and the embedded video that gets played using the [http://www.videolan.org/vlc/index.html VLC] web plugin.&lt;br /&gt;
&lt;br /&gt;
When the client uses the controls to change the video source, the server kills the current GStreamer process and launches a new one using the new video source. It then makes the client's page refresh to make the embedded video player use the new stream.&lt;br /&gt;
&lt;br /&gt;
A block diagram of the system is shown below.&lt;br /&gt;
&lt;br /&gt;
TODO add picture of block diagram&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;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdel investigated using GStreamer to acomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdel used his research to get gstreamer to stream a video or camera input onto port 8081 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an html document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was discovered by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the vlc viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allows for a simplified approach to running the needed utilities without having to port code into the java script language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the XM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the vlc-plugin.&lt;br /&gt;
&lt;br /&gt;
Solving the interesting problem with the random stream failure. This issue arises when switching between streams. Occasionally the video receiver does not receive the stream even though the stream is playing across the network. From experimentation we found that as cameras were added the performance of the entire program greatly decreased. Since we only access one camera at a time the only explanation we could find was that the OS was devoting resources to the devices when they were connected thus creating a much greater overhead as cameras were added. When the cameras were disconnected the performance returned to their previous levels. With four cameras operating a noticeable increase in stream failures was observed. With only two cameras operating about 1/5 of attempts would be unsuccessful. With four cameras the failure rate was significantly higher (as much as 1/3 of attempts would fail). One possible explanation of this is the overhead causing a slow down in setup time for the video out thread compared to the load up time of the browser. While this is set up to go first if the system hanged due to lack of resources this could cause the video stream to start after the html file stopped looking for it. We found no simple or effective solution for this problem but would like to see it fixed.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T05:40:00Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Theory of Operation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdel]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the browser's VLC Plugin. We have tested this with 4 webcams on the xM board.&lt;br /&gt;
&lt;br /&gt;
Operating with four webcams hooked to the board causes many failures of the system to stream back the video information. We determined that this was due to the physical cameras and the overhead of the devices by testing the system with only two we cams where the issues experienced regularly with the four camera setup greatly reduced in frequency.&lt;br /&gt;
&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort largely due to the infancy of HTML5 Related standards(sockets.io and MediaStream). In the end we decided to utilize the vlc plugin when the HTML5 proved unfeasible at its current level of development. Implementing the four cameras did seem to cause some device issues that caused the webpage to not sync with the incoming feed, but this appears to be hardware related only and not from the implementation (a further explanation is later on).&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ mkdir WebcamFeed&lt;br /&gt;
xm$ git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed&lt;br /&gt;
xm$ cd WebcamFeed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install nodejs&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install gstreamer&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following you will need it quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ ifconfig&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Take note of the IP Address as you will need to enter it in your user's web browser and to align to the video feed. (This is due to the address being in the client HTML file and not able to be easily informed of its source IP Address.)&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
xm$ '''cd ./WebcamFeeds/'''&lt;br /&gt;
&lt;br /&gt;
Once the instillation is done the program can be ran&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ node WebcamFeed.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are two buttons for convenience. These function identically as entering the number's 1 or 0 into the text box and clicking Set Cam.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used.&lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation].&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
The project uses GStreamer to capture video from a webcam, convert it to video/ogg format, and stream it through Transmission Control Protocol (TCP). A diagram of the GStreamer pipeline is shown below.&lt;br /&gt;
&lt;br /&gt;
TODO add picture of GStreamer pipeline&lt;br /&gt;
&lt;br /&gt;
The client system connects to a node.js server running on the xM. The server embeds the video stream into the web page and also contains controls for selecting a webcam for the stream.&lt;br /&gt;
&lt;br /&gt;
When the server begins running the node.js script, it launches the GStreamer pipeline discussed above. When the client connects, they receive a web page containing controls for the video source and the embedded video that gets played using the [http://www.videolan.org/vlc/index.html VLC] web plugin.&lt;br /&gt;
&lt;br /&gt;
When the client uses the controls to change the video source, the server kills the current GStreamer process and launches a new one using the new video source. It then makes the client's page refresh to make the embedded video player use the new stream.&lt;br /&gt;
&lt;br /&gt;
A block diagram of the system is shown below.&lt;br /&gt;
&lt;br /&gt;
TODO add picture of block diagram&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;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdel investigated using GStreamer to acomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdel used his research to get gstreamer to stream a video or camera input onto port 8081 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an html document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was discovered by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the vlc viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allows for a simplified approach to running the needed utilities without having to port code into the java script language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the XM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the vlc-plugin.&lt;br /&gt;
&lt;br /&gt;
Solving the interesting problem with the random stream failure. This issue arises when switching between streams. Occasionally the video receiver does not receive the stream even though the stream is playing across the network. From experimentation we found that as cameras were added the performance of the entire program greatly decreased. Since we only access one camera at a time the only explanation we could find was that the OS was devoting resources to the devices when they were connected thus creating a much greater overhead as cameras were added. When the cameras were disconnected the performance returned to their previous levels. With four cameras operating a noticeable increase in stream failures was observed. With only two cameras operating about 1/5 of attempts would be unsuccessful. With four cameras the failure rate was significantly higher (as much as 1/3 of attempts would fail). One possible explanation of this is the overhead causing a slow down in setup time for the video out thread compared to the load up time of the browser. While this is set up to go first if the system hanged due to lack of resources this could cause the video stream to start after the html file stopped looking for it. We found no simple or effective solution for this problem but would like to see it fixed.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/File:BbWebcamFeed_Gstreamer_pipeline.png</id>
		<title>File:BbWebcamFeed Gstreamer pipeline.png</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/File:BbWebcamFeed_Gstreamer_pipeline.png"/>
				<updated>2012-11-14T05:06:43Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: GStreamer pipeline for the BeagleBone xM Webcam Feed project&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GStreamer pipeline for the BeagleBone xM Webcam Feed project&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T04:57:06Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdel]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
//Give two sentences telling what works.&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the VLC Plugin.&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what isn't working.&lt;br /&gt;
Currently we do not have the system switching between camera's via user inputs. We have not tested with multiple cameras.&lt;br /&gt;
&lt;br /&gt;
End with a two sentence conclusion.&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort due to the infancy of HTML5 Related standards(sockets.io and MediaStream). We decided to utilize the vlc plugin when solving the problem with HTML5 proved unfeasible at its current level of development.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ mkdir WebcamFeed&lt;br /&gt;
xm$ git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed&lt;br /&gt;
xm$ cd WebcamFeed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install nodejs&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ opkg update&lt;br /&gt;
xm$ opkg install gstreamer&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following you will need it quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ ifconfig&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Take note of the IP Address as you will need to enter it in your user's web browser and to align to the video feed. (This is due to the address being in the client HTML file and not able to be easily informed of its source IP Address.)&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
xm$ '''cd ./WebcamFeeds/'''&lt;br /&gt;
&lt;br /&gt;
Once the instillation is done the program can be ran&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ node WebcamFeed.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are two buttons for convenience. These function identically as entering the number's 1 or 0 into the text box and clicking Set Cam.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used.&lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation].&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;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdel investigated using GStreamer to acomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdel used his research to get gstreamer to stream a video or camera input onto port 8081 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an html document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was discovered by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the vlc viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allows for a simplified approach to running the needed utilities without having to port code into the java script language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the XM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the vlc-plugin.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T04:56:41Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* User Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdel]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
//Give two sentences telling what works.&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the VLC Plugin.&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what isn't working.&lt;br /&gt;
Currently we do not have the system switching between camera's via user inputs. We have not tested with multiple cameras.&lt;br /&gt;
&lt;br /&gt;
End with a two sentence conclusion.&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort due to the infancy of HTML5 Related standards(sockets.io and MediaStream). We decided to utilize the vlc plugin when solving the problem with HTML5 proved unfeasible at its current level of development.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ '''mkdir WebcamFeed'''&lt;br /&gt;
xm$ '''git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed'''&lt;br /&gt;
xm$ '''cd WebcamFeed'''&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ '''opkg update'''&lt;br /&gt;
xm$ '''opkg install nodejs'''&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ '''opkg update'''&lt;br /&gt;
xm$ '''opkg install gstreamer'''&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following you will need it quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ '''ifconfig'''&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Take note of the IP Address as you will need to enter it in your user's web browser and to align to the video feed. (This is due to the address being in the client HTML file and not able to be easily informed of its source IP Address.)&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
xm$ '''cd ./WebcamFeeds/'''&lt;br /&gt;
&lt;br /&gt;
Once the instillation is done the program can be ran&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ node WebcamFeed.js&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are two buttons for convenience. These function identically as entering the number's 1 or 0 into the text box and clicking Set Cam.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used.&lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation].&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;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdel investigated using GStreamer to acomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdel used his research to get gstreamer to stream a video or camera input onto port 8081 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an html document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was discovered by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the vlc viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allows for a simplified approach to running the needed utilities without having to port code into the java script language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the XM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the vlc-plugin.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer</id>
		<title>ECE497 Project Remote Web Cam Viewer</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/ECE497_Project_Remote_Web_Cam_Viewer"/>
				<updated>2012-11-14T04:56:11Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Highlights */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Draneaw|Alexander W. Drane]], [[user:Lobdeljt|John Lobdel]]&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;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions &lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 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 this.&lt;br /&gt;
&lt;br /&gt;
Score:  10/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
The goal of this project is to create a simple webcam based security system that allows a user to remotely view the devices web cam by navigating to a webpage. Then using buttons the user can change what camera they are viewing.&lt;br /&gt;
&lt;br /&gt;
//Give two sentences telling what works.&lt;br /&gt;
Currently we have the ability to select a camera and view the stream in a remote webpage. This view uses the VLC Plugin.&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what isn't working.&lt;br /&gt;
Currently we do not have the system switching between camera's via user inputs. We have not tested with multiple cameras.&lt;br /&gt;
&lt;br /&gt;
End with a two sentence conclusion.&lt;br /&gt;
Investigation of how to accomplish this task took up the bulk of our time and effort due to the infancy of HTML5 Related standards(sockets.io and MediaStream). We decided to utilize the vlc plugin when solving the problem with HTML5 proved unfeasible at its current level of development.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Extra Hardware Required:&lt;br /&gt;
*Webcam 1+ (or Playstation Eye's) Max 4 without other supplementary hardware. Best performing build currently is 2 web cams on the board. 4 makes the XM Slow down too much.&lt;br /&gt;
&lt;br /&gt;
*Connected to the internet.&lt;br /&gt;
&lt;br /&gt;
First Download the git Repository, it is located here:[https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ '''mkdir WebcamFeed'''&lt;br /&gt;
xm$ '''git clone https://github.com/jtlobdell/bbWebcamFeed.git WebcamFeed'''&lt;br /&gt;
xm$ '''cd WebcamFeed'''&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install Node.js&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ '''opkg update'''&lt;br /&gt;
xm$ '''opkg install nodejs'''&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Verify gstreamer is available and up to date&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ '''opkg update'''&lt;br /&gt;
xm$ '''opkg install gstreamer'''&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
One last thing must be done on the user computer. VLC Media Player Plugin must be available in your browser of choice. This can be done by downloading the software here: [[http://www.videolan.org/vlc/index.html]]  and making sure during installation to install the browser plugin. Many modern browsers will guide you through this if you run into a page that requires a missing plugin. &lt;br /&gt;
&lt;br /&gt;
Now for reference type the following you will need it quite soon&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ '''ifconfig'''&lt;br /&gt;
 &amp;lt;/source&amp;gt;&lt;br /&gt;
Take note of the IP Address as you will need to enter it in your user's web browser and to align to the video feed. (This is due to the address being in the client HTML file and not able to be easily informed of its source IP Address.)&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
Move to the source directory&lt;br /&gt;
xm$ '''cd ./WebcamFeeds/'''&lt;br /&gt;
&lt;br /&gt;
Once the instillation is done the program can be ran&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
xm$ '''node WebcamFeed.js'''&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate on the user computer using a web browser to your computers IP Address. Once there click on the link to the video feed page. The program will start and video should play.&lt;br /&gt;
&lt;br /&gt;
NOTE: When changing video feeds the XM will randomly not load and play the feed. This we believe is due to the physical limitations of the hardware. We tested this by attaching 4 webcams to the board and found that the failure rate went up drastically. When the extra 2 webcams were removed the failure rate returned to where it was before. Since the program only ever calls one feed at a time(it changes which device it targets) this has to be a memory or hardware related issue and not due to the software.&lt;br /&gt;
&lt;br /&gt;
At the top of the screen is a text box which can be entered the desired video device. Each camera is added sequentially starting at 0. Below the Set Cam button are two buttons for convenience. These function identically as entering the number's 1 or 0 into the text box and clicking Set Cam.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
A single video is captured from a web cam and streamed to a web page. The video capture device can be selected from the same page.&lt;br /&gt;
&lt;br /&gt;
The software allows for as many video capture devices (webcams) as can be connected to the device. In the case of the Beagle Board xM, up to four cameras can be used.&lt;br /&gt;
&lt;br /&gt;
[http://youtu.be/kPK35JGzazY Here is a YouTube video demo of the four camera operation].&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;
*Research- Research took up the bulk of our time and effort on this project due to the obscure nature of video streaming on the web using HTML5 and related tools. Most sources online advise you to use a plugin or third party software and treat the idea of using Javascript of HTML5 for this task as a taboo subject. &lt;br /&gt;
**GStreamer Implementation- John Lobdel investigated using GStreamer to acomplish this project. This implementation in the end proved effective and the easiest to implement. &lt;br /&gt;
**HTML5/JavaScript Implementation - Alex Drane investigated using a pure HTML5 implementation in order to not require anything to be done by the user to view the video streams. From initial research this appeared to be something that could be done quite easily. After considerable research wading through the draft standards that have been developed I found very little sample code or examples that pertained to remote video viewing. The easiest implementation I found was using it to create a 1-to-1 chat application. This is not suitable for our needs.&lt;br /&gt;
&lt;br /&gt;
*Program Creation- John Lobdel used his research to get gstreamer to stream a video or camera input onto port 8081 that could then be read by the VLC Media Player on a remote computer. The further integration of this into a program was done with the introduction of the VLC-plugin in an html document. The final program was jointly compiled by both John and Alex.&lt;br /&gt;
&lt;br /&gt;
The program creation went quite fast after a working method was discovered by John. Then it was a matter of putting the pieces together. The program consists of a node.js client server using the example provided in the examples/node.js folder, which provides the HTML server and controls for which video to stream. We embedded the vlc viewer into the page and pointed it to the location where the video would be streamed by an external function call in the .js file. This allows for a simplified approach to running the needed utilities without having to port code into the java script language.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Adding video capture would add true security camera capabilities to this system. In addition adding motion detection into the video selection stream would be interesting. Though this might be too much for the XM's hardware. &lt;br /&gt;
&lt;br /&gt;
Having a webpage that displayed all of the video feeds at once would also be an interesting feature but this could over tax the XM's hardware or internet connection.&lt;br /&gt;
&lt;br /&gt;
Figuring out how to implement this project with only HTML5 and make it so that no plugin is required by the end user was Alex's original plan but the maturity of the knowledge base for HTML5 is not adequate to accomplish this task at this time. But in the future when many of the draft standards are finished this project could be implemented without the vlc-plugin.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
This project was quite surprising by how difficult it is to do using the new HTML5 standards. Through the research we learned that there were currently no simple implementations of what we wished to do with this project. We had originally assumed that something as common as video streaming would have a direct implementation in the new standard but in fact it is far more restricted then we expected. By splitting each of our focuses during the research stage we were able to research the use of the bleeding edge of development and the use of the common implementation and then whoever found an implementation that worked first would allow the project to progress. In addition our parallel research gave us greater insight into the potential ways of accomplishing this task then if we had both focused on the HTML5 implementation and did not allow the project to reach a dead end as it would have if we had both focused on the HTML5 method. &lt;br /&gt;
&lt;br /&gt;
In the end we did settle on using the vlc-plugin to capture the outgoing stream that John setup using gstreamer. This worked exactly as we wished it to without all of the syntax fighting that took place when trying to port the HTML5 sample code into code we had the codex's for(i.e. websocket to socket.io syntax Note: websocket wanted a Microsoft related XML file which after searching for could not be found when we tried to just use websocket). &lt;br /&gt;
&lt;br /&gt;
Many of the ideas listed in Future Work would be amazing addon's to the project that would greatly expand and enhance this projects implementation.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/User:Lobdeljt</id>
		<title>User:Lobdeljt</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/User:Lobdeljt"/>
				<updated>2012-11-08T16:49:25Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497|ULo]]&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/EBC_Exercise_25_Configuring_U-boot</id>
		<title>EBC Exercise 25 Configuring U-boot</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/EBC_Exercise_25_Configuring_U-boot"/>
				<updated>2012-11-05T17:28:25Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Assignment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:BeagleBoard]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
This follows the approach taken in [[EBC Exercise 13 Configuring the Kernel]].  We'll use '''bitbake''' to get the source files for U-boot and then we'll edit them.&lt;br /&gt;
&lt;br /&gt;
== bitbake ==&lt;br /&gt;
&lt;br /&gt;
When you did [[EBC Exercise 22 Cross-Compiling and Finding the Right Kernel]] u-boot was downloaded and compiled.  If you used the default configure, the source code was removed once it was done.  Check and see:&lt;br /&gt;
&lt;br /&gt;
 host$ '''cd ~/BeagleBoard/oe/build/tmp-angstrom_v2012_05-eglibc/work/beagleboard-angstrom-linux-gnueabi/'''&lt;br /&gt;
 host$ '''ls'''&lt;br /&gt;
&lt;br /&gt;
You should see a directory starting with &amp;lt;code&amp;gt;u-boot-&amp;lt;/code&amp;gt;.  The rest of the name tells what version you have.  Change to that directory and see what's there:&lt;br /&gt;
&lt;br /&gt;
 host$ '''cd u-boot-*'''&lt;br /&gt;
 host$ '''ls'''&lt;br /&gt;
&lt;br /&gt;
If you see a '''git''' directory, you are in luck. If you see just a '''temp''' directory you need to go back to [[EBC Exercise 22 Cross-Compiling and Finding the Right Kernel]] and get it installed.&lt;br /&gt;
&lt;br /&gt;
Once you have the '''git''' directory, ''cd'' to it and look around.&lt;br /&gt;
&lt;br /&gt;
== Compiling U-boot ==&lt;br /&gt;
&lt;br /&gt;
You can now compile U-boot. &lt;br /&gt;
&lt;br /&gt;
 host$ '''source ~/.oe/crossCompileEnv.sh'''&lt;br /&gt;
 host$ '''make'''&lt;br /&gt;
 host$ '''scp u-boot.bin root@beagle:.'''&lt;br /&gt;
&lt;br /&gt;
On the beagle, first be sure the FAT partition is mounted&lt;br /&gt;
 beagle$ '''cd /media/'''&lt;br /&gt;
 beagle$ '''mkdir mmcblk0p1'''&lt;br /&gt;
 beagle$ '''mount /dev/mmcblk0p1 mmcblk0p1/'''&lt;br /&gt;
 beagle$ '''cd mmcblk0p1/'''&lt;br /&gt;
 beagle$ '''ls -ls'''&lt;br /&gt;
 total 354&lt;br /&gt;
   2 drwxr-xr-x 4 root root   2048 May 16 15:29 Docs&lt;br /&gt;
   2 drwxr-xr-x 5 root root   2048 May 16 15:29 Drivers&lt;br /&gt;
   6 -rwxr-xr-x 1 root root   5829 Aug 14 10:10 LICENSE.txt&lt;br /&gt;
  84 -rwxr-xr-x 1 root root  85058 Aug 14 08:19 MLO&lt;br /&gt;
  14 -rwxr-xr-x 1 root root  13976 Aug 14 10:10 README.htm&lt;br /&gt;
   2 -rwxr-xr-x 1 root root     27 Aug 14 10:23 Uenv.txt&lt;br /&gt;
   2 -rwxr-xr-x 1 root root    178 Aug 14 10:10 autorun.inf&lt;br /&gt;
   2 -rwxr-xr-x 1 root root    171 Aug 14 10:10 info.txt&lt;br /&gt;
 238 -rwxr-xr-x 1 root root 241948 Aug 14 08:19 u-boot.img&lt;br /&gt;
   2 -rwxr-xr-x 1 root root     33 Aug 14 10:23 uEnv.txt.orig&lt;br /&gt;
&lt;br /&gt;
Make a backup of the original u-boot.&lt;br /&gt;
 beagle$ '''cp u-boot.bin u-boot.bin.orig'''&lt;br /&gt;
 beagle$ '''cp ~/u-boot.bin .'''&lt;br /&gt;
 beagle$ shutdown -r now&lt;br /&gt;
&lt;br /&gt;
You should now be running the new u-boot.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;Assignment&amp;lt;/span&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Modify u-boot to include your initials in the prompt. (Hint:  Look for the '''omap3_beagle.h''' file for the xM or '''am335x_evm.h''' for the bone.)&lt;br /&gt;
# Learn what is done when the '''boot''' command in entered in u-boot.&lt;br /&gt;
# Find where the code for boot is defined in the u-boot source.&lt;br /&gt;
&lt;br /&gt;
Hint:&lt;br /&gt;
 u-boot# '''help boot'''&lt;br /&gt;
 boot - boot default, i.e., run 'bootcmd'&lt;br /&gt;
 &lt;br /&gt;
 Usage:&lt;br /&gt;
 boot &lt;br /&gt;
 u-boot# '''print bootcmd'''&lt;br /&gt;
 bootcmd=if mmc rescan ${mmcdev}; then if userbutton; then setenv bootenv user.txt;fi;echo SD/MMC found on device ${mmcdev};if run loadbootenv; then echo Loaded environment from ${bootenv};run importbootenv;fi;if test -n $uenvcmd; then echo Running uenvcmd ...;run uenvcmd;fi;if run loaduimage; then run mmcboot;fi;fi;run nandboot;&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</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-11-05T06:13:08Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: &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;
| [[user:Xinyu1991 | Xinyu Cheng]]&lt;br /&gt;
| 31-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[user:bssachin45 | B S Sachin]]&lt;br /&gt;
| 25-July-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[user:ruff | Ruffin White]]&lt;br /&gt;
| 16-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[user:Popenhjc | James Popenhagen]]&lt;br /&gt;
| 30-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[user:mmoravec | Matthew Moravec]]&lt;br /&gt;
| 30-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[user:ngop | Peter Ngo]]&lt;br /&gt;
| 30-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[user:duganje | Josh Dugan]]&lt;br /&gt;
| 30-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[user:hansenrl | Ross Hansen]]&lt;br /&gt;
| 30-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[user:jungeml | Michael Junge]]&lt;br /&gt;
| 05-September-2012&lt;br /&gt;
|- &lt;br /&gt;
| [[User:shinnsm|Stephen Shinn]]&lt;br /&gt;
| 30-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[User:draneaw|Alex Drane]]&lt;br /&gt;
| 30-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[User:larmorgs|Greg Larmore]]&lt;br /&gt;
| 31-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[User:jessebrannon|Jesse Brannon]]&lt;br /&gt;
| 31-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[User:lix|Xia Li]]&lt;br /&gt;
| 31-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[User:whiteer|Elias White]]&lt;br /&gt;
| 31-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Astroricks|Yue Zhang]]&lt;br /&gt;
| 31-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[User:millerap|Andrew Miller]]&lt;br /&gt;
| 31-August-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[user:Geislekj | Kevin Geisler]]&lt;br /&gt;
| 1-September-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[user:chris.good | Christopher A Good]]&lt;br /&gt;
| 3-September-2012&lt;br /&gt;
|-&lt;br /&gt;
| [[user:Lobdeljt | John Lobdell]]&lt;br /&gt;
| 5-November-2012&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>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/EBC_Exercise_26_Device_Drivers</id>
		<title>EBC Exercise 26 Device Drivers</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/EBC_Exercise_26_Device_Drivers"/>
				<updated>2012-11-05T05:47:06Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
Chapter 8 of the text [http://www.amazon.com/Embedded-Linux-Primer-Practical-Real-World/dp/0137017839] gives a nice example of a minimal device driver.  The purpose of this lab is to implement that driver.&lt;br /&gt;
&lt;br /&gt;
== Minimal Device Driver Example ==&lt;br /&gt;
&lt;br /&gt;
=== Compiling ===&lt;br /&gt;
&lt;br /&gt;
Follow the 5 steps given in Section 8.1.4 on page 205.  You can get a copy of Listing 8-1 here ([[ECE497_Listings_for_Embedded_Linux_Primer_Chapter_8]]).  Once finished you will have a file called &amp;lt;code&amp;gt;hello1.c&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;.../drivers/char/examples&amp;lt;/code&amp;gt; and have the kernel configure file and Makefile updated for the new driver.   See Section 4.4 on page 89 for help with modifying the config files.&lt;br /&gt;
&lt;br /&gt;
Note:  There is a typo in Listing 8-2.&lt;br /&gt;
&lt;br /&gt;
If you have created the '''crossCompileEnv.sh''' file and sourced it, all you have to do to make the modules is cd to the top of the kernel directory and then:&lt;br /&gt;
&lt;br /&gt;
 host$ '''source ~/.oe/crossCompileEnv.sh'''  (Only need to run once per terminal session.)&lt;br /&gt;
 host$ '''make modules'''  (or make -j''X'' modules, where ''X'' = number of cores on host.)&lt;br /&gt;
&lt;br /&gt;
Mine took a while the first time as it compiles all the modules. The second it only took 31 seconds.&lt;br /&gt;
&lt;br /&gt;
If you want to install all the modules that are created. &lt;br /&gt;
&lt;br /&gt;
 host$ '''make INSTALL_MOD_PATH=~/BeagleBoard modules_install'''&lt;br /&gt;
&lt;br /&gt;
This will create '''lib''' directory in '''~/BeagleBoard''' with everything that goes in '''/lib''' on the Beagle. Then &lt;br /&gt;
&lt;br /&gt;
 host$ '''rsync --progress -avhe ssh ~/BeagleBoard/lib root@beagle:/'''&lt;br /&gt;
&lt;br /&gt;
Could take a while to transfer.&lt;br /&gt;
&lt;br /&gt;
====Improvements to the Code in the Book====&lt;br /&gt;
The code in Listing 8-10 is incomplete.  If you compile it as is and load the module, it will work, but if you then remove the module and try to reinsert it it will fail with an error like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ERROR GOES HERE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The reason for this is that the module is registered with the kernel on load with a command like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
register_chrdev(MAJOR_NUMBER, NAME, FILE_OPERATIONS*);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
But it is never unregistered when the module is unloaded.  To properly unload the module, add this line of code to your module's exit function&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unregister_chrdev(MAJOR_NUMBER, NAME);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This will properly unregister the module from the kernel and allow it to be inserted and removed from the kernel at will without restarting your system in between.&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;Listing 8-10 also uses the ioctl field in the file_operations struct. Newer kernels have removed this. If the code from the listing complains about ioctl being an unknown field, use unlocked_ioctl in its place:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct file_operations hello_fops = {&lt;br /&gt;
    owner:           THIS_MODULE,&lt;br /&gt;
    read:            hello_read,&lt;br /&gt;
    write:           hello_write,&lt;br /&gt;
    unlocked_ioctl:  hello_ioctl,&lt;br /&gt;
    open:            hello_open,&lt;br /&gt;
    release:         hello_release,&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Moving to Beagle ===&lt;br /&gt;
&lt;br /&gt;
On the beagle edit &amp;lt;code&amp;gt;/lib/modules/2.6.32/modules.dep&amp;lt;/code&amp;gt; and add&lt;br /&gt;
&lt;br /&gt;
 /lib/modules/2.6.32/kernel/drivers/char/examples/hello1.ko:&lt;br /&gt;
&lt;br /&gt;
Then copy the file &amp;lt;code&amp;gt;…/drivers/char/examples/hello1.ko&amp;lt;/code&amp;gt; on the host computer to &amp;lt;code&amp;gt;/lib/modules/2.6.32/kernel/drivers/char/examples/&amp;lt;/code&amp;gt; on your Beagle.  This can be done with a single command though you may have to mkdir the char/examples directory on the Beagle first.&lt;br /&gt;
&lt;br /&gt;
 host$ '''cd …/drivers/char/examples'''&lt;br /&gt;
 host$ '''scp hello1.ko root@beagle:/lib/modules/2.6.32/kernel/drivers/char/examples'''&lt;br /&gt;
&lt;br /&gt;
I suggest putting the &amp;lt;code&amp;gt;scp&amp;lt;/code&amp;gt; command in the &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; since you may use it several times while developing your code.&lt;br /&gt;
&lt;br /&gt;
Now, on the Beagle, add the module to '''modules.dep'''&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd /lib/modules/2.6.32'''&lt;br /&gt;
 beagle$ '''gedit modules.dep'''&lt;br /&gt;
&lt;br /&gt;
Add the path to your new module and save.  You will also have to move the '''modules.dep.bin''', otherwise the beagle will read from it rather than the modules.dep.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''mv modules.dep.bin modules.dep.bin.orig'''&lt;br /&gt;
&lt;br /&gt;
Now, modprobe the module and check the log file.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''modprobe hello1'''&lt;br /&gt;
 beagle$ '''dmesg | tail -4'''&lt;br /&gt;
&lt;br /&gt;
You should see your Init message.  And then...&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''modprobe -r hello1'''&lt;br /&gt;
 beagle$ '''dmesg | tail -4'''&lt;br /&gt;
&lt;br /&gt;
should show your Exit message.&lt;br /&gt;
&lt;br /&gt;
== Module Parameters ==&lt;br /&gt;
&lt;br /&gt;
Section 8.1.7 on page 211 of the text shows how to pass a parameter to a module.  Modify your &amp;lt;code&amp;gt;hello1.c&amp;lt;/code&amp;gt; to take a parameter as shown.&lt;br /&gt;
&lt;br /&gt;
Modify it so you can pass two parameters.&lt;br /&gt;
&lt;br /&gt;
== Module Utilities ==&lt;br /&gt;
&lt;br /&gt;
Play with the mod utilities listed in section 8.2 on page 212.&lt;br /&gt;
&lt;br /&gt;
== Driver Methods ==&lt;br /&gt;
&lt;br /&gt;
Section 8.3 on page 217 gives a longer example of how to use the file interface with modules.  Implement the example.  Be sure to fix the ''unsigned int'' format error, and make sure your &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt; function unregisters the device (unlike the Listing).  When compiling the &amp;lt;code&amp;gt;use-hello&amp;lt;/code&amp;gt; command be sure you are using the cross compiler for the ARM rather than the x86 compiler.  If you sourced the '''crossCompilerEnv.sh''' file this should work:&lt;br /&gt;
&lt;br /&gt;
 host$ '''${CROSS_COMPILE}gcc use-hello.c -o use-hello''' &lt;br /&gt;
 host$ '''file use-hello'''&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;file&amp;lt;/code&amp;gt; command will tell you if you got the right compiler. Modify your &amp;lt;code&amp;gt;Makefile&amp;lt;/code&amp;gt; to make &amp;lt;code&amp;gt;use-hello&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Some questions...&lt;br /&gt;
* The major device number 234 is part of a range of unassigned numbers.  What is the range?&lt;br /&gt;
* What's the new line added to &amp;lt;code&amp;gt;hello_init&amp;lt;/code&amp;gt; do?&lt;br /&gt;
* What does &amp;lt;code&amp;gt;mknod&amp;lt;/code&amp;gt; do?&lt;br /&gt;
* Once your device is running try &amp;lt;code&amp;gt;$ cat /proc/devices&amp;lt;/code&amp;gt;.  Do you see your device?&lt;br /&gt;
&lt;br /&gt;
=== Optional Driver Work ===&lt;br /&gt;
&lt;br /&gt;
Chapter 3 of ''Linux Device Drivers'' by Corbet, Rubini and Kroah-Hartman ([http://www.rose-hulman.edu/~yoder/Beagle/]) gives some more details on device drivers. Our text uses an older, static, method for major device number allocation.  The book, referenced above, uses the newer dynamic allocation.  &lt;br /&gt;
* Convert the example in our text to use the newer method.  It's only a couple of additional lines, but you will have to read the book to know how to do it.  &lt;br /&gt;
* Modify the ''scull_load'' script (call it ''hello_load'') on page 47, of chapter 3, to load your module.  Hint:  the back quotes are missing in this line in the text:&lt;br /&gt;
&lt;br /&gt;
 major=`awk &amp;quot;\\$2==\&amp;quot;$module\&amp;quot; {print \\$1}&amp;quot; /proc/devices)`&lt;br /&gt;
 &lt;br /&gt;
* Test it with &amp;lt;code&amp;gt;use-hello.c&amp;lt;/code&amp;gt; from page 222 of ''Embedded Linux Primer''.&lt;br /&gt;
* Write a ''hello_unload'' script that will rmmod the driver and remove the nodes in /dev&lt;br /&gt;
* Modify ''hello.c'' to pass the major device number in as a parameter during &amp;lt;code&amp;gt;insmod&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Optional: Stretch time, I though these would be easy, but after reading up on them, they look rather involved.&lt;br /&gt;
* How can your driver find what the minor device number is?&lt;br /&gt;
* Modify the driver to return some characters when &amp;lt;code&amp;gt;/dev/hello1&amp;lt;/code&amp;gt; is read.&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
&lt;br /&gt;
[http://www.cnx-software.com/2011/08/19/how-to-write-and-submit-a-linux-kernel-patch/ How to Write and Submit a Linux Kernel Patch]&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/File:Adafruit_Rotary_Encoder_in_BeagleBone.jpg</id>
		<title>File:Adafruit Rotary Encoder in BeagleBone.jpg</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/File:Adafruit_Rotary_Encoder_in_BeagleBone.jpg"/>
				<updated>2012-10-24T05:41:08Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: uploaded a new version of &amp;amp;quot;File:Adafruit Rotary Encoder in BeagleBone.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Adafruit Rotary Encoder hooked up to the BeagleBone.&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Adafruit:_Rotary_Encoder</id>
		<title>Adafruit: Rotary Encoder</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Adafruit:_Rotary_Encoder"/>
				<updated>2012-10-24T05:40:23Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     1&lt;br /&gt;
git/Compiles with make: 1&lt;br /&gt;
Demo:     0&lt;br /&gt;
Total:    7/10&lt;br /&gt;
Comments: Address the concerns in Red below.&lt;br /&gt;
&lt;br /&gt;
Please move your functions definitions to a .c file.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Adafruit_Rotary_Encoder.jpg|thumb|Adafruit's Rotary Encoder]]&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
[http://adafru.it/377 Adafruit's Rotary Encoder] is a device that detects rotation. As it rotates, it sends pulses on two pins. By comparing the signals, the direction of rotation can be determined. There are 24 pulses per rotation. The device also acts as a pushbutton switch.&lt;br /&gt;
&lt;br /&gt;
==Inputs and Outputs==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;color:red&amp;quot;&amp;gt;The datasheet shows common in the middle.  Please check.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The device has five pins - three on one side and two on the other. The side with three pins is for the encoder and is ordered (from left to right) signal A, ground, and signal B. The side with two pins is for the pushbutton switch. The signal pins require the use of pullup resistors, and the switch should use either a pullup or pulldown resistor. More information can be found on the [http://adafru.it/377 product page] or on the [http://www.adafruit.com/datasheets/pec11.pdf datasheet].&lt;br /&gt;
&lt;br /&gt;
==Bone Usage==&lt;br /&gt;
&lt;br /&gt;
The pins on the device can be difficult to use with a bread board, so it may be useful to solder the devide to a perfboard and add connectors. [[File:Adafruit_Rotary_Encoder_With_Connectors.jpg|thumb|Rotary encoder with connectors added]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;color:red&amp;quot;&amp;gt;What about pullup resistors?  The default is for gpio38 (1_6) to be pull up and gpio48 (1_16) to be pull down.  Is this intended?&amp;lt;/blockquote&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two signal pins and one of the pushbutton pins can be hooked up directly to any of the GPIO ports on the BeagleBone. The pins should then be configured as pullups for the signal pins and either pullup or pulldown for the switch pin. The remaining pins can be hooked up to GND and +3,3v. The example below uses GPIO1_6 for signal A, GPIO1_15 for signal B, and GPIO1_16 for the pushbutton switch. [[File:Adafruit_Rotary_Encoder_in_BeagleBone.jpg|thumb|Rotary encoder hooked up to the BeagleBone]]&lt;br /&gt;
&lt;br /&gt;
The C code below demonstrates how to use the encoder with the BeagleBone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote style=&amp;quot;color:red&amp;quot;&amp;gt;Generally functions aren't defined in .h files.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
&lt;br /&gt;
Port Congiguration:&lt;br /&gt;
-Encoder A: GPIO1_6 - Header P8, pin 3 - GPIO 38&lt;br /&gt;
-Encoder B: GPIO1_15 - Header P8, pin 15 - GPIO 47&lt;br /&gt;
-Encoder GND: Header P8, pin 1&lt;br /&gt;
&lt;br /&gt;
-Pushbutton Switch: GPIO1_16 - Header P9, pin 15 - GPIO 48&lt;br /&gt;
-Pusshbuton Switch V+: Header P9, pin 3&lt;br /&gt;
&lt;br /&gt;
This program keeps track of an encoder. CW rotation will&lt;br /&gt;
increment the ticks, and CCW will decrement it. The current&lt;br /&gt;
number of ticks is printed when the button is pressed.&lt;br /&gt;
&lt;br /&gt;
The files gpio.h and gpio.c  consist of the GPIO methods copied&lt;br /&gt;
directly from:&lt;br /&gt;
https://www.ridgerun.com/developer/wiki/index.php/Gpio-int-test.c&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define OMAP_DIR &amp;quot;/sys/kernel/debug/omap_mux&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int running = 1;&lt;br /&gt;
&lt;br /&gt;
// Quit when ^C is pressed&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf(&amp;quot;\n&amp;quot;);&lt;br /&gt;
	running = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
	// Polling variables&lt;br /&gt;
	int rc;&lt;br /&gt;
	struct pollfd fdset[3];&lt;br /&gt;
	int nfds = 3;&lt;br /&gt;
	int len;&lt;br /&gt;
	char* buf[MAX_BUF];&lt;br /&gt;
&lt;br /&gt;
	// Keeps track of encoder ticks.&lt;br /&gt;
	int ticks = 0;&lt;br /&gt;
&lt;br /&gt;
	// Variables used to store GPIO values&lt;br /&gt;
	unsigned int enc_a_val;&lt;br /&gt;
	unsigned int enc_b_val;&lt;br /&gt;
	unsigned int sw_val;&lt;br /&gt;
&lt;br /&gt;
	// Handle Ctrl^C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
        // Configure the pins to use internal pull-down resistors&lt;br /&gt;
        FILE *mux_ptr;&lt;br /&gt;
        char pullup_str[10];&lt;br /&gt;
	char pulldown_str[10];&lt;br /&gt;
        strcpy(pullup_str, &amp;quot;0x0037&amp;quot;);&lt;br /&gt;
	strcpy(pulldown_str, &amp;quot;0x0027&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // Configure pull-up for the A signal&lt;br /&gt;
        if ((mux_ptr = fopen(OMAP_DIR &amp;quot;/gpmc_ad6&amp;quot;, &amp;quot;rb+&amp;quot;)) == NULL)&lt;br /&gt;
        {&lt;br /&gt;
                printf(&amp;quot;Failed to open gpmc_ad6. Quitting.\n&amp;quot;);&lt;br /&gt;
                exit(1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
	{&lt;br /&gt;
                fwrite(&amp;amp;pullup_str, sizeof(char), 6, mux_ptr);&lt;br /&gt;
                fclose(mux_ptr);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Configure pull-up for the B signal&lt;br /&gt;
        if ((mux_ptr = fopen(OMAP_DIR &amp;quot;/gpmc_ad15&amp;quot;, &amp;quot;rb+&amp;quot;)) == NULL)&lt;br /&gt;
        {&lt;br /&gt;
                printf(&amp;quot;Failed to open gpmc_ad15. Quitting.\n&amp;quot;);&lt;br /&gt;
                exit(1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
	{&lt;br /&gt;
                fwrite(&amp;amp;pullup_str, sizeof(char), 6, mux_ptr);&lt;br /&gt;
                fclose(mux_ptr);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        // Configure pull-down for the switch&lt;br /&gt;
        if ((mux_ptr = fopen(OMAP_DIR &amp;quot;/gpmc_a0&amp;quot;, &amp;quot;rb+&amp;quot;)) == NULL)&lt;br /&gt;
        {&lt;br /&gt;
                printf(&amp;quot;Failed to open gpmc_a0. Quitting.\n&amp;quot;);&lt;br /&gt;
                exit(1);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
	{&lt;br /&gt;
                fwrite(&amp;amp;pulldown_str, sizeof(char), 6, mux_ptr);&lt;br /&gt;
                fclose(mux_ptr);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
	// Set up GPIO pins&lt;br /&gt;
	unsigned int gpio_a = 38;&lt;br /&gt;
	unsigned int gpio_b = 47;&lt;br /&gt;
	unsigned int gpio_sw = 48;&lt;br /&gt;
&lt;br /&gt;
	int enc_a_fd;&lt;br /&gt;
	int enc_b_fd;&lt;br /&gt;
	int enc_sw_fd;&lt;br /&gt;
&lt;br /&gt;
	printf(&amp;quot;Exporting a... %d\n&amp;quot;, gpio_export(gpio_a));&lt;br /&gt;
	printf(&amp;quot;Exporting b... %d\n&amp;quot;, gpio_export(gpio_b));&lt;br /&gt;
	printf(&amp;quot;Exporting sw... %d\n&amp;quot;, gpio_export(gpio_sw));&lt;br /&gt;
&lt;br /&gt;
	printf(&amp;quot;Setting a direction... %d\n&amp;quot;, gpio_set_dir(gpio_a, 0));&lt;br /&gt;
	printf(&amp;quot;Setting b direction... %d\n&amp;quot;, gpio_set_dir(gpio_b, 0));&lt;br /&gt;
	printf(&amp;quot;Setting sw direction... %d\n&amp;quot;, gpio_set_dir(gpio_sw, 0));&lt;br /&gt;
&lt;br /&gt;
	// Interrupts&lt;br /&gt;
	printf(&amp;quot;setting edge a... %d\n&amp;quot;, gpio_set_edge(gpio_a, &amp;quot;rising&amp;quot;));&lt;br /&gt;
	printf(&amp;quot;setting edge sw... %d\n&amp;quot;, gpio_set_edge(gpio_sw, &amp;quot;rising&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	// Open the file for the encoder A signal&lt;br /&gt;
	enc_a_fd = gpio_fd_open(gpio_a);&lt;br /&gt;
	enc_sw_fd = gpio_fd_open(gpio_sw);&lt;br /&gt;
&lt;br /&gt;
	// Main loop&lt;br /&gt;
	while (running == 1)&lt;br /&gt;
	{&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 = enc_a_fd;&lt;br /&gt;
		fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		fdset[2].fd = enc_sw_fd;&lt;br /&gt;
		fdset[2].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		rc = poll(fdset, nfds, -1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if (rc &amp;lt; 0)&lt;br /&gt;
		{&lt;br /&gt;
//			printf(&amp;quot;poll() failed.\n&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (rc == 0)&lt;br /&gt;
		{&lt;br /&gt;
//			printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLIN)&lt;br /&gt;
		{&lt;br /&gt;
			(void) read(fdset[0].fd, buf, 1);&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Encoder click&lt;br /&gt;
		if (fdset[1].revents &amp;amp; POLLPRI)&lt;br /&gt;
		{&lt;br /&gt;
			lseek(fdset[1].fd, 0, SEEK_SET);&lt;br /&gt;
			len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
&lt;br /&gt;
			enc_a_val = atoi((const char*) buf);&lt;br /&gt;
			gpio_get_value(gpio_b, &amp;amp;enc_b_val);&lt;br /&gt;
&lt;br /&gt;
			if (enc_a_val == 1) // rising edge&lt;br /&gt;
			{&lt;br /&gt;
				if (enc_b_val == 0) ticks--;&lt;br /&gt;
				else ticks++;&lt;br /&gt;
			}&lt;br /&gt;
&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
		// Button press - print the current number of encoder ticks&lt;br /&gt;
		if (fdset[2].revents &amp;amp; POLLPRI)&lt;br /&gt;
		{&lt;br /&gt;
			lseek(fdset[2].fd, 0, SEEK_SET);&lt;br /&gt;
			len = read(fdset[2].fd, buf, MAX_BUF);&lt;br /&gt;
&lt;br /&gt;
			// Very simple debouncing&lt;br /&gt;
			usleep(5000);&lt;br /&gt;
			gpio_get_value(gpio_sw, &amp;amp;sw_val);&lt;br /&gt;
			if (sw_val == 1)&lt;br /&gt;
			{&lt;br /&gt;
				printf(&amp;quot;Ticks: %d\n&amp;quot;, ticks);&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(enc_a_fd);&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full code can be found in [https://github.com/jtlobdell/Adafruit_Rotary_Encoder_BeagleBone John Lobdell's Git repository].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Interfacing with node.js==&lt;br /&gt;
&lt;br /&gt;
Interfacing it with node.js is relatively straight-forward. The code is shwon below, and can be found in [https://github.com/jtlobdell/Adafruit_Rotary_Encoder_BeagleBone John Lobdell's Git repository].&lt;br /&gt;
&lt;br /&gt;
rotary_encoder.js:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// From Getting Started With node.js and socket.io &lt;br /&gt;
// http://codehenge.net/blog/2011/12/getting-started-with-node-js-and-socket-io-v0-7-part-2/&lt;br /&gt;
&amp;quot;use strict&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
var http = require('http'),&lt;br /&gt;
    url = require('url'),&lt;br /&gt;
    fs = require('fs'),&lt;br /&gt;
    exec = require('child_process').exec,&lt;br /&gt;
    server,&lt;br /&gt;
    connectCount = 0;	// Number of connections to server&lt;br /&gt;
&lt;br /&gt;
server = http.createServer(function (req, res) {&lt;br /&gt;
// server code&lt;br /&gt;
    var path = url.parse(req.url).pathname;&lt;br /&gt;
    console.log(&amp;quot;path: &amp;quot; + path);&lt;br /&gt;
    switch (path) {&lt;br /&gt;
    case '/':&lt;br /&gt;
        res.writeHead(200, {'Content-Type': 'text/html'});&lt;br /&gt;
        res.write('&amp;lt;h1&amp;gt;John Lobdell - Mini Project 4&amp;lt;/h1&amp;gt;Try&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;/rotary_encoder.html&amp;quot;&amp;gt;Rotary Encoder&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;');&lt;br /&gt;
&lt;br /&gt;
        res.end();&lt;br /&gt;
        break;&lt;br /&gt;
&lt;br /&gt;
    default:		// This is so all the files will be sent.&lt;br /&gt;
        fs.readFile(__dirname + path, function (err, data) {&lt;br /&gt;
            if (err) {return send404(res); }&lt;br /&gt;
//            console.log(&amp;quot;path2: &amp;quot; + path);&lt;br /&gt;
            res.write(data, 'utf8');&lt;br /&gt;
            res.end();&lt;br /&gt;
        });&lt;br /&gt;
        break;&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
var send404 = function (res) {&lt;br /&gt;
    res.writeHead(404);&lt;br /&gt;
    res.write('404');&lt;br /&gt;
    res.end();&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
server.listen(8081);&lt;br /&gt;
&lt;br /&gt;
// socket.io, I choose you&lt;br /&gt;
var io = require('socket.io').listen(server);&lt;br /&gt;
io.set('log level', 2);&lt;br /&gt;
&lt;br /&gt;
// on a 'connection' event&lt;br /&gt;
io.sockets.on('connection', function (socket) {&lt;br /&gt;
    var frameCount = 0;	// Counts the frames from arecord&lt;br /&gt;
    var lastFrame = 0;	// Last frame sent to browser&lt;br /&gt;
    console.log(&amp;quot;Connection &amp;quot; + socket.id + &amp;quot; accepted.&amp;quot;);&lt;br /&gt;
//    console.log(&amp;quot;socket: &amp;quot; + socket);&lt;br /&gt;
&lt;br /&gt;
    // now that we have our connected 'socket' object, we can &lt;br /&gt;
    // define its event handlers&lt;br /&gt;
&lt;br /&gt;
    // Make sure gpio 38, 47, and 48 are available.&lt;br /&gt;
    exec(&amp;quot;echo 38 &amp;gt; /sys/class/gpio/export&amp;quot;);&lt;br /&gt;
    exec(&amp;quot;echo 47 &amp;gt; /sys/class/gpio/export&amp;quot;);&lt;br /&gt;
    exec(&amp;quot;echo 48 &amp;gt; /sys/class/gpio/export&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    // Configure pullup/pulldown resistors&lt;br /&gt;
    exec(&amp;quot;echo 0x0037 &amp;gt; /sys/kernel/debug/omap_mux/gpmc_ad6&amp;quot;); // Pullup for encoder A&lt;br /&gt;
    exec(&amp;quot;echo 0x0037 &amp;gt; /sys/kernel/debug/omap_mux/gpmc_ad15&amp;quot;); // Pullup for encoder B&lt;br /&gt;
    exec(&amp;quot;echo 0x0027 &amp;gt; /sys/kernel/debug/omap_mux/gpmc_a0&amp;quot;); // Pulldown for the switch&lt;br /&gt;
&lt;br /&gt;
    // Handle disconnects&lt;br /&gt;
    socket.on('disconnect', function () {&lt;br /&gt;
        console.log(&amp;quot;Connection &amp;quot; + socket.id + &amp;quot; terminated.&amp;quot;);&lt;br /&gt;
        connectCount--;&lt;br /&gt;
        if(connectCount === 0) {&lt;br /&gt;
        }&lt;br /&gt;
        console.log(&amp;quot;connectCount = &amp;quot; + connectCount);&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
    // Periodically send data&lt;br /&gt;
    var push_interval = 20;&lt;br /&gt;
    function push_data() {&lt;br /&gt;
        // Send encoder A status&lt;br /&gt;
        var gpioPath = &amp;quot;/sys/class/gpio/gpio38/value&amp;quot;;&lt;br /&gt;
        fs.readFile(gpioPath, 'base64', function (err, data) {&lt;br /&gt;
            if (err) throw err;&lt;br /&gt;
            socket.emit('enc_a', data);&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
        // Send encoder B status&lt;br /&gt;
        gpioPath = &amp;quot;/sys/class/gpio/gpio47/value&amp;quot;;&lt;br /&gt;
        fs.readFile(gpioPath, 'base64', function (err, data) {&lt;br /&gt;
            if (err) throw err;&lt;br /&gt;
            socket.emit('enc_b', data);&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        // Send encoder switch status&lt;br /&gt;
        gpioPath = &amp;quot;/sys/class/gpio/gpio48/value&amp;quot;;&lt;br /&gt;
        fs.readFile(gpioPath, 'base64', function (err, data) {&lt;br /&gt;
            if (err) throw err;&lt;br /&gt;
            socket.emit('enc_sw', data);&lt;br /&gt;
        });&lt;br /&gt;
&lt;br /&gt;
        setTimeout(push_data, push_interval);&lt;br /&gt;
    }&lt;br /&gt;
    push_data();&lt;br /&gt;
&lt;br /&gt;
    connectCount++;&lt;br /&gt;
    console.log(&amp;quot;connectCount = &amp;quot; + connectCount);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
rotary_encoder.html:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;!doctype html&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
  &amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;Rotary Encoder Demo&amp;lt;/title&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script src=&amp;quot;/json.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;!-- for ie --&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;/socket.io/socket.io.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;link href=&amp;quot;layout.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;jquery.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;jquery.flot.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;jquery.flot.navigate.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/head&amp;gt;&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;h1&amp;gt;Rotary Encoder Demo &amp;lt;a href=&amp;quot;http://Rose-Hulman.edu&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;img src=&amp;quot;RoseLogo96.png&amp;quot; width=200 style=&amp;quot;float:right&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/h1&amp;gt;&lt;br /&gt;
    &amp;lt;button id=&amp;quot;connect&amp;quot; onClick='connect()'/&amp;gt;Connect&amp;lt;/button&amp;gt;&lt;br /&gt;
    &amp;lt;button id=&amp;quot;disconnect&amp;quot; onClick='disconnect()'&amp;gt;Disconnect&amp;lt;/button&amp;gt;&lt;br /&gt;
&amp;lt;!--    &amp;lt;button id=&amp;quot;send&amp;quot; onClick='send()'/&amp;gt;Send Message&amp;lt;/button&amp;gt; --&amp;gt;&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;div id=&amp;quot;plotTop&amp;quot; style=&amp;quot;width:550px;height:150px;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;samples&amp;lt;/center&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&amp;lt;div id=&amp;quot;plotBot&amp;quot; style=&amp;quot;width:550px;height:150px;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;samples&amp;lt;center&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;a href=&amp;quot;http://beagleboard.org&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;img src=&amp;quot;beagle-hd-logo.gif&amp;quot; width=200 align=&amp;quot;right&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
    &amp;lt;div&amp;gt;&amp;lt;p id=&amp;quot;status&amp;quot;&amp;gt;Waiting for input&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;div&amp;gt;&amp;lt;p id=&amp;quot;ticks&amp;quot;&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
    &amp;lt;a href=&amp;quot;http://www.ti.com/sitara&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;img src=&amp;quot;hdr_ti_logo.gif&amp;quot; width=200 align=&amp;quot;right&amp;quot;&amp;gt;&amp;lt;/a&amp;gt;&lt;br /&gt;
By &amp;lt;i&amp;gt;John Lobdell&amp;lt;/i&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    var socket;&lt;br /&gt;
    var firstconnect = true,&lt;br /&gt;
        fs = 8000,&lt;br /&gt;
        Ts = 1/fs*1000,&lt;br /&gt;
        samples = 100,&lt;br /&gt;
        plotTop,&lt;br /&gt;
        enc_a = [], ienc_a = 0,&lt;br /&gt;
	enc_b = [], ienc_b = 0,&lt;br /&gt;
        sw_data = [], isw_data = 0,&lt;br /&gt;
        gpio_enc_a = 38,&lt;br /&gt;
	gpio_enc_b = 47,&lt;br /&gt;
	gpio_sw = 48;&lt;br /&gt;
&lt;br /&gt;
    enc_a[samples] = 0;&lt;br /&gt;
    enc_b[samples] = 0;&lt;br /&gt;
    sw_data[samples] = 0;&lt;br /&gt;
&lt;br /&gt;
    function connect() {&lt;br /&gt;
      if(firstconnect) {&lt;br /&gt;
        socket = io.connect(null);&lt;br /&gt;
&lt;br /&gt;
        socket.on('message', function(data)&lt;br /&gt;
            { status_update(&amp;quot;Received: message&amp;quot;);});&lt;br /&gt;
        socket.on('connect', function()&lt;br /&gt;
            { status_update(&amp;quot;Connected to Server&amp;quot;); });&lt;br /&gt;
        socket.on('disconnect', function()&lt;br /&gt;
            { status_update(&amp;quot;Disconnected from Server&amp;quot;); });&lt;br /&gt;
        socket.on('reconnect', function()&lt;br /&gt;
            { status_update(&amp;quot;Reconnected to Server&amp;quot;); });&lt;br /&gt;
        socket.on('reconnecting', function( nextRetry )&lt;br /&gt;
            { status_update(&amp;quot;Reconnecting in &amp;quot; + nextRetry/1000 + &amp;quot; s&amp;quot;); });&lt;br /&gt;
        socket.on('reconnect_failed', function()&lt;br /&gt;
            { message(&amp;quot;Reconnect Failed&amp;quot;); });&lt;br /&gt;
&lt;br /&gt;
        socket.on('enc_a', enca);&lt;br /&gt;
        socket.on('enc_b', encb);&lt;br /&gt;
        socket.on('enc_sw', encsw);&lt;br /&gt;
        socket.on('set_ticks', setTicks);&lt;br /&gt;
&lt;br /&gt;
        firstconnect = false;&lt;br /&gt;
&lt;br /&gt;
      }&lt;br /&gt;
      else {&lt;br /&gt;
        socket.socket.reconnect();&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function disconnect() {&lt;br /&gt;
      socket.disconnect();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // When new data arrives, convert it and plot it.&lt;br /&gt;
    function enca(data) {&lt;br /&gt;
//	status_update(&amp;quot;enc_a &amp;quot; + data);&lt;br /&gt;
        data = atob(data);&lt;br /&gt;
        enc_a[ienc_a] = [ienc_a, data];&lt;br /&gt;
        ienc_a++;&lt;br /&gt;
        if (ienc_a &amp;gt;= samples) {&lt;br /&gt;
            ienc_a = 0;&lt;br /&gt;
            enc_a = [];&lt;br /&gt;
        }&lt;br /&gt;
        plotTop.setData([ enc_a, enc_b ]);&lt;br /&gt;
        plotTop.draw();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function encb(data) {&lt;br /&gt;
//	status_update(&amp;quot;enc_b &amp;quot; + data);&lt;br /&gt;
        data = atob(data);&lt;br /&gt;
        enc_b[ienc_b] = [ienc_b, data];&lt;br /&gt;
        ienc_b++;&lt;br /&gt;
        if (ienc_b &amp;gt;= samples) {&lt;br /&gt;
            ienc_b = 0;&lt;br /&gt;
            enc_b = [];&lt;br /&gt;
        }&lt;br /&gt;
        plotTop.setData([ enc_a, enc_b ]);&lt;br /&gt;
        plotTop.draw();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function encsw(data) {&lt;br /&gt;
//        status_update(&amp;quot;encsw &amp;quot; + data);&lt;br /&gt;
        data = atob(data);&lt;br /&gt;
        sw_data[isw_data] = [isw_data, data];&lt;br /&gt;
        isw_data++;&lt;br /&gt;
        if (isw_data &amp;gt;= samples) {&lt;br /&gt;
            isw_data = 0;&lt;br /&gt;
            sw_data = [];&lt;br /&gt;
        }&lt;br /&gt;
        plotBot.setData([ sw_data ]);&lt;br /&gt;
        plotBot.draw();&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function status_update(txt){&lt;br /&gt;
      document.getElementById('status').innerHTML = txt;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function setTicks(numTicks){&lt;br /&gt;
        document.getElementById('ticks').innerHTML = &amp;quot;Ticks: &amp;quot; + numTicks;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    connect();&lt;br /&gt;
&lt;br /&gt;
$(function () {&lt;br /&gt;
&lt;br /&gt;
    function initPlotData() {&lt;br /&gt;
        // zip the generated y values with the x values&lt;br /&gt;
        var result = [];&lt;br /&gt;
        for (var i = 0; i &amp;lt;= samples; i++)&lt;br /&gt;
            result[i] = [i, 0];&lt;br /&gt;
        return result;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // setup plot&lt;br /&gt;
    var optionsTop = {&lt;br /&gt;
        series: { &lt;br /&gt;
            shadowSize: 0, // drawing is faster without shadows&lt;br /&gt;
            points: { show: false},&lt;br /&gt;
            lines:  { show: true, lineWidth: 5},&lt;br /&gt;
        }, &lt;br /&gt;
        yaxis:	{ min: 0, max: 2, &lt;br /&gt;
                  zoomRange: [10, 256], panRange: [-128, 128] },&lt;br /&gt;
        xaxis:	{ show: true, &lt;br /&gt;
                  zoomRange: [10, 100], panRange: [0, 100] },&lt;br /&gt;
        legend:	{ position: &amp;quot;sw&amp;quot; },&lt;br /&gt;
        zoom:	{ interactive: true, amount: 1.1 },&lt;br /&gt;
        pan:	{ interactive: true }&lt;br /&gt;
    };&lt;br /&gt;
    plotTop = $.plot($(&amp;quot;#plotTop&amp;quot;), &lt;br /&gt;
        [ &lt;br /&gt;
          { data:  initPlotData(), &lt;br /&gt;
            label: &amp;quot;Encoder A&amp;quot; },&lt;br /&gt;
          { data:  initPlotData(),&lt;br /&gt;
            label: &amp;quot;Encoder B&amp;quot; }&lt;br /&gt;
        ],&lt;br /&gt;
            optionsTop);&lt;br /&gt;
&lt;br /&gt;
    var optionsBot = {&lt;br /&gt;
        series: {&lt;br /&gt;
            shadowSize: 0, // drawing is faster without shadows&lt;br /&gt;
            points: { show: false},&lt;br /&gt;
            lines:  { show: true, lineWidth: 5},&lt;br /&gt;
            color: 2&lt;br /&gt;
        },&lt;br /&gt;
        yaxis:  { min: 0, max: 2,&lt;br /&gt;
                  zoomRange: [10, 256], panRange: [-128, 128] },&lt;br /&gt;
        xaxis:  { show: true,&lt;br /&gt;
                  zoomRange: [10, 100], panRange: [0, 100] },&lt;br /&gt;
        legend: { position: &amp;quot;sw&amp;quot; },&lt;br /&gt;
        zoom:   { interactive: true, amount: 1.1 },&lt;br /&gt;
        pan:    { interactive: true }&lt;br /&gt;
    };&lt;br /&gt;
    plotBot = $.plot($(&amp;quot;#plotBot&amp;quot;),&lt;br /&gt;
        [&lt;br /&gt;
            { data:  initPlotData(),&lt;br /&gt;
              label: &amp;quot;Encoder Switch&amp;quot;}&lt;br /&gt;
        ],&lt;br /&gt;
            optionsBot);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/File:Adafruit_Rotary_Encoder_With_Connectors.jpg</id>
		<title>File:Adafruit Rotary Encoder With Connectors.jpg</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/File:Adafruit_Rotary_Encoder_With_Connectors.jpg"/>
				<updated>2012-10-24T05:11:20Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: Adafruit's rotary encoder with connectors added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Adafruit's rotary encoder with connectors added&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Adafruit:_Rotary_Encoder</id>
		<title>Adafruit: Rotary Encoder</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Adafruit:_Rotary_Encoder"/>
				<updated>2012-10-02T00:14:38Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Bone Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Adafruit_Rotary_Encoder.jpg|thumb|Adafruit's Rotary Encoder]]&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
[http://adafru.it/377 Adafruit's Rotary Encoder] is a device that detects rotation. As it rotates, it sends pulses on two pins. By comparing the signals, the direction of rotation can be determined. There are 24 pulses per rotation. The device also acts as a pushbutton switch.&lt;br /&gt;
&lt;br /&gt;
==Inputs and Outputs==&lt;br /&gt;
&lt;br /&gt;
The device has five pins - three on one side and two on the other. The side with three pins is for the encoder and is ordered (from left to right) ground, signal A, and signal B. The side with two pins is for the pushbutton switch. More information can be found on the [http://adafru.it/377 product page] or on the [http://www.adafruit.com/datasheets/pec11.pdf datasheet].&lt;br /&gt;
&lt;br /&gt;
==Bone Usage==&lt;br /&gt;
&lt;br /&gt;
The pins on the device can be difficult to use with a bread board, so soldering wire leads may prove useful. [[File:Adafruit_Rotary_Encoder_with_Wires.jpg|thumb|Rotary encoder with soldered wire leads]]&lt;br /&gt;
&lt;br /&gt;
The two signal pins and one of the pushbutton pins can be hooked up directly to any of the GPIO ports on the BeagleBone. The remaining pins can be hooked up to GND and +3,3v. The example below uses GPIO1_6 for signal A, GPIO1_15 for signal B, and GPIO1_16 for the pushbutton switch. [[File:Adafruit_Rotary_Encoder_in_BeagleBone.jpg|thumb|Rotary encoder hooked up to the BeagleBone]]&lt;br /&gt;
&lt;br /&gt;
The C code below demonstrates how to use the encoder with the BeagleBone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
&lt;br /&gt;
Port Congiguration:&lt;br /&gt;
-Encoder A: GPIO1_6 - Header P8, pin 3 - GPIO 38&lt;br /&gt;
-Encoder B: GPIO1_15 - Header P8, pin 15 - GPIO 47&lt;br /&gt;
-Pushbutton Switch: GPIO1_16 - Header P9, pin 15 - GPIO 48&lt;br /&gt;
&lt;br /&gt;
This program keeps track of an encoder. CW rotation will&lt;br /&gt;
increment the ticks, and CCW will decrement it. The current&lt;br /&gt;
number of ticks is printed when the button is pressed.&lt;br /&gt;
&lt;br /&gt;
The gpio.h header consists of the GPIO methods copied directly from:&lt;br /&gt;
https://www.ridgerun.com/developer/wiki/index.php/Gpio-int-test.c&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int running = 1;&lt;br /&gt;
&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
        running = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
        int rc;&lt;br /&gt;
        struct pollfd fdset[3];&lt;br /&gt;
        int nfds = 3;&lt;br /&gt;
        int len;&lt;br /&gt;
        char* buf[MAX_BUF];&lt;br /&gt;
        int i;&lt;br /&gt;
&lt;br /&gt;
        int pos = 0;&lt;br /&gt;
&lt;br /&gt;
        unsigned int enc_a_val;&lt;br /&gt;
        unsigned int enc_b_val;&lt;br /&gt;
&lt;br /&gt;
        // Handle Ctrl^C&lt;br /&gt;
        signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
        // Set up GPIO pins&lt;br /&gt;
        unsigned int gpio_a = 38;&lt;br /&gt;
        unsigned int gpio_b = 47;&lt;br /&gt;
        unsigned int gpio_sw = 48;&lt;br /&gt;
&lt;br /&gt;
        int enc_a_fd;&lt;br /&gt;
        int enc_b_fd;&lt;br /&gt;
        int enc_sw_fd;&lt;br /&gt;
&lt;br /&gt;
        gpio_export(gpio_a);&lt;br /&gt;
        gpio_export(gpio_b);&lt;br /&gt;
        gpio_export(gpio_sw);&lt;br /&gt;
&lt;br /&gt;
        gpio_set_dir(gpio_a, 0);&lt;br /&gt;
        gpio_set_dir(gpio_b, 0);&lt;br /&gt;
        gpio_set_dir(gpio_sw, 0);&lt;br /&gt;
&lt;br /&gt;
        // Interrupts&lt;br /&gt;
        gpio_set_edge(gpio_a, &amp;quot;rising&amp;quot;);&lt;br /&gt;
        gpio_set_edge(gpio_sw, &amp;quot;rising&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // Open the file for the encoder A signal&lt;br /&gt;
        enc_a_fd = gpio_fd_open(gpio_a);&lt;br /&gt;
&lt;br /&gt;
       // Main loop&lt;br /&gt;
        while (running == 1)&lt;br /&gt;
        {&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 = enc_a_fd;&lt;br /&gt;
                fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
                fdset[2].fd = enc_sw_fd;&lt;br /&gt;
                fdset[2].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
                rc = poll(fdset, nfds, -1);&lt;br /&gt;
&lt;br /&gt;
                if (rc &amp;lt; 0)&lt;br /&gt;
                {&lt;br /&gt;
//                      printf(&amp;quot;poll() failed.\n&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                if (rc == 0)&lt;br /&gt;
                {&lt;br /&gt;
//                      printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                if (fdset[0].revents &amp;amp; POLLIN)&lt;br /&gt;
                {&lt;br /&gt;
                        (void) read(fdset[0].fd, buf, 1);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                // Encoder click&lt;br /&gt;
                if (fdset[1].revents &amp;amp; POLLPRI)&lt;br /&gt;
                {&lt;br /&gt;
                        lseek(fdset[1].fd, 0, SEEK_SET);&lt;br /&gt;
                        len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
&lt;br /&gt;
                        enc_a_val = atoi((const char*) buf);&lt;br /&gt;
                        gpio_get_value(gpio_b, &amp;amp;enc_b_val);&lt;br /&gt;
&lt;br /&gt;
                        if (enc_a_val == 1) // rising edge&lt;br /&gt;
                        {&lt;br /&gt;
                                if (enc_b_val == 0) pos--;&lt;br /&gt;
                                else pos++;&lt;br /&gt;
                        }&lt;br /&gt;
&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button Press&lt;br /&gt;
                if (fdset[2].revents &amp;amp; POLLPRI)&lt;br /&gt;
                {&lt;br /&gt;
                        lseek(fdset[2].fd, 0, SEEK_SET);&lt;br /&gt;
                        len = read(fdset[2].fd, buf, MAX_BUF);&lt;br /&gt;
&lt;br /&gt;
                        printf(&amp;quot;Ticks: %d\n&amp;quot;, pos);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gpio_fd_close(enc_a_fd);&lt;br /&gt;
&lt;br /&gt;
        return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The full code can be found in [https://github.com/jtlobdell/Adafruit_Rotary_Encoder_BeagleBone John Lobdell's Git repository].&lt;/div&gt;</summary>
		<author><name>Lobdeljt</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-10-01T23:36:01Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: &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;
| Alex Drane&lt;br /&gt;
| ADXL345 - Accelerometer Breakout Board&lt;br /&gt;
| &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. [[Sparkfun:_ITG-3200,Triple-Axis_Gyro]]&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;
| [[Sparkfun: 0.5&amp;quot; Force Sensitive Resistor|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;
| Peter Ngo&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 &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;
|Peter Ngo &amp;amp; Bryan Correll&lt;br /&gt;
|[[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. [[Adafruit: 16x24 Red LED Matrix Panel]]&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. [[Adafruit: Rotary Encoder]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Adafruit:_Rotary_Encoder</id>
		<title>Adafruit: Rotary Encoder</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Adafruit:_Rotary_Encoder"/>
				<updated>2012-10-01T23:33:03Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Bone Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Adafruit_Rotary_Encoder.jpg|thumb|Adafruit's Rotary Encoder]]&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
[http://adafru.it/377 Adafruit's Rotary Encoder] is a device that detects rotation. As it rotates, it sends pulses on two pins. By comparing the signals, the direction of rotation can be determined. There are 24 pulses per rotation. The device also acts as a pushbutton switch.&lt;br /&gt;
&lt;br /&gt;
==Inputs and Outputs==&lt;br /&gt;
&lt;br /&gt;
The device has five pins - three on one side and two on the other. The side with three pins is for the encoder and is ordered (from left to right) ground, signal A, and signal B. The side with two pins is for the pushbutton switch. More information can be found on the [http://adafru.it/377 product page] or on the [http://www.adafruit.com/datasheets/pec11.pdf datasheet].&lt;br /&gt;
&lt;br /&gt;
==Bone Usage==&lt;br /&gt;
&lt;br /&gt;
The pins on the device can be difficult to use with a bread board, so soldering wire leads may prove useful. [[File:Adafruit_Rotary_Encoder_with_Wires.jpg|thumb|Rotary encoder with soldered wire leads]]&lt;br /&gt;
&lt;br /&gt;
The two signal pins and one of the pushbutton pins can be hooked up directly to any of the GPIO ports on the BeagleBone. The remaining pins can be hooked up to GND and +3,3v. The example below uses GPIO1_6 for signal A, GPIO1_15 for signal B, and GPIO1_16 for the pushbutton switch. [[File:Adafruit_Rotary_Encoder_in_BeagleBone.jpg|thumb|Rotary encoder hooked up to the BeagleBone]]&lt;br /&gt;
&lt;br /&gt;
The C code below demonstrates how to use the encoder with the BeagleBone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
&lt;br /&gt;
Port Congiguration:&lt;br /&gt;
-Encoder A: GPIO1_6 - Header P8, pin 3 - GPIO 38&lt;br /&gt;
-Encoder B: GPIO1_15 - Header P8, pin 15 - GPIO 47&lt;br /&gt;
-Pushbutton Switch: GPIO1_16 - Header P9, pin 15 - GPIO 48&lt;br /&gt;
&lt;br /&gt;
This program keeps track of an encoder. CW rotation will&lt;br /&gt;
increment the ticks, and CCW will decrement it. The current&lt;br /&gt;
number of ticks is printed when the button is pressed.&lt;br /&gt;
&lt;br /&gt;
The gpio.h header consists of the GPIO methods copied directly from:&lt;br /&gt;
https://www.ridgerun.com/developer/wiki/index.php/Gpio-int-test.c&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int running = 1;&lt;br /&gt;
&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
        running = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
        int rc;&lt;br /&gt;
        struct pollfd fdset[3];&lt;br /&gt;
        int nfds = 3;&lt;br /&gt;
        int len;&lt;br /&gt;
        char* buf[MAX_BUF];&lt;br /&gt;
        int i;&lt;br /&gt;
&lt;br /&gt;
        int pos = 0;&lt;br /&gt;
&lt;br /&gt;
        unsigned int enc_a_val;&lt;br /&gt;
        unsigned int enc_b_val;&lt;br /&gt;
&lt;br /&gt;
        // Handle Ctrl^C&lt;br /&gt;
        signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
        // Set up GPIO pins&lt;br /&gt;
        unsigned int gpio_a = 38;&lt;br /&gt;
        unsigned int gpio_b = 47;&lt;br /&gt;
        unsigned int gpio_sw = 48;&lt;br /&gt;
&lt;br /&gt;
        int enc_a_fd;&lt;br /&gt;
        int enc_b_fd;&lt;br /&gt;
        int enc_sw_fd;&lt;br /&gt;
&lt;br /&gt;
        gpio_export(gpio_a);&lt;br /&gt;
        gpio_export(gpio_b);&lt;br /&gt;
        gpio_export(gpio_sw);&lt;br /&gt;
&lt;br /&gt;
        gpio_set_dir(gpio_a, 0);&lt;br /&gt;
        gpio_set_dir(gpio_b, 0);&lt;br /&gt;
        gpio_set_dir(gpio_sw, 0);&lt;br /&gt;
&lt;br /&gt;
        // Interrupts&lt;br /&gt;
        gpio_set_edge(gpio_a, &amp;quot;rising&amp;quot;);&lt;br /&gt;
        gpio_set_edge(gpio_sw, &amp;quot;rising&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // Open the file for the encoder A signal&lt;br /&gt;
        enc_a_fd = gpio_fd_open(gpio_a);&lt;br /&gt;
&lt;br /&gt;
       // Main loop&lt;br /&gt;
        while (running == 1)&lt;br /&gt;
        {&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 = enc_a_fd;&lt;br /&gt;
                fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
                fdset[2].fd = enc_sw_fd;&lt;br /&gt;
                fdset[2].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
                rc = poll(fdset, nfds, -1);&lt;br /&gt;
&lt;br /&gt;
                if (rc &amp;lt; 0)&lt;br /&gt;
                {&lt;br /&gt;
//                      printf(&amp;quot;poll() failed.\n&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                if (rc == 0)&lt;br /&gt;
                {&lt;br /&gt;
//                      printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                if (fdset[0].revents &amp;amp; POLLIN)&lt;br /&gt;
                {&lt;br /&gt;
                        (void) read(fdset[0].fd, buf, 1);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                // Encoder click&lt;br /&gt;
                if (fdset[1].revents &amp;amp; POLLPRI)&lt;br /&gt;
                {&lt;br /&gt;
                        lseek(fdset[1].fd, 0, SEEK_SET);&lt;br /&gt;
                        len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
&lt;br /&gt;
                        enc_a_val = atoi((const char*) buf);&lt;br /&gt;
                        gpio_get_value(gpio_b, &amp;amp;enc_b_val);&lt;br /&gt;
&lt;br /&gt;
                        if (enc_a_val == 1) // rising edge&lt;br /&gt;
                        {&lt;br /&gt;
                                if (enc_b_val == 0) pos--;&lt;br /&gt;
                                else pos++;&lt;br /&gt;
                        }&lt;br /&gt;
&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button Press&lt;br /&gt;
                if (fdset[2].revents &amp;amp; POLLPRI)&lt;br /&gt;
                {&lt;br /&gt;
                        lseek(fdset[2].fd, 0, SEEK_SET);&lt;br /&gt;
                        len = read(fdset[2].fd, buf, MAX_BUF);&lt;br /&gt;
&lt;br /&gt;
                        printf(&amp;quot;Ticks: %d\n&amp;quot;, pos);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gpio_fd_close(enc_a_fd);&lt;br /&gt;
&lt;br /&gt;
        return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/Adafruit:_Rotary_Encoder</id>
		<title>Adafruit: Rotary Encoder</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/Adafruit:_Rotary_Encoder"/>
				<updated>2012-10-01T23:31:59Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: Created page with &amp;quot;Category:ECE497 Category:Adafruit   Adafruit's Rotary Encoder  ==Overview==  [http://adafru.it/377 Adafruit's Rotary Encoder] i...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;br /&gt;
[[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Adafruit_Rotary_Encoder.jpg|thumb|Adafruit's Rotary Encoder]]&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
[http://adafru.it/377 Adafruit's Rotary Encoder] is a device that detects rotation. As it rotates, it sends pulses on two pins. By comparing the signals, the direction of rotation can be determined. There are 24 pulses per rotation. The device also acts as a pushbutton switch.&lt;br /&gt;
&lt;br /&gt;
==Inputs and Outputs==&lt;br /&gt;
&lt;br /&gt;
The device has five pins - three on one side and two on the other. The side with three pins is for the encoder and is ordered (from left to right) ground, signal A, and signal B. The side with two pins is for the pushbutton switch. More information can be found on the [http://adafru.it/377 product page] or on the [http://www.adafruit.com/datasheets/pec11.pdf datasheet].&lt;br /&gt;
&lt;br /&gt;
==Bone Usage==&lt;br /&gt;
&lt;br /&gt;
The pins on the device can be difficult to use with a bread board, so soldering wire leads may prove useful. [[File:Adafruit_Rotary_Encoder_with_Wires.jpg|thumb|Rotary encoder with soldered wire leads]]&lt;br /&gt;
&lt;br /&gt;
The two signal pins and one of the pushbutton pins can be hooked up directly to any of the GPIO ports on the BeagleBone. The remaining pins can be hooked up to GND and +3,3v. The example below uses GPIO1_6 for signal A, GPIO1_15 for signal B, and GPIO1_16 for the pushbutton switch. [[File:Adafruit_Rotary_Encoder_in_BeagleBone.jpg|thumb|Rotary encoder hooked up to the BeagleBone]]&lt;br /&gt;
&lt;br /&gt;
The C code below demonstrates how to use the encoder with the BeagleBone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
&lt;br /&gt;
Port Congiguration:&lt;br /&gt;
-Encoder A: GPIO1_6 - Header P8, pin 3 - GPIO 38&lt;br /&gt;
-Encoder B: GPIO1_15 - Header P8, pin 15 - GPIO 47&lt;br /&gt;
-Pushbutton Switch: GPIO1_16 - Header P9, pin 15 - GPIO 48&lt;br /&gt;
&lt;br /&gt;
This program keeps track of an encoder. CW rotation will&lt;br /&gt;
increment the ticks, and CCW will decrement it. The current&lt;br /&gt;
number of ticks is printed when the button is pressed.&lt;br /&gt;
&lt;br /&gt;
The gpio.h header consists of the GPIO methods copied directly from:&lt;br /&gt;
https://www.ridgerun.com/developer/wiki/index.php/Gpio-int-tst&lt;br /&gt;
&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
int running = 1;&lt;br /&gt;
&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
        running = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char* argv[])&lt;br /&gt;
{&lt;br /&gt;
        int rc;&lt;br /&gt;
        struct pollfd fdset[3];&lt;br /&gt;
        int nfds = 3;&lt;br /&gt;
        int len;&lt;br /&gt;
        char* buf[MAX_BUF];&lt;br /&gt;
        int i;&lt;br /&gt;
&lt;br /&gt;
        int pos = 0;&lt;br /&gt;
&lt;br /&gt;
        unsigned int enc_a_val;&lt;br /&gt;
        unsigned int enc_b_val;&lt;br /&gt;
&lt;br /&gt;
        // Handle Ctrl^C&lt;br /&gt;
        signal(SIGINT, signal_handler);&lt;br /&gt;
&lt;br /&gt;
        // Set up GPIO pins&lt;br /&gt;
        unsigned int gpio_a = 38;&lt;br /&gt;
        unsigned int gpio_b = 47;&lt;br /&gt;
        unsigned int gpio_sw = 48;&lt;br /&gt;
&lt;br /&gt;
        int enc_a_fd;&lt;br /&gt;
        int enc_b_fd;&lt;br /&gt;
        int enc_sw_fd;&lt;br /&gt;
&lt;br /&gt;
        gpio_export(gpio_a);&lt;br /&gt;
        gpio_export(gpio_b);&lt;br /&gt;
        gpio_export(gpio_sw);&lt;br /&gt;
&lt;br /&gt;
        gpio_set_dir(gpio_a, 0);&lt;br /&gt;
        gpio_set_dir(gpio_b, 0);&lt;br /&gt;
        gpio_set_dir(gpio_sw, 0);&lt;br /&gt;
&lt;br /&gt;
        // Interrupts&lt;br /&gt;
        gpio_set_edge(gpio_a, &amp;quot;rising&amp;quot;);&lt;br /&gt;
        gpio_set_edge(gpio_sw, &amp;quot;rising&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        // Open the file for the encoder A signal&lt;br /&gt;
        enc_a_fd = gpio_fd_open(gpio_a);&lt;br /&gt;
&lt;br /&gt;
       // Main loop&lt;br /&gt;
        while (running == 1)&lt;br /&gt;
        {&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 = enc_a_fd;&lt;br /&gt;
                fdset[1].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
                fdset[2].fd = enc_sw_fd;&lt;br /&gt;
                fdset[2].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
                rc = poll(fdset, nfds, -1);&lt;br /&gt;
&lt;br /&gt;
                if (rc &amp;lt; 0)&lt;br /&gt;
                {&lt;br /&gt;
//                      printf(&amp;quot;poll() failed.\n&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                if (rc == 0)&lt;br /&gt;
                {&lt;br /&gt;
//                      printf(&amp;quot;.&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                if (fdset[0].revents &amp;amp; POLLIN)&lt;br /&gt;
                {&lt;br /&gt;
                        (void) read(fdset[0].fd, buf, 1);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
                // Encoder click&lt;br /&gt;
                if (fdset[1].revents &amp;amp; POLLPRI)&lt;br /&gt;
                {&lt;br /&gt;
                        lseek(fdset[1].fd, 0, SEEK_SET);&lt;br /&gt;
                        len = read(fdset[1].fd, buf, MAX_BUF);&lt;br /&gt;
&lt;br /&gt;
                        enc_a_val = atoi((const char*) buf);&lt;br /&gt;
                        gpio_get_value(gpio_b, &amp;amp;enc_b_val);&lt;br /&gt;
&lt;br /&gt;
                        if (enc_a_val == 1) // rising edge&lt;br /&gt;
                        {&lt;br /&gt;
                                if (enc_b_val == 0) pos--;&lt;br /&gt;
                                else pos++;&lt;br /&gt;
                        }&lt;br /&gt;
&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button Press&lt;br /&gt;
                if (fdset[2].revents &amp;amp; POLLPRI)&lt;br /&gt;
                {&lt;br /&gt;
                        lseek(fdset[2].fd, 0, SEEK_SET);&lt;br /&gt;
                        len = read(fdset[2].fd, buf, MAX_BUF);&lt;br /&gt;
&lt;br /&gt;
                        printf(&amp;quot;Ticks: %d\n&amp;quot;, pos);&lt;br /&gt;
                }&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        gpio_fd_close(enc_a_fd);&lt;br /&gt;
&lt;br /&gt;
        return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/File:Adafruit_Rotary_Encoder_in_BeagleBone.jpg</id>
		<title>File:Adafruit Rotary Encoder in BeagleBone.jpg</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/File:Adafruit_Rotary_Encoder_in_BeagleBone.jpg"/>
				<updated>2012-10-01T23:25:40Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: The Adafruit Rotary Encoder hooked up to the BeagleBone.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Adafruit Rotary Encoder hooked up to the BeagleBone.&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/File:Adafruit_Rotary_Encoder_with_Wires.jpg</id>
		<title>File:Adafruit Rotary Encoder with Wires.jpg</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/File:Adafruit_Rotary_Encoder_with_Wires.jpg"/>
				<updated>2012-10-01T22:51:02Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: uploaded a new version of &amp;amp;quot;File:Adafruit Rotary Encoder with Wires.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Adafruit's Rotary Encoder with wire leads soldered on.&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/File:Adafruit_Rotary_Encoder_with_Wires.jpg</id>
		<title>File:Adafruit Rotary Encoder with Wires.jpg</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/File:Adafruit_Rotary_Encoder_with_Wires.jpg"/>
				<updated>2012-10-01T22:50:17Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: Adafruit's Rotary Encoder with wire leads soldered on.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Adafruit's Rotary Encoder with wire leads soldered on.&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/File:Adafruit_Rotary_Encoder.jpg</id>
		<title>File:Adafruit Rotary Encoder.jpg</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/File:Adafruit_Rotary_Encoder.jpg"/>
				<updated>2012-10-01T22:20:12Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: uploaded a new version of &amp;amp;quot;File:Adafruit Rotary Encoder.jpg&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Adafruit Rotary Encoder&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/File:Adafruit_Rotary_Encoder.jpg</id>
		<title>File:Adafruit Rotary Encoder.jpg</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/File:Adafruit_Rotary_Encoder.jpg"/>
				<updated>2012-10-01T22:18:34Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: Adafruit Rotary Encoder&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Adafruit Rotary Encoder&lt;/div&gt;</summary>
		<author><name>Lobdeljt</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-22T23:16:53Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Adafruit */&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;
| 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&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;
|Yue Zhang &amp;amp; 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>Lobdeljt</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-22T23:14:38Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Adafruit */&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;
| 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&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;
|Yue Zhang &amp;amp; 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;
|&lt;br /&gt;
|-&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</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-13T16:35:02Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: &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;
| [https://github.com/larmorgs/ larmorgs]&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:Xinyu1991 | Xinyu Cheng]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
| [https://github.com/xinyu1991]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:correlbn | Bryan Correll]]&lt;br /&gt;
| [[Special:Contributions/correlbn|contrib]]&lt;br /&gt;
| [[ECE497 Correlbn Project | My Beagle Project]]&lt;br /&gt;
| [https://github.com/correlbn/My-Beagle-Project/ Correlbn]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:draneaw | Alex Drane]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 draneaw Project | My Beagle Project]]&lt;br /&gt;
| [https://github.com/draneaw/My-Beagle-Project draneaw]&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;
| [https://github.com/duganje/ duganje]&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;
| [https://github.com/goodca/ goodca]&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;
| [[Special:Contributions/jungeml|contrib]]&lt;br /&gt;
| [[ECE497 jungeml Project | My Beagle Project]]&lt;br /&gt;
| [https://github.com/jungeml/ Jungeml]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Lix | Xia Li]]&lt;br /&gt;
| [[Special:Contributions/Lix|contrib]]&lt;br /&gt;
| [[ECE497 Lix Project | My Beagle Project]]&lt;br /&gt;
| [https://github.com/1984xiali/ xiali]&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;
| [https://github.com/ngop/ ngop]&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: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;
| [https://github.com/popenhjc/ popenhjc]&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;
| [https://github.com/whiteer whiteer]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:ruff | Ruffin White]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
| [https://github.com/ruffsl/ ruffsl]&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;
| [https://github.com/millerap millerap]&lt;br /&gt;
|-| &lt;br /&gt;
| [[User:Astroricks | Yue Zhang]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 Yue Zhang Project | My Beagle Project]]&lt;br /&gt;
| [https://github.com/Astroricks/Beagle-Project Yue Zhang]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Lobdeljt | John Lobdell]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE 497 lobdeljt Project | My Beagle Project]]&lt;br /&gt;
| [https://github.com/jtlobdell jtlobdell]&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;
# [[Special:Contributions/larmorgs | Greg Larmore]]&lt;br /&gt;
# [[Special:Contributions/jungeml | Michael Junge]]&lt;br /&gt;
# [[Special:Contributions/millerap | Andrew Miller]]&lt;br /&gt;
# [[Special:Contributions/correlbn | Bryan Correll]]&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>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/EBC_Exercise_13_Pulse_Width_Modulation</id>
		<title>EBC Exercise 13 Pulse Width Modulation</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/EBC_Exercise_13_Pulse_Width_Modulation"/>
				<updated>2012-09-13T06:04:58Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: /* Either Way */&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;
In a previous exercise ([[EBC Exercise 11 gpio Polling and Interrupts]]) you saw how to use the gpio to produce a square wave out using a C program and sysfs. I was able to get a 1.5kHz square wave out; however we can do much better using some built in hardware on the Beagle.&lt;br /&gt;
&lt;br /&gt;
In this exercise you will learn how to use the Beagle's pulse width modulation (pwm) hardware using the sysfs interface and also learn about pin multiplexing (pin mux) on the way.&lt;br /&gt;
&lt;br /&gt;
== PWM on the Bone ==&lt;br /&gt;
&lt;br /&gt;
The Bone has a PWM interface at &amp;lt;code&amp;gt;/sys/class/pwm/&amp;lt;/code&amp;gt;. You can see what's there by:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd /sys/class/pwm'''&lt;br /&gt;
 beagle$ '''ls -F'''&lt;br /&gt;
 ecap.0@  ecap.2@      ehrpwm.0:1@  ehrpwm.1:1@  ehrpwm.2:1@&lt;br /&gt;
 ecap.1@  ehrpwm.0:0@  ehrpwm.1:0@  ehrpwm.2:0@&lt;br /&gt;
&lt;br /&gt;
The [http://processors.wiki.ti.com/index.php/AM335x_PWM_Driver's_Guide AM335x PWM Driver's Guide] details what eCAP and eHRPWM are and gives some examples.  Before you can use the PWM's, you need to make sure the pin MUXes are set correctly. There are two ways to do this, the slick way (which may not work) and the sure way.&lt;br /&gt;
&lt;br /&gt;
=== The Slick Way ===&lt;br /&gt;
&lt;br /&gt;
On your Bone&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd exercises'''&lt;br /&gt;
 beagle$ '''git pull'''&lt;br /&gt;
 beagle$ '''cd pinMux'''&lt;br /&gt;
 beagle$ '''ln -s $PWD/pinMux.html /var/lib/cloud9/bone101'''&lt;br /&gt;
 beagle$ '''ls -ls /var/lib/cloud9/bone101/pinMux.html'''&lt;br /&gt;
 0 lrwxrwxrwx 1 root root 39 Sep  6 14:19 /var/lib/cloud9/bone101/pinMux.html -&amp;gt; /home/root/exercises/pinMux/pinMux.html&lt;br /&gt;
 beagle$ '''cd /var/lib/cloud9'''&lt;br /&gt;
 beagle$ '''git pull'''&lt;br /&gt;
 beagle$ '''shutdown -r now'''&lt;br /&gt;
&lt;br /&gt;
Yup, after updating /var/lib/cloud9 you have to reboot.&lt;br /&gt;
&lt;br /&gt;
Now, check the settings by browsing to [http://beagle/pinMux.html http://''bone''/pinMux.html] (where ''bone'' is the IP address of your Bone.) to see how the pins are set.  You'll see something like:&lt;br /&gt;
&lt;br /&gt;
[[File:PimMux1.png]]&lt;br /&gt;
&lt;br /&gt;
=== The Sure Way ===&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd ~/exercises/pinMux'''&lt;br /&gt;
 beagle$ '''./pinMux.sh'''&lt;br /&gt;
&lt;br /&gt;
This just lists all the files in the mux directory and their contents. &lt;br /&gt;
&lt;br /&gt;
=== Either Way ===&lt;br /&gt;
&lt;br /&gt;
This just lists every find in the mux directory.  &lt;br /&gt;
&lt;br /&gt;
You can control the pin MUXing this way:&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;
 ...&lt;br /&gt;
&lt;br /&gt;
There are some 126 pins that you can control what they output.  How do you know which one to change?  Let's use ehrpwm.1:0.  This will show up at ehrpwm1A (the 0 maps to A).  Try:&lt;br /&gt;
&lt;br /&gt;
 beagle$ grep ehrpwm *&lt;br /&gt;
 gpmc_a0:signals: gpmc_a0 | gmii2_txen | rgmii2_tctl | rmii2_txen | gpmc_a16 | pr1_mii_mt1_clk | ehrpwm1_tripzone_input | gpio1_16&lt;br /&gt;
 gpmc_a1:signals: gpmc_a1 | gmii2_rxdv | rgmii2_rctl | mmc2_dat0 | gpmc_a17 | pr1_mii1_txd3 | ehrpwm0_synco | gpio1_17&lt;br /&gt;
 '''gpmc_a2''':signals: gpmc_a2 | gmii2_txd3 | rgmii2_td3 | mmc2_dat1 | gpmc_a18 | pr1_mii1_txd2 | '''ehrpwm1A''' | gpio1_18&lt;br /&gt;
 gpmc_a3:signals: gpmc_a3 | gmii2_txd2 | rgmii2_td2 | mmc2_dat2 | gpmc_a19 | pr1_mii1_txd1 | ehrpwm1B | gpio1_19&lt;br /&gt;
 ...&lt;br /&gt;
This shows that '''ehrpwm1A''' shows up in the file '''gpmc_a2'''. Look in the file&lt;br /&gt;
 beagle$ '''cat gpmc_a2'''&lt;br /&gt;
 name: gpmc_a2.gpio1_18 (0x44e10848/0x848 = 0x0007), b NA, t NA&lt;br /&gt;
 mode: OMAP_PIN_OUTPUT | '''OMAP_MUX_MODE7'''&lt;br /&gt;
 signals: gpmc_a2 | gmii2_txd3 | rgmii2_td3 | mmc2_dat1 | gpmc_a18 | pr1_mii1_txd2 | ehrpwm1A | gpio1_18&lt;br /&gt;
&lt;br /&gt;
This says the MUX is presently set on pin '''7'''.  Counting starts on the left with 0.  We want pin '''6'''. So:&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''echo 6 &amp;gt; gpmc_a2'''&lt;br /&gt;
 beagle$ '''cat gpmc_a2'''&lt;br /&gt;
 name: gpmc_a2.ehrpwm1A (0x44e10848/0x848 = 0x0006), b NA, t NA&lt;br /&gt;
 mode: OMAP_PIN_OUTPUT | '''OMAP_MUX_MODE6'''&lt;br /&gt;
 signals: gpmc_a2 | gmii2_txd3 | rgmii2_td3 | mmc2_dat1 | gpmc_a18 | pr1_mii1_txd2 | '''ehrpwm1A''' | gpio1_18&lt;br /&gt;
&lt;br /&gt;
Now it's mode 6, which is the PWM output.  Refresh you pin MUX web page to see.&lt;br /&gt;
&lt;br /&gt;
[[File:PinMux2.png]]&lt;br /&gt;
&lt;br /&gt;
Notice header P9, pin 14 has changed!  Now let's turn on the PWM.&lt;br /&gt;
&lt;br /&gt;
 beagle$ '''cd /sys/class/pwm/ehrpwm.1\:0'''&lt;br /&gt;
 beagle$ '''echo 1 &amp;gt; run'''&lt;br /&gt;
 beagle$ '''echo 10 &amp;gt; period_freq'''&lt;br /&gt;
 beagle$ '''echo 25 &amp;gt; duty_percent'''&lt;br /&gt;
&lt;br /&gt;
Note: If these command cause the SSH connection to close, you may have to get a newer version of Angstrom. Follow the instructions at [[EBC_Exercise_03_Installing_a_Beagle_OS]] and try it again.&lt;br /&gt;
&lt;br /&gt;
Connect the LED from [[EBC_Exercise_10_Flashing_an_LED#Adding_your_own_LED_-_bone]] and watch it flash.  Try changing the frequency and duty cycle.  You may have to set the duty cycle to 0 to change the frequency.  Can you guess why?&lt;br /&gt;
&lt;br /&gt;
Stick a scope on the pin and see if the frequency and duty cycle are right.  What's the highest frequency you can get? What's the lowest?&lt;br /&gt;
&lt;br /&gt;
[https://groups.google.com/forum/#!searchin/beagleboard/bone$20pwm/beagleboard/alKf67dwMHI/t_tIQpJyM8wJ Good discussion]&lt;br /&gt;
&lt;br /&gt;
=== Assignment ===&lt;br /&gt;
&lt;br /&gt;
If your git repository is set up just:&lt;br /&gt;
 beagle$ '''cd exercises'''&lt;br /&gt;
 beagle$ '''git pull'''&lt;br /&gt;
 beagle$ '''cd pwm'''&lt;br /&gt;
(Follow the instructions [[EBC_Exercise_01a_Getting_Exercise_Support_Materials | here]] if you aren't set up for git.)&lt;br /&gt;
&lt;br /&gt;
# Attach an LED and verify that it's blinking correctly.&lt;br /&gt;
# Hook up a oscilloscope. Are the PWM outputs doing what you expected?&lt;br /&gt;
# What's the highest frequency you can generate?  What's the lowest?&lt;br /&gt;
# Verify your understanding of pin MUXing by generating a PWM signal that appears on pin 45 of P8.  Document how you did it.&lt;br /&gt;
&lt;br /&gt;
== PWM on the xM ==&lt;br /&gt;
'''This section needs updating to use /sys/kernel/debug/omap_mux to get the pin MUXes.'''&lt;br /&gt;
&lt;br /&gt;
The DM3730 has 11 general purpose timers, 4 of which (gpt8-gpt11) can be brought out of the chip and used for pulse width modulation ([http://www.ti.com/product/dm3730#technicaldocuments DM3730 TRM page 2689]). The problem is the DM3730 has more internal lines than hardware I/O pins.  The solution is that I/O pins run though a MUX that selects which internal lines appear on I/O pins.  A given pin can have one from as many as eight lines assigned to it.  &lt;br /&gt;
&lt;br /&gt;
These MUXes are set at boot time, and must be set when the kernel boots, or in u-boot.  I couldn't set them during kernel boot with the 2.6.32 kernel, so I used u-boot.  [[BeagleBoardPinMux]] is a good place to learn about the pin MUXing. The u-boot details are [[BeagleBoardPinMux#Setting_Mux_Through_u-boot | here]].&lt;br /&gt;
&lt;br /&gt;
[[BeagleBoardPWM]] is a nice overview of how to do PWM on the Beagle.  The version of the kernel and u-boot that I've given you should already be configured to access the PWM pins. If it isn't you'll have to recompile the Kernel and u-boot.&lt;br /&gt;
&lt;br /&gt;
The standard way to interface with the outside world in Linux is through Kernel Drivers. Currently there are no standard PWM driver for the Beagle, though a couple have been proposed ([https://groups.google.com/d/topic/beagleboard/RI3qTxn68bY/discussion], [http://git.billgatliff.com/pwm.git/?p=pwm.git;a=commit;h=a49cbfff0fa09bff40d328f8985a0a7a7b951d6f] and [http://git.pengutronix.de/?p=imx/linux-2.6.git;a=commit;h=137654cde98a2ffe548f47f02e7fde512bc2091c]). [[BeagleBoardPWM]] takes a more traditional MCU approach by accessing the memory mapped PWD registers directly using '''mmap''' in a C program. Although this approach works, it is really transitional until a standard can be established.  &lt;br /&gt;
&lt;br /&gt;
You could even do PWM from a shell command by using [http://esdw.wordpress.com/2010/03/25/a-useful-tool-devmem2/ devmem2] to write to the memory mapped registers from a command line.&lt;br /&gt;
&lt;br /&gt;
[http://www.jumpnowtek.com/index.php?option=com_content&amp;amp;view=article&amp;amp;id=56&amp;amp;Itemid=63 Here's] another PWM lead.&lt;br /&gt;
&lt;br /&gt;
=== Assignment ===&lt;br /&gt;
&lt;br /&gt;
If your git repository is set up just:&lt;br /&gt;
 beagle$ '''cd exercises'''&lt;br /&gt;
 beagle$ '''git pull'''&lt;br /&gt;
 beagle$ '''cd pwm'''&lt;br /&gt;
(Follow the instructions [[EBC_Exercise_01a_Getting_Exercise_Support_Materials | here]] if you aren't set up for git.)&lt;br /&gt;
&lt;br /&gt;
# Look at the files to see what they are doing.&lt;br /&gt;
# Run '''make''', then '''pwm-demo'''.  &lt;br /&gt;
# Hook up a oscilloscope.  (See Table 22 of the [http://beagleboard.org/static/BBxMSRM_latest.pdf Beagle System Reference manual] to see where to probe.) Are the pwm outputs doing what you expected?&lt;br /&gt;
# What's the highest frequency you can generate?  What's the lowest?&lt;br /&gt;
# Create a new C program, based on pwm-demo, that takes 3 parameters, the &amp;lt;pwm to use&amp;gt;, &amp;lt;frequency&amp;gt; and &amp;lt;duty cycle&amp;gt;.&lt;br /&gt;
# Create a shell file that will call your new program and set up the three pwm's that appear on the expansion header and program them to do something interesting.&lt;br /&gt;
# Write a shell file that will do the pin MUXing using '''devmem2'''.&lt;br /&gt;
# Rewrite '''pwm-demo''' as a shell file that uses '''devmem2'''.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
# [[BeagleBoardPWM]] from ECE597&lt;br /&gt;
# [[BeagleBoard/GSoC/2010_Projects/Pulse_Width_Modulation]]  Google SoC project&lt;br /&gt;
# [[BeagleBoardPinMux]], how to set the pin mux.&lt;br /&gt;
# [http://www.gigamegablog.com/ Buttons and PWM]&lt;br /&gt;
# [http://veter-project.blogspot.com/2011/09/real-time-enough-about-pwms-and-shaky.html Shaky PWMs]&lt;br /&gt;
# [https://groups.google.com/forum/#!searchin/beagleboard/bone$20pwm/beagleboard/alKf67dwMHI/t_tIQpJyM8wJ PWM on the bone]&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Lobdeljt</name></author>	</entry>

	<entry>
		<id>http://elinux.org/User:Lobdeljt</id>
		<title>User:Lobdeljt</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/User:Lobdeljt"/>
				<updated>2012-09-10T15:55:29Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: Created page with &amp;quot;Category:ECE497&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]]&lt;/div&gt;</summary>
		<author><name>Lobdeljt</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-30T22:07:35Z</updated>
		
		<summary type="html">&lt;p&gt;Lobdeljt: &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;
| Kevin Geisler&lt;br /&gt;
| CS&lt;br /&gt;
| Junior&lt;br /&gt;
| Yes (CSSE332)&lt;br /&gt;
| Yes (CSSE232)(ECE 332)&lt;br /&gt;
| 6&lt;br /&gt;
| Arduino Programming &lt;br /&gt;
|-&lt;br /&gt;
| Alex Drane&lt;br /&gt;
| CPE&lt;br /&gt;
| Junior(Current)&lt;br /&gt;
| Yes (CSSE332)&lt;br /&gt;
| Yes (ECE 331)&lt;br /&gt;
| 7&lt;br /&gt;
| Cross-compiled Angstrom for the Arm AT91SAM9G10-EK &lt;br /&gt;
|-&lt;br /&gt;
| Josh Dugan&lt;br /&gt;
| CPE&lt;br /&gt;
| Junior (Current)&lt;br /&gt;
| Yes (CSSE 332)&lt;br /&gt;
| Yes (ECE 331, ECE 530)&lt;br /&gt;
| 5&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| Stephen Shinn&lt;br /&gt;
| CPE&lt;br /&gt;
| Junior (Current)&lt;br /&gt;
| Yes (CSSE 332)&lt;br /&gt;
| Yes (ECE 331)&lt;br /&gt;
| 6&lt;br /&gt;
| Usage/modification of open-source server software&lt;br /&gt;
|-&lt;br /&gt;
| Andrew Miller&lt;br /&gt;
| CPE&lt;br /&gt;
| Senior&lt;br /&gt;
| Yes (CSSE 332)&lt;br /&gt;
| Yes (ECE 331)&lt;br /&gt;
| 7&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| James Popenhagen&lt;br /&gt;
| CPE&lt;br /&gt;
| Senior&lt;br /&gt;
| Yes (CSSE 332)&lt;br /&gt;
| Yes (ECE 331)&lt;br /&gt;
| 7&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| John Lobdell&lt;br /&gt;
| CPE&lt;br /&gt;
| Senior&lt;br /&gt;
| Yes (CSSE 332)&lt;br /&gt;
| Yes (ECE 331)&lt;br /&gt;
| 7&lt;br /&gt;
| Programmed with SDL&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>Lobdeljt</name></author>	</entry>

	</feed>