<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace V5 Site Server v5.13.166 (http://www.squarespace.com) on Wed, 19 Jun 2013 18:29:26 GMT--><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/"><title>Journal</title><subtitle>Journal</subtitle><id>http://www.polyideas.com/journal/</id><link rel="alternate" type="application/xhtml+xml" href="http://www.polyideas.com/journal/"/><link rel="self" type="application/atom+xml" href="http://www.polyideas.com/journal/atom.xml"/><updated>2013-05-15T16:02:33Z</updated><generator uri="http://five.squarespace.com/" version="Squarespace V5 Site Server v5.13.166 (http://www.squarespace.com)">Squarespace</generator><entry><title>Weekend Project: PiSwitch using the Raspberry PiFace</title><id>http://www.polyideas.com/journal/2013/5/15/weekend-project-piswitch-using-the-raspberry-piface.html</id><link rel="alternate" type="text/html" href="http://www.polyideas.com/journal/2013/5/15/weekend-project-piswitch-using-the-raspberry-piface.html"/><author><name>Jay Doscher</name></author><published>2013-05-15T14:54:26Z</published><updated>2013-05-15T14:54:26Z</updated><content type="html" xml:lang="en-US"><![CDATA[<div><span>Here at Polyideas we're big fans of power efficiency- we're convinced it's the next big thing. &nbsp;Some people may hear 'efficiency' and think going without- but more and more these days there are clever solutions to saving electricity. &nbsp;In Southern California, this means saving money!</span></div>
<div><span>&nbsp;</span></div>
<div>
<div>This project focuses on a common area of power usage in the home- the humble PC. &nbsp;Sure, laptops are more efficient- but sometimes only a PC will do. &nbsp;Many of us leave a PC on just in case we need to log onto it remotely. &nbsp;If we're not using it, it's just sitting there using electricity- and usually quite a bit of it. &nbsp;The most efficient desktop PCs still use around 35-45 watts when idling. &nbsp;Gaming PCs with big video cards can easily top 200 watts! &nbsp;</div>
<div>&nbsp;</div>
<div>The PiSwitch solution lets you hook up a Raspberry Pi to your PC to control your power and reset buttons. &nbsp;The Raspberry Pi only uses about 1 watt of power when on, so it's more economical to leave it on all the time. &nbsp;In this article, I'll walk through how to set up the Raspberry Pi from start to finish to do this. &nbsp;The list of parts is available below, most of which you can get from <a href="https://www.sparkfun.com/">SparkFun</a>. All Sparkfun parts are on the wishlist <a href="https://www.sparkfun.com/wish_lists/63190">here</a>.</div>
<div></div>
<div></div>
<div>
<ul>
<li><a href="https://www.sparkfun.com/products/11546">Raspberry Pi</a></li>
<li><a href="https://www.sparkfun.com/products/11772">Raspberry PiFace expansion card</a></li>
<li><a href="https://www.amazon.com/dp/B005TUQVQS/ref=as_li_ss_til?tag=jaysblog0f-20&amp;camp=0&amp;creative=0&amp;linkCode=as4&amp;creativeASIN=B005TUQVQS&amp;adid=14XC6D9NRQPHTVYTYM7G&amp;">SD Card</a></li>
<li><a href="https://www.sparkfun.com/products/11456">5V power supply</a></li>
<li><a href="https://www.sparkfun.com/products/10215">Micro USB cable</a></li>
<li><a href="https://www.sparkfun.com/products/10453">Stand off screws</a></li>
<li><a href="https://www.sparkfun.com/products/10927">Stand off spacers</a></li>
<li><a href="https://www.amazon.com/dp/B00213KDQK/ref=as_li_ss_til?tag=jaysblog0f-20&amp;camp=0&amp;creative=0&amp;linkCode=as4&amp;creativeASIN=B00213KDQK&amp;adid=02EK93K6G7W23DW64ACQ&amp;">Motherboard wires</a></li>
<li><a href="https://www.amazon.com/dp/B002BH3Z8E/ref=as_li_ss_til?tag=jaysblog0f-20&amp;camp=0&amp;creative=0&amp;linkCode=as4&amp;creativeASIN=B002BH3Z8E&amp;adid=1ZTB7N7R9E0Z2GE49J5S&amp;">3.5" Hard drive adapter tray</a> (I used the free tray that came with my <a href="https://www.amazon.com/dp/B006VCP7YA/ref=as_li_ss_til?tag=jaysblog0f-20&amp;camp=0&amp;creative=0&amp;linkCode=as4&amp;creativeASIN=B006VCP7YA&amp;adid=1TM6K47BF70PPVGB8CFK&amp;">Intel SSD</a>)</li>
</ul>
</div>
<div></div>
<div>This project makes use of the very nifty Raspberry PiFace, which takes all the guesswork out of interfacing switches with the Raspberry Pi. &nbsp;In this article, we'll do the following:</div>
<div></div>
<div>
<ul>
<li>Format the SD card with Raspbian Wheezy</li>
<li>Install the files needed for the PiFace</li>
<li>Setup our scripts</li>
<li>Install the Raspberry Pi in our PC case</li>
<li>Test it out</li>
</ul>
</div>
<div></div>
<div></div>
<div></div>
<div>If you're familiar with our last Raspberry Pi article on setting up the MiniDLNA server, these steps may be familiar- this time we're using Raspbian Wheezy (<a href="http://www.raspberrypi.org/downloads">http://www.raspberrypi.org/downloads</a>). &nbsp;Other than that, these next few steps cover imaging your SD card using a PC. &nbsp;We're a pretty PC-friendly shop, so here we go! &nbsp;These steps work the same on Windows 7 &amp; 8. &nbsp;MAKE SURE YOUR SD CARD IS EMPTY- we will be erasing it in the next few steps!</div>
<div></div>
<div></div>
<div>Right-click on the new hard drive and select 'Format'.&nbsp; Be very careful you've got the right drive!<br /> If the memory card is under 20GB, select FAT32.&nbsp; Others might work, but I have done this with FAT32.&nbsp; That's ok, because it's going to get overwritten.&nbsp; We need the SDHC card to be blank though- don't skip this step.</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>Go ahead and check the box 'Quick Format' and click the 'Format' button.</div>
<div></div>
<div>Now that we have a blank SDHC card, we can write the Wheezy image onto it!</div>
<div></div>
<div>&nbsp;</div>
<div>Download a copy of the Raspbian Wheezy 2013-02-09 image from <a href="http://www.raspberrypi.org/downloads">here</a>.&nbsp; This may take a little bit since it's over 800 megabytes, so we'll come back to this step in a bit.&nbsp; When it's done downloading, it's a zip file that must be extracted to get the file named "2013-02-09-wheezy-raspbian.img".&nbsp;</div>
<div>Download the Win32DiskImager application here and extract the zip file to a folder.&nbsp; Inside the folder of files you just extracted, you will find Win32DiskImager.exe, go ahead and run it.&nbsp; If you're on Windows 7 or 8 and have User Account Control (UAC) turned on, it may prompt you for administrator access- this is ok since the application needs access to your disk devices to write the image.&nbsp; Now that we have it running, it looks something like the window below:<br />&nbsp;<br /> Click the blue file icon and navigate to your 2013-02-09-wheezy-raspbian.img&nbsp;file.&nbsp; If you try to do it with the original zip file you downloaded without extracting it, this process won't work.&nbsp; Under 'Device' you'll see that the application has selected a removable disk letter for you automatically.&nbsp; Make sure this is the right drive letter for your SDHC memory card!&nbsp; Again, if you select the wrong drive letter you can erase a drive on your PC.&nbsp; Once you're sure, click the "Write" button.</div>
<div></div>
<div>&nbsp;</div>
<div>When it's done you'll get a dialog box that tells you it's been successful.&nbsp; This means you have successfully written the Wheezy image to the SDHC card.&nbsp; Go ahead and unplug the SDHC USB adapter from your computer and insert it into the Raspberry Pi.&nbsp; Note the angled end of the memory card and how it lines up with the Raspberry Pi when you slide it in.</div>
<div>&nbsp;</div>
<div></div>
<div></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="http://www.polyideas.com/storage/post-images/JDD_0176.jpg?__SQUARESPACE_CACHEVERSION=1368633649962" alt="" /></span></span></div>
<div></div>
<div>&nbsp;</div>
<div>Go ahead and hook up all the connections to the Raspberry Pi. &nbsp;We're going to need to connect a monitor to it for the first time while we setup networking and some other steps. &nbsp;Go ahead and plug in an HDMI monitor, a USB keyboard and an ethernet cable. &nbsp;You may be able to use WiFi for this project, but our PC case is all metal and the wireless signals will have trouble- so this article will focus on wired networking.</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>Go ahead and connect the power, which will power on the Raspberry Pi. &nbsp;Run through the local menu that you get the first time to change your locale and keyboard layout among others. &nbsp;The UK keyboard is the default, and if you leave it in place you will have trouble using the '#' key. &nbsp;Make sure to go through each line in the initial setup. &nbsp;If you forget to do something like change your keyboard layout or expand the SD card, you can come back to the first setup menu by running 'raspi-config' from the command prompt.</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>After you've setup the initial settings, we still have a few steps to perform. &nbsp;We need to setup networking, update the Raspberry Pi and install the files for the PiFace. &nbsp;First, let's set a static IP address for the Raspberry Pi. &nbsp;This will make it easier for us to remote into the Raspberry Pi from other machines, and it's required if we're going to open a port on our router to get to the Raspberry Pi. &nbsp;Let's</div>
<div>start by running the command:</div>
<div></div>
<div>&nbsp;</div>
<div><em>sudo nano </em><em>
<div id="_mcePaste" style="display: inline !important;">/etc/network/interfaces</div>
</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>We need to comment out a couple lines on the configuration- when we add a '#' to the beginning of a line, it tells Linux to skip that line- this lets us disable certain lines without deleting them. &nbsp;</div>
<div></div>
<div>The file starts out looking like this:</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>
<div><em>auto lo</em></div>
<div><em><br /></em></div>
<div><em>iface lo inet loopback</em></div>
<div><em>iface eth0 inet dhcp</em></div>
<div><em><br /></em></div>
<div><em>allow-hotplug wlan0</em></div>
<div><em>iface wlan0 inet manual</em></div>
<div><em>wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf</em></div>
<div><em>iface default inet dhcp</em></div>
</div>
<div></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>When we're done, we've added our static IP, network mask and default gateway. Don't forget to make sure your Raspberry Pi's static IP doesn't overlap with ones given out by your router. &nbsp;My final network setup looks like this:</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>
<div><em>auto lo</em></div>
<div><em><br /></em></div>
<div><em>iface lo inet loopback</em></div>
<div><em>#iface eth0 inet dhcp</em></div>
<div><em>iface eth0 inet static</em></div>
<div><em>address 192.168.123.123</em></div>
<div><em>netmask 255.255.255.0</em></div>
<div><em>gateway 192.168.123.1</em></div>
<div><em><br /></em></div>
<div><em>allow-hotplug wlan0</em></div>
<div><em>iface wlan0 inet manual</em></div>
<div><em>wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf</em></div>
<div><em>iface default inet dhcp</em></div>
</div>
<div></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>The easiest thing to do now is save the file with a Ctrl-O then quit with a Ctrl-X. &nbsp;Now reboot with the command:</div>
<div>&nbsp;</div>
<div></div>
<div></div>
<div><em>sudo reboot</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>When the Raspberry Pi comes back, go ahead and login. &nbsp;Try pinging&nbsp;<a href="http://www.yahoo.com/">www.yahoo.com</a>&nbsp;with the command:</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div><em>ping&nbsp;<a href="http://www.yahoo.com/">www.yahoo.com</a></em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>You should see ping times in milliseconds if your network setup is good. &nbsp;If not, you'll need to grab a networking friend to help you get your networking squared away. &nbsp;Assuming we're good here- let's update some hardware settings our Raspberry Pi. &nbsp;We do this with the following commands:</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div><em>sudo nano /etc/modprobe.d/raspi-blacklist.conf</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>When it's open, insert a # at the start of the line that says 'blacklist spi-bcm2708'. &nbsp;The line should now look like this:</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div><em>#blacklist spi-bcm2708</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>Now&nbsp;save the file with a Ctrl-O then quit with a Ctrl-X. &nbsp;Now when the Raspberry Pi reboots it will find the PiFace automatically. &nbsp;From the shell we can run this command to turn it on manually:</div>
<div></div>
<div></div>
<div><em>sudo modprobe spi-bcm2708</em></div>
<div></div>
<div></div>
<div>Now that our PiFace hardware is setup, let's update the software to use it. &nbsp;Run the following commands to update your Raspberry Pi:</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div><em>sudo apt-get update</em></div>
<div><em>sudo apt-get upgrade</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>If you are prompted, press 'Y' or enter to agree to the updates. &nbsp;The second command will take a little while, so it's a good time to grab a cup of coffee. &nbsp;When these commands have completed, run the following command:</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div><em>wget -O -&nbsp;<a href="http://pi.cs.man.ac.uk/download/install.txt">http://pi.cs.man.ac.uk/download/install.txt</a>&nbsp;| bash</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>This step installs the files needed for your PiFace. &nbsp;When it's done, shut down with Raspberry Pi with the command:</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div><em>sudo halt</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>After all the green and yellow lights are off on your Raspberry Pi, go ahead and unplug all the connections. &nbsp;We need to drill the holes into the mounting plate so we can install the Raspberry Pi inside our PC case. &nbsp;You can see in the photo I have a wifi adapter on my Raspberry Pi to make sure I have room to add the wifi later if I want. &nbsp;</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="http://www.polyideas.com/storage/JDD_0244.jpg?__SQUARESPACE_CACHEVERSION=1368633659546" alt="" /></span></span></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>I used a small jewelers screwdriver (link) to scratch two small holes on the bracket to line up with the mounting holes on my Pi. &nbsp;Next, I drilled the holes- the holes need to be slightly larger than the thread in the screws.</div>
<div>&nbsp;</div>
<div></div>
<div></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="http://www.polyideas.com/storage/JDD_0245.jpg?__SQUARESPACE_CACHEVERSION=1368633668074" alt="" /></span></span></div>
<div>&nbsp;</div>
<div>After the holes have been drilled, I add in my spacers and spacer screws, if you look close you can see them in the pic below:</div>
<div>&nbsp;</div>
<div></div>
<div></div>
<div></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="http://www.polyideas.com/storage/JDD_0256.jpg?__SQUARESPACE_CACHEVERSION=1368633697218" alt="" /></span></span></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>After we install the spacers, we can mount the Pi to the spacers, then the PiFace to the Pi. &nbsp;It should look something like this:</div>
<div>&nbsp;</div>
<div></div>
<div></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="http://www.polyideas.com/storage/JDD_0264.jpg?__SQUARESPACE_CACHEVERSION=1368633705449" alt="" /></span></span></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>Now let's take our motherboard wires and clip the ends with the switches off. &nbsp;Clip close to the switches to make sure we have as much length of wire as possible- it needs to be able to reach our motherboard after we install the Pi. &nbsp;After we clip the switches off the wires, let's strip 1/8" of wire off the ends we just clipped. &nbsp;Attach the wire pair for the reset switch to terminals closest to jumper #3 on the PiFace.</div>
<div>&nbsp;</div>
<div>Make sure the wires go in the center connector and the 'NO' connector. &nbsp;This means 'Normally Open' and means the switch is off unless you turn on the relay.&nbsp;</div>
<div>&nbsp;</div>
<div></div>
<div></div>
<div>Attach the wire pair for the power switch to terminals remaining relay terminals, again using the center connector and the 'NO' connector.</div>
<div></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 400px;" src="http://www.polyideas.com/storage/PiFace.png?__SQUARESPACE_CACHEVERSION=1368633456595" alt="" /></span></span></div>
<div></div>
<div>&nbsp;</div>
<div>When we're done, our setup should look like this:</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="http://www.polyideas.com/storage/JDD_0269.jpg?__SQUARESPACE_CACHEVERSION=1368633714066" alt="" /></span></span></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>Now that we've connected the wires, let's power on our Raspberry Pi to test the setup before we install it in the PC. &nbsp;Reconnect everything on the Raspberry Pi and login. &nbsp;Let's create our script files for power on and reset of the PC. &nbsp;Let's start with the reset. &nbsp;Run the command:</div>
<div>&nbsp;</div>
<div></div>
<div></div>
<div><em>nano reset.py</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>The Nano text editor opens, type or paste in this:</div>
<div></div>
<div></div>
<div><em>&nbsp;</em></div>
<div><em>#!/usr/bin/python<br />&nbsp;<br /> from time import sleep<br /> import piface.pfio as pfio<br /> pfio.init()<br /> pfio.digital_write(0,1) #turn on<br /> sleep(0.1)<br /> pfio.digital_write(0,0) #turn off<br /> exit()</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>Now&nbsp;save the file with a Ctrl-O then quit with a Ctrl-X. &nbsp;Now we need to mark the file as executable to make it easier to run. &nbsp;Run the command:</div>
<div></div>
<div></div>
<div><em>&nbsp;</em></div>
<div><em>chmod +x reset.py</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>Now you should be able to run this command and hear the PiFace quickly click one of its relays, just like a person hitting the reset switch on a PC when you run the command:</div>
<div></div>
<div></div>
<div><em>&nbsp;</em></div>
<div><em>./reset.py</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>If you're looking at the PiFace you can see an LED flash on as well. &nbsp;Run it as many times as you like to test. &nbsp;When you're done, let's make the power script by running the command:</div>
<div></div>
<div>
<div>&nbsp;</div>
<div><em>nano power.py</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>The Nano text editor opens, type or paste in this:</div>
<div></div>
<div></div>
<div><em>&nbsp;</em></div>
<div><em>#!/usr/bin/python<br /><br /> from time import sleep<br /> import piface.pfio as pfio<br /> pfio.init()<br /> pfio.digital_write(1,1) #turn on<br /> sleep(0.1)<br /> pfio.digital_write(1,0) #turn off<br /> exit()</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>Now&nbsp;save the file with a Ctrl-O then quit with a Ctrl-X. &nbsp;Now we need to mark the file as executable to make it easier to run. &nbsp;Run the command:</div>
<div></div>
<div></div>
<div><em>&nbsp;</em></div>
<div><em>chmod +x power.py</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>Now you should be able to run this command and hear the PiFace quickly click one of its relays, just like a person hitting the power switch on a PC when you run the command:</div>
<div></div>
<div></div>
<div><em>&nbsp;</em></div>
<div><em>./power.py</em></div>
</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>If both of these run fine, then you're ready to power off and install the PiSwitch in your PC case. &nbsp;If you get errors, you need to recheck our PiFace hardware setup from the commands to make sure the hardware has been found. &nbsp;Also, remember that these Python scripts are sensitive to formatting, so extra tabs or spaces will break the scripts. &nbsp;Go ahead and shut down the Pi with the command:</div>
<div></div>
<div></div>
<div><em>&nbsp;</em></div>
<div><em>sudo halt</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>Unplug the power, usb keyboard and network connections and install the PiSwitch in the PC case. &nbsp;You can see how I ran the power and network cables through the back of my PC case here:</div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="http://www.polyideas.com/storage/JDD_0270.jpg?__SQUARESPACE_CACHEVERSION=1368633727697" alt="" /></span></span></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>Unplug your PC case's connectors for your power and reset wires from the PC motherboard and replace them with the PiSwitch ones. &nbsp;If you want to be fancy you can splice the PiSwitch ones without unplugging the existing case ones, but for us we'll just wire the PiSwitch directly to the motherboard. You can see this in the photo below:</div>
<div>&nbsp;</div>
<div></div>
<div></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="http://www.polyideas.com/storage/JDD_0272.jpg?__SQUARESPACE_CACHEVERSION=1368633736979" alt="" /></span></span></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>When we're all wired up, go ahead and power on the Raspberry Pi, making sure the power and network cables are plugged in. &nbsp;Then from your PC you can remote into your Pi using SSH (we like Putty). &nbsp;Go ahead and test the power on script by running:</div>
<div>&nbsp;</div>
<div></div>
<div></div>
<div><em>./power.sh</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>You should see your PC power on! &nbsp;If you don't, try running:</div>
<div></div>
<div></div>
<div><em>&nbsp;</em></div>
<div><em>./reset.sh</em></div>
<div></div>
<div></div>
<div>&nbsp;</div>
<div>If that works, it means you have your power and reset wires mixed up. &nbsp;Now you're ready to remotely turn your PC on and off remotely! &nbsp;We'd like to thank our sponsor <a href="https://www.sparkfun.com/">Sparkfun</a> for their support.</div>
<div></div>
<div></div>
</div>
<p>&nbsp;</p>]]></content></entry><entry><title>2 Axis Solar Tracker, Powered by Arduino</title><id>http://www.polyideas.com/journal/2013/4/22/2-axis-solar-tracker-powered-by-arduino.html</id><link rel="alternate" type="text/html" href="http://www.polyideas.com/journal/2013/4/22/2-axis-solar-tracker-powered-by-arduino.html"/><author><name>Jay Doscher</name></author><published>2013-04-22T16:35:38Z</published><updated>2013-04-22T16:35:38Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>My nearly year-long project starting with a design concept and finishing with a prototype is almost done. &nbsp;There's more tweaking to do, but I'm happy to announce this week I'll be posting several articles on the building of my Solar Outdoor Robot here on Polyideas. &nbsp;I'll be posting four different articles, each focusing on a different part of the build. &nbsp;These four articles will be:</p>
<p>&nbsp;</p>
<ol>
<li>Hardware protoyping, including materials selection and working with the different iterations of the design.</li>
<li>Electronics prototyping, including methods used, part selection and more.</li>
<li>Discussion and release of the source.</li>
<li>Wrap up and overview of the whole project.</li>
</ol>
<p>&nbsp;</p>
<p>I'll be sharing more to come, but here's a teaser of the hardware prototype!</p>
<p><iframe width="640" height="360" src="http://www.youtube.com/embed/uz37XvOVw0c?feature=player_detailpage" frameborder="0" allowfullscreen></iframe></p>
<p>You can also see me <a href="http://www.youtube.com/watch?list=PL7E1FAA9E63A32FDC&amp;v=TvljWyPK2L0&amp;feature=player_detailpage">here</a>&nbsp;on <a href="http://www.adafruit.com">Adafruit's</a> <a href="http://www.adafruit.com/blog/category/show-and-tell/">Show &amp; Tell</a> back in October with a very early prototype. &nbsp;</p>]]></content></entry><entry><title>Cool New Pixel Qi Display</title><id>http://www.polyideas.com/journal/2013/4/11/cool-new-pixel-qi-display.html</id><link rel="alternate" type="text/html" href="http://www.polyideas.com/journal/2013/4/11/cool-new-pixel-qi-display.html"/><author><name>Jay Doscher</name></author><published>2013-04-11T20:28:48Z</published><updated>2013-04-11T20:28:48Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>I'm looking forward to playing with one of <a href="http://www.adafruit.com/products/1303">these</a> in the coming weeks. &nbsp;The display has a normal mode with the backlight on that works great indoors- but can also be easily read in direct sunlight!&nbsp;</p>]]></content></entry><entry><title>Efficiency is the new Gigahertz</title><id>http://www.polyideas.com/journal/2013/4/1/efficiency-is-the-new-gigahertz.html</id><link rel="alternate" type="text/html" href="http://www.polyideas.com/journal/2013/4/1/efficiency-is-the-new-gigahertz.html"/><author><name>Jay Doscher</name></author><published>2013-04-02T03:43:40Z</published><updated>2013-04-02T03:43:40Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Not too long ago, Intel and AMD sparred in the user arena over faster and faster clock speeds. &nbsp;Even the ubiquitous Pentium D was Intel's dual core answer to the AMD dual core Athlon. &nbsp;The trouble was that the Pentium D was really just two discreet CPUs on one die- and it was horribly inefficient in terms of both heat dissipation and energy consumption.</p>
<p>Fast forward 10 years:</p>
<p>Los Alamos National Labs is getting ready to decommission on of their newer, record-breaking computation clusters. &nbsp;Why? It costs to much to operate. <a href="http://www.theverge.com/2013/3/31/4167806/roadrunner-record-breaking-supercomputer-decommissioned-over-energy-inefficiency">That is, it uses too much electricity</a>.</p>
<p>Like it or not, California and much of the southwestern US is showing the trend that will set the pace for the next 10 years- power efficiency. &nbsp;It's not just about using less electricity- that's conservation (and sometimes good in its own right), efficiency is about losing as little heat as possible for each CPU operation.</p>
<p>For example:</p>
<p>&nbsp;</p>
<ul>
<li>A Raspberry Pi uses about 2 watts of power when really chugging along. In Southern California that costs about $5 a year. So assuming you spent nothing else, you're talking about $40 for the first year (counting the purchase of the Pi) and $5 each year after that. &nbsp;</li>
<li>Now compare an AMD E-350 system, one of the lowest power AMD offerings- It costs about $115 to buy and $70 per year to operate. That makes it a whopping $185 in the first year, or $465 over five years- compared to $60 for 5 years on the Pi.</li>
<li>Now compare the lastest Xeon CPU, which costs about $350 for a basic motherboard and the CPU. &nbsp;It costs about $125 a year to operate. That's $975 over 5 years.</li>
</ul>
<p>Now ask yourself- surely there are things that require a Xeon CPU- but are your needs really with the clock speed king... the Xeon? &nbsp;Most people, most of the time simply don't need that much power, but more importantly, <em>once people have a choice they won't want to pay that much for what they feel they need.</em></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content></entry><entry><title>Afternoon Project: Raspberry Pi DLNA &amp; File Server</title><id>http://www.polyideas.com/journal/2013/3/30/afternoon-project-raspberry-pi-dlna-file-server.html</id><link rel="alternate" type="text/html" href="http://www.polyideas.com/journal/2013/3/30/afternoon-project-raspberry-pi-dlna-file-server.html"/><author><name>Jay Doscher</name></author><published>2013-03-30T18:20:16Z</published><updated>2013-03-30T18:20:16Z</updated><content type="html" xml:lang="en-US"><![CDATA[<div>In the spirit of a nice afternoon project, I'd encourage you to use what's laying around if it's close to the specs here. &nbsp;But if you're going to buy all these parts ahead of time like I do, hopefully it will help to use the product links below. &nbsp;While I love Amazon, please try and support great suppliers like Adafruit, who have a great forum community, customer service and tutorial section!</div>
<div></div>
<div>
<ul>
<li>Raspberry Pi Model B (Although a Model A might work, it wasn't used for this build.) Get it from <a href="http://www.adafruit.com/products/998">Adafruit</a> or <a href="https://www.amazon.com/dp/B009SQQF9C/ref=as_li_ss_til?tag=86753090e-20&amp;camp=0&amp;creative=0&amp;linkCode=as4&amp;creativeASIN=B009SQQF9C&amp;adid=1DH8AT7G2TVK04ZSQGPN&amp;">Amazon</a>.</li>
<li>5VDC USB Power Supply (For some reason, I had 2 of these in the bottom of a box, but <a href="http://www.adafruit.com/products/501">this one</a> would work great too.)</li>
<li>16GB SDHC Memory Card (I used <a href="https://www.amazon.com/dp/B007M54E08/ref=as_li_ss_til?tag=86753090e-20&amp;camp=0&amp;creative=0&amp;linkCode=as4&amp;creativeASIN=B007M54E08&amp;adid=1JZWNN0VS2H3WJJ10BPF&amp;">this one</a>, but feel free to use whatever you have laying around- this tutorial might not work with smaller density cards, so beware.)</li>
<li>HDMI Monitor and HDMI Cable (I happen to have <a href="https://www.amazon.com/dp/B005BZNDS0/ref=as_li_ss_til?tag=86753090e-20&amp;camp=0&amp;creative=0&amp;linkCode=as4&amp;creativeASIN=B005BZNDS0&amp;adid=0QVR3X6YFE35AAY9P2WK&amp;">this one</a>, but anyone should do.)</li>
<li>3TB External Hard Drive (I used <a href="https://www.amazon.com/dp/B00834SJU8/ref=as_li_ss_til?tag=86753090e-20&amp;camp=0&amp;creative=0&amp;linkCode=as4&amp;creativeASIN=B00834SJU8&amp;adid=18JYFE629ZBPW8GWYSNM&amp;">this one</a>.)</li>
<li>A USB to SDHC Adapter (Like <a href="https://www.amazon.com/dp/B000YBH4YU/ref=as_li_ss_til?tag=86753090e-20&amp;camp=0&amp;creative=0&amp;linkCode=as4&amp;creativeASIN=B000YBH4YU&amp;adid=1WJGH7KRE3N9E8EB0DF4&amp;">this one</a>.)</li>
<li>USB Keyboard</li>
</ul>
</div>
<div>I'm guessing you already have a Windows PC nearby, you'll need that too. &nbsp;For software, you'll need:</div>
<div>
<ul>
<li><a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html">Putty</a></li>
<li><a href="http://sourceforge.net/projects/win32diskimager/">Win32DiskImager</a></li>
<li><a href="http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2">Occidentalis v0.2</a></li>
</ul>
</div>
<div></div>
<div></div>
<div></div>
<div><strong><span style="text-decoration: underline;">From your Windows PC:</span></strong></div>
<div>There are other ways to do this with Linux and OSX, but our tinker machines a PCs, so I thought it would be helpful to give everyone the rundown on a PC.</div>
<div></div>
<div>First, we need to setup the external drive. &nbsp;Since all my cool tunes from Archive.org are on another Windows PC, and most of the machines in my house are also Windows, it's important that I can plug the big storage drive into a Windows machine and copy stuff whenever I need to. Do the following:</div>
<div>
<ul>
<li>Assuming you're starting with a brand new drive, find it in My Computer and format it. To do this, right-click on the new hard drive and select 'Format'. &nbsp;Be very careful you've got the right drive, otherwise you're going to delete important stuff. &nbsp;If it's not a new drive, move everything off before formatting it. &nbsp;!!Formatting the drive will erase everything on the drive!!</li>
<li>When you format it, select the filesystem type 'ExFAT'. &nbsp;Exfat is cool because it's supported a little better than NTFS on Linux, and it's fully supported on Windows 7&amp;8 too- even for very large drives (unlike FAT or FAT32).</li>
<li>Go ahead and check the box 'Quick Format' and click the 'Format' button.</li>
<li>Once it's formatted with ExFAT, go ahead and copy stuff onto it- in my case it's my Music from Archive.org.</li>
<li>Assuming you've got quite a bit of stuff to copy, go ahead and step away while the copy job is running. &nbsp;If you don't have anything to copy, unplug the drive and set it aside- we'll come back to it later.</li>
</ul>
<div>Next up is setting up the SDHC card to image Occidentalis onto it. &nbsp;Go ahead and plug the SDHC card into the USB adapter, then plug that into the PC. &nbsp;Note what drive comes up, because we're going to format it too.</div>
</div>
<div>
<ul>
<li>Again, I'm assuming you've got a brand new memory card to play with- if you still have stuff on it, move it off now- we're going to format this card too, and that erases everything on the memory card.</li>
<li>Right-click on the new hard drive and select 'Format'. &nbsp;Be very careful you've got the right drive!</li>
<li>If the memory card is under 20GB, select FAT32. &nbsp;Others might work, but I have done this with FAT32. &nbsp;That's ok, because it's going to get overwritten. &nbsp;We need the SDHC card to be blank though- don't skip this step.</li>
<li>Go ahead and check the box 'Quick Format' and click the 'Format' button.</li>
</ul>
Now that we have a blank SDHC card, we can write the Occidentalis v0.2 image onto it!</div>
<div>Download a copy of the Occidentalis v0.2 image from Adafruit <a href="http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2">here</a>. &nbsp;This may take a little bit since it's over 800 megabytes, so we'll come back to this step in a bit. &nbsp;When it's done downloading, it's a zip file that must be extracted to get the file named "Occidentalis_v02.img". &nbsp;</div>
<div></div>
<div>Download the Win32DiskImager application <a href="http://sourceforge.net/projects/win32diskimager/">here&nbsp;</a>and extract the zip file to a folder. &nbsp;Inside the folder of files you just extracted, you will find Win32DiskImager.exe, go ahead and run it. &nbsp;If you're on Windows 7 or 8 and have User Account Control (UAC) turned on, it may prompt you for administrator access- this is ok since the application needs access to your disk devices to write the image. &nbsp;Now that we have it running, it looks something like the window below:</div>
<div></div>
<div></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 400px;" src="http://www.polyideas.com/storage/post-images/image%20the%20sd%20card.png?__SQUARESPACE_CACHEVERSION=1364668759441" alt="" /></span></span></div>
<div></div>
<div></div>
<div></div>
<div>Click the blue file icon and navigate to your Occidentalis file, and it should be named "Occidentalis_v02.img". &nbsp;If you try to do it with the original zip file you downloaded without extracting it, this process won't work. &nbsp;Under 'Device' you'll see that the application has selected a removable disk letter for you automatically. &nbsp;Make sure this is the right drive letter for your SDHC memory card! &nbsp;Again, if you select the wrong drive letter you can erase a drive on your PC. &nbsp;Once you're sure, click the "Write" button.</div>
<div></div>
<div></div>
<div>When it's done you'll get a dialog box that tells you it's been successful. &nbsp;This means you have successfully written the Occidentalis image to the SDHC card. &nbsp;Go ahead and unplug the SDHC USB adapter from your computer and insert it into the Raspberry Pi. &nbsp;Note the angled end of the memory card and how it lines up with the Raspberry Pi when you slide it in.</div>
<div></div>
<div>Raspberry Pi Memory Card photo</div>
<div></div>
<div>Go ahead and hook up all the connections to the Raspberry Pi. &nbsp;This includes:</div>
<div>
<ul>
<li>Plug in the SDHC card, in case you haven't done so already.</li>
<li>Plug in the HDMI cable to your monitor and the other end to your Raspberry Pi.</li>
<li>Plug in the network cable to the Raspberry Pi.</li>
<li>Plug in the USB keyboard</li>
<li>Last, plug in the power.</li>
</ul>
</div>
<p>&nbsp;</p>
<p><span class="full-image-block ssNonEditable"><span><img style="width: 600px;" src="http://www.polyideas.com/storage/post-images/JDD_0176.jpg?__SQUARESPACE_CACHEVERSION=1364670637979" alt="" /></span></span></p>
<div></div>
<div></div>
<div></div>
<div>It will take a minute to boot up, but you'll find out that this $40 computer runs pretty fast!</div>
<div></div>
<div>When the Pi boots up for the first time, you'll be greeted by the Raspi-config menu. &nbsp;We'll do a couple things here that will help with the operation of the Pi.</div>
<div></div>
<div></div>
<div>
<ul>
<li>First, use the arrow keys to select 'expand_rootfs' and hit Enter. &nbsp;It will only take a second and give you a message something like, "Root partition has been resized. The filesystem will be enlarged upon the next reboot."&nbsp;</li>
<li>Hit Enter again.</li>
<li>It will take a second or two to load, but it will load up a list of locales. &nbsp;Scroll down and find "en_GB.UTF-8 UTF-8" and hit the spacebar to clear the * next to it. &nbsp;I'm not in England and don't have one of their keyboards, so I don't want this locale. &nbsp;Scroll down and find, "en_US.UTF-8 UTF-8" and hit the spacebar to select it. &nbsp;You should see a * next to it. &nbsp;Use the Tab button to get to the 'Ok' button and close this menu.&nbsp;</li>
<li>When prompted, select 'en_US.UTF-8' for the default system locale and hit Enter. &nbsp;It will take 20-30 seconds to update the system.</li>
<li>Arrow down to 'ssh' and hit enter. When prompted, select 'Enable' and hit Enter. Hit Enter again after it tells you it's been enabled.</li>
<li>Arrow down to 'change_pass' and hit Enter. &nbsp;Enter your new password, then again to confirm. &nbsp;Your username is pi.</li>
<li>Arrow down to 'Finish' and hit Enter. &nbsp;When prompted for the reboot, select 'Yes'.</li>
<li>When it reboots it will resize the partitions to use the whole SDHC card. This only takes about 1 minute.</li>
<li>Login with your new password. Remember, your username is 'pi' and the password is whatever you set it before rebooting.</li>
</ul>
</div>
<div></div>
<div></div>
<div><strong><span style="text-decoration: underline;">Nano Primer</span></strong></div>
<div>We're going to be using 'nano' to edit our files. &nbsp;Old-schoolers may prefer emacs or vi, but for the casual user nano is the way to go. &nbsp;You'll see 'sudo' at the beginning of each command, which is required since each of these files can only be opened by a root account. Sudo will run whatever you type in after it as root. &nbsp;Commands in nano are easy- they are at the bottom of the screen, but the easy ones are Ctrl-O to save the file, Ctrl-X to exit.</div>
<div></div>
<div></div>
<div><strong><span style="text-decoration: underline;">Networking</span></strong></div>
<div>This step is optional, but if you are going to use the Pi as a file server then you want a static IP for a number of reasons. We're going to change from a dynamic IP that uses 'DHCP' (Dynamic Host Configuration Protocol) to a static one. DHCP addresses are usually handed out by your router- we're going to assign one that never changes. &nbsp;We're going to use 192.168.26.6. First, let's fire up nano again, this time to edit the /etc/network/interfaces file. &nbsp;Go ahead and run the command:</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo nano /etc/network/interfaces</em></div>
<div></div>
<div></div>
<div></div>
<div>See the line that says:</div>
<div></div>
<div></div>
<div></div>
<div><em>iface eth0 inet dhcp</em></div>
<div></div>
<div></div>
<div>We're going to put a '#' in front of it so that Linux will skip it. Edit it so it looks like this:</div>
<div></div>
<div></div>
<div></div>
<div><em>#iface eth0 inet dhcp</em></div>
<div></div>
<div></div>
<div></div>
<div>Now below it, add these lines:</div>
<div></div>
<div></div>
<div></div>
<div><em>iface eth0 inet static<br /> address 192.168.26.7<br /> netmask 255.255.255.0<br /> gateway 192.168.26.1</em></div>
<div></div>
<div></div>
<div>You can leave all the other lines alone.</div>
<div>Hit Ctrl-O to save it, then Ctrl-X to quit.</div>
<div></div>
<div></div>
<div>We now need to reboot to make the changes take effect. &nbsp;At the console type:</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo reboot</em></div>
<div></div>
<div></div>
<div></div>
<div>After it's done rebooting, go ahead and log in again. &nbsp;From here on out you can use Putty as an SSH client to connect to your Pi from a windows machine. &nbsp;The commands will be the same, but to use Putty simply run it, type in the IP address of your Pi, then click 'Connect'. The first time you connect it will ask you to confirm the RSA thumbprint- it's ok just to click yes.</div>
<div></div>
<div></div>
<div>Next up, let's make sure all of our packages are up to date. &nbsp;We'll be using the system many Linux systems enjoy called 'apt-get'. &nbsp;This is a system for downloading and installing packages. &nbsp;Since many add-on applications for Linux require other applications, apt-get does a great job of automatically getting these dependencies for you.</div>
<div>This command will update the package list that apt-get has.</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo apt-get update</em></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="http://www.polyideas.com/storage/post-images/get%20update%201.png?__SQUARESPACE_CACHEVERSION=1364668810535" alt="" /></span></span></div>
<div></div>
<div></div>
<div>Now that we've updated apt-get, let's go ahead and upgrade all of our packages. &nbsp;</div>
<div>Press 'y' when prompted.</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo apt-get upgrade</em></div>
<div></div>
<div></div>
<div></div>
<div><br /><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="http://www.polyideas.com/storage/post-images/get%20upgrade%201.png?__SQUARESPACE_CACHEVERSION=1364668835672" alt="" /></span></span></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div>This will take a while- go grab a cup of coffee while you wait, this could take at least an hour.</div>
<div></div>
<div></div>
<div>Now let's install the packages we need:</div>
<div></div>
<div>First we'll add support for the ExFAT filesystem. This is easy, thanks to our friend apt-get:</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo apt-get install exfat-fuse</em></div>
<div></div>
<div></div>
<div></div>
<div>Pretty easy! Now let's plug in your external drive to the Raspberry Pi. &nbsp;You can run the command 'dmesg' and it will spit out a bunch of stuff- but if you look, you can see the last 20 or so lines it can see your hard drive you just plugged in. &nbsp;Look at the screenshot below, and you can see if found my 'U3 Cruzer Micro' and you can see it's been identified as disk [sda1]. &nbsp;Now we're ready to mount it, but before we do we need to make a folder for it to mount to. Let's call it 'flash4gb' and let's put it under the /media folder. &nbsp;To do that, run this command:</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo mkdir /media/flash4gb</em></div>
<div></div>
<div></div>
<div></div>
<div>Now let's mount the drive:</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo mount /dev/sda1 /media/flash4gb -t exfat</em></div>
<div></div>
<div></div>
<div></div>
<div>Let's check and make sure it's there:</div>
<div></div>
<div></div>
<div></div>
<div><em>df -h</em></div>
<div><em><br /></em></div>
<div></div>
<div></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="http://www.polyideas.com/storage/post-images/mounted%20drive.png?__SQUARESPACE_CACHEVERSION=1364668869607" alt="" /></span></span></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div>Ok, if we look at the screen above we can see it's mounted and it sees all 3.8GB of the USB drive. &nbsp;Remember, this process is the same for the 3TB drive in the example- my 3TB is still copying files over so it will be a little while. &nbsp;We'll keep going with the flash drive.</div>
<div></div>
<div>If we left it as it is now, the drive will be uncleanly dismounted (forced) when the Raspberry Pi shuts down, and it won't be mounted automatically either. &nbsp;Let's modify the fstab file that keeps track of what gets mounted on boot. &nbsp;If you're going to remove the drive all the time, you don't want it in fstab- but we will want it in there. &nbsp;Run the command:</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo nano /etc/fstab</em></div>
<div><em><br /></em></div>
<div>Add a new line at the bottom that reads (each set of text is separated by a tab):</div>
<div></div>
<div></div>
<div><em>/dev/sda1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /media/flas</em><span style="font-style: italic;">h4gb &nbsp; &nbsp; &nbsp; exfat&nbsp;&nbsp; defaults&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1</span></div>
<div></div>
<div></div>
<div></div>
<div>Again, Ctrl-O to save, Ctrl-X to exit.</div>
<div></div>
<div></div>
<div>Let's install Samba, the network suite that lets our Raspberry Pi look like a Windows file server. Run the</div>
<div>apt-get command as shown:</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo apt-get install samba</em></div>
<div></div>
<div></div>
<div></div>
<div>When prompted, hit Enter to approve the packages and let apt-get do all the work. &nbsp;Now it's time for some very, very basic Samba configuration. &nbsp;Samba is a beast, and can take lots of effort to get it just right. &nbsp;For this tutorial, we're only going to setup basic sharing so we can see our media files. &nbsp;To do that, we need to edit the Samba configuration&nbsp;<a>file:</a></div>
<div></div>
<div></div>
<div></div>
<div><em>sudo nano /etc/samba/smb.conf</em></div>
<div></div>
<div></div>
<div></div>
<div>Scroll down about 300 lines, and you'll see a section called [printers]. &nbsp;We're not going to add any printers, but you can look at that section and how it's laid out. &nbsp;We're going to add a new section below it, but leave the printers stuff there. &nbsp;Add the following lines:</div>
<div></div>
<div></div>
<div></div>
<div><em>[Archive.org-Music]<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; comment = Archive.org Music Share<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; path = /media/flash4gb/music<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; guest ok = yes<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; browseable = yes<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; create mask = 0600<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; directory mask = 0700</em></div>
<div></div>
<div></div>
<div></div>
<div>Again, press Ctrl-O to save, Ctrl-X to exit.</div>
<div></div>
<div>Now let's restart Samba to read our new configuration.</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo service samba restart</em></div>
<div></div>
<div></div>
<div></div>
<div>Now if we navigate to the Raspberry Pi from the network, we can see the files are there from the flash drive and happy.&nbsp;</div>
<div></div>
<div></div>
<div>Now we're ready for minidlna, a lightweight and simple DLNA server that will stream to network devices, specifically my TV. First, let's install minidlna with apt-get, confirm when it asks with a press of the Enter key.</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo apt-get install minidlna</em></div>
<div></div>
<div></div>
<div></div>
<div>Now that it's installed, we need to setup the folder in minidlna.conf</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo nano /etc/minidlna.conf</em></div>
<div></div>
<div></div>
<div></div>
<div>We're going to add a line that looks like this:</div>
<div></div>
<div></div>
<div><em>media_dir=A,/media/flash4gb/music</em></div>
<div></div>
<div></div>
<div></div>
<div>We will also comment out the line that looks like this:</div>
<div></div>
<div></div>
<div></div>
<div><em>media_dir=/var/lib/minidlna</em></div>
<div></div>
<div></div>
<div></div>
<div>Now it should look like this:</div>
<div></div>
<div></div>
<div></div>
<div><em>#media_dir=/var/lib/minidlna</em></div>
<div></div>
<div></div>
<div></div>
<div>We're telling minidlna which folders have media to stream, and the A stands for audio. &nbsp;If you had one with video, we'd change it to a V. Hit Ctrl-O to save, Ctrl-X to exit.</div>
<div></div>
<div></div>
<div></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 500px;" src="http://www.polyideas.com/storage/post-images/minidlna%20screenshot.png?__SQUARESPACE_CACHEVERSION=1364668958887" alt="" /></span></span></div>
<div></div>
<div></div>
<div></div>
<div>Now we need to launch minidlna the first time with a -R to get it to build the library. &nbsp;Run this command:</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo minidlna -R</em></div>
<div></div>
<div></div>
<div></div>
<div>Depending on the size of your library, this could take several minutes. &nbsp;For me, I only have a few albums here, so it indexed right away. Finally, let's restart minidlna one more time:</div>
<div></div>
<div></div>
<div></div>
<div><em>sudo service minidlna restart</em></div>
<div></div>
<div></div>
<div></div>
<div>Go check your local DLNA client. &nbsp;For me, it's the TV.</div>
<div></div>
<div></div>
<div></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 600px;" src="http://www.polyideas.com/storage/post-images/JDD_0183.jpg?__SQUARESPACE_CACHEVERSION=1364670740859" alt="" /></span></span></div>
<div></div>
<div>Now that we have it running, it's time to tinker with it! &nbsp;As you can probably tell from the first photo, the cables weigh more than the Raspberry Pi itself. &nbsp;I needed something to anchor it to, and I figured that new 3TB hard drive would do the trick. &nbsp;So I carefully drilled a few holes...</div>
<div></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 400px;" src="http://www.polyideas.com/storage/post-images/JDD_0186.jpg?__SQUARESPACE_CACHEVERSION=1364670818865" alt="" /></span></span></div>
<div></div>
<div>Then I mounted a couple generic standoff screws to it. &nbsp;I carefully screwed on the standoffs- the plastic is very soft and I did not want to strip the threads. &nbsp;Then I mounted the Raspberry Pi using a couple small PC screws.</div>
<div></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 600px;" src="http://www.polyideas.com/storage/post-images/JDD_0191.jpg?__SQUARESPACE_CACHEVERSION=1364670864409" alt="" /></span></span></div>
<div></div>
<div>After that, I wired it all back up.</div>
<div></div>
<div><span class="full-image-block ssNonEditable"><span><img style="width: 600px;" src="http://www.polyideas.com/storage/post-images/JDD_0194.jpg?__SQUARESPACE_CACHEVERSION=1364670945688" alt="" /></span></span></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div>And that's it! Please remember to check the parts list for links to pick up the parts, and a big shout-out to <a href="http://adafruit.com/">Adafruit</a>!</div>
<div></div>
<div>Follow up: I shared this project on Adafruit's Show and Tell this last weekend. &nbsp;You can see it on YouTube here:</div>
<div></div>
<div><iframe width="640" height="360" src="http://www.youtube.com/embed/2WFKuMhtw9Q?feature=player_detailpage" frameborder="0" allowfullscreen></iframe></div>
<div></div>
<div></div>
<div></div>]]></content></entry><entry><title>Batiquitos Lagoon Hiking Review</title><id>http://www.polyideas.com/journal/2013/2/25/batiquitos-lagoon-hiking-review.html</id><link rel="alternate" type="text/html" href="http://www.polyideas.com/journal/2013/2/25/batiquitos-lagoon-hiking-review.html"/><author><name>Jay Doscher</name></author><published>2013-02-26T02:14:47Z</published><updated>2013-02-26T02:14:47Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>The Batiquitos Lagoon is a coastal wetland located in northern San Diego County. &nbsp;For those familiar with the area, it is located just off the 5 freeway in Carlsbad. &nbsp;If you'd like to learn more about the site you can visit the lagoon's website <a href="http://www.batiquitosfoundation.org/">here</a>, but I'd recommend just taking a visit one morning.</p>
<p>The trail is about 1.6 miles from the entrance to the end. While 3.2 miles may sound a little long for the beginner, the trail is flat with a good combination of sun and shade. &nbsp;The foundation has also installed several new benches throughout the trail, so it's also quite easy to stop and rest. &nbsp;There are many other walkers, joggers and folks with dogs- but all of the dogs I observed were well behaved and on leashes, which is the local law.</p>
<p><span class="full-image-block ssNonEditable"><span><img style="width: 600px;" src="http://www.polyideas.com/storage/post-images/batiquitos-trail.JPG?__SQUARESPACE_CACHEVERSION=1361845245403" alt="" /></span></span></p>
<p>Overall the trail is in excellent condition and gives many opportunities to enjoy the wetlands without going into the mud or climbing any steep grades. &nbsp;Many fellow walkers may also be chatting with one another or even talking on the phone, but in between you'll find a wonderful assortment of birds to listen to. &nbsp;The trail starts out sandy but becomes compacted dirt by the end of the trail. &nbsp;You can find this hike and others in the book "Best Easy Day Hikes San Diego" (<a href="https://www.amazon.com/dp/B007SRXHIA/ref=as_li_ss_til?tag=86753090e-20&amp;camp=0&amp;creative=0&amp;linkCode=as4&amp;creativeASIN=B007SRXHIA&amp;adid=0WW0ZPR9DZ3PWT71DBC2&amp;">Amazon Link</a>). &nbsp;I'll be posting a brief review as I hike each of the trails in this book, one at a time- so stay tuned for more trail reviews.</p>]]></content></entry><entry><title>GPS Clock using an Arduino Micro</title><id>http://www.polyideas.com/journal/2012/12/16/gps-clock-using-an-arduino-micro.html</id><link rel="alternate" type="text/html" href="http://www.polyideas.com/journal/2012/12/16/gps-clock-using-an-arduino-micro.html"/><author><name>Jay Doscher</name></author><published>2012-12-16T22:47:50Z</published><updated>2012-12-16T22:47:50Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>I've posted a new video of the small GPS clock project I have been working on this past week. &nbsp;It's pretty easy to do, and only needs soldering on the GPS and LED units. &nbsp;You can mount everything to a breadboard, so you don't need to commit the parts to the project permanently. &nbsp;</p>
<p>You can see the <a href="http://youtu.be/0mV9ZB-UfuY">video here.</a></p>
<p><iframe width="640" height="360" src="http://www.youtube.com/embed/0mV9ZB-UfuY?feature=player_detailpage" frameborder="0" allowfullscreen></iframe></p>
<p>Code is <a href="https://github.com/polyideas/GPSClock/">on Github here</a>.</p>
<p>The parts for this build are:</p>
<p>&nbsp;</p>
<ul>
<li>(1) <a href="https://www.adafruit.com/products/239">Breadboard</a></li>
<li>(1) <a href="https://www.adafruit.com/products/746">GPS breakout board</a></li>
<li>(1) <a href="https://www.adafruit.com/products/879">4-Digit 7-Segment LED backpack</a>&nbsp;(I picked yellow, but there are other colors too)</li>
<li>(1) <a href="https://www.adafruit.com/products/1086">Arduino Micro</a></li>
<li>(1) <a href="https://www.adafruit.com/products/153">Pack of jumper wires (this project used 10 wires)</a></li>
<li>(1) <a href="https://www.amazon.com/dp/B004GF8TIK/ref=as_li_ss_til?tag=86753090e-20&amp;camp=0&amp;creative=0&amp;linkCode=as4&amp;creativeASIN=B004GF8TIK&amp;adid=1ZBJSBTBCY5YJK91T6WH&amp;">Micro-USB Cable</a></li>
</ul>
<p>&nbsp;</p>]]></content></entry><entry><title>Polyideas Flickr Pool</title><id>http://www.polyideas.com/journal/2012/12/4/polyideas-flickr-pool.html</id><link rel="alternate" type="text/html" href="http://www.polyideas.com/journal/2012/12/4/polyideas-flickr-pool.html"/><author><name>Jay Doscher</name></author><published>2012-12-05T03:16:59Z</published><updated>2012-12-05T03:16:59Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>I've started adding photos to the Flickr Pool named "Polyideas" <a href="http://www.flickr.com/groups/polyideas/">here</a>. &nbsp;That is the best place to keep track of the projects I'm up to.</p>]]></content></entry><entry><title>Disable Driver Signing in Windows 8</title><id>http://www.polyideas.com/journal/2012/11/30/disable-driver-signing-in-windows-8.html</id><link rel="alternate" type="text/html" href="http://www.polyideas.com/journal/2012/11/30/disable-driver-signing-in-windows-8.html"/><author><name>Jay Doscher</name></author><published>2012-12-01T04:22:20Z</published><updated>2012-12-01T04:22:20Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>As you may know, Windows 8 ships with the requirement that drivers be signed digitally. &nbsp;You can turn it off with a series of safe-boot menu selections, but the downside is that Bitlocker-encrypted machines require the full recovery key. That's a pain, and thanks to RadiatorTwo from the Dangerous Prototypes forums have a simpler workaround:</p>
<p>Open a command prompt as Administrator run these commands.</p>
<p style="padding-left: 30px;"><em> bcdedit -set loadoptions DISABLE_INTEGRITY_CHECKS</em></p>
<p style="padding-left: 30px;"><em>bcdedit -set TESTSIGNING ON</em></p>
<p>This should avoid the need to enter your recovery key, but we all know you should have those numbers handy anyway. &nbsp;This feature is handy for Arduinos or any other homebrew drivers that don't go through Microsoft's driver qualification process. The original post is <a href="http://dangerousprototypes.com/forum/viewtopic.php?f=23&amp;t=4738#p46678">here.</a></p>]]></content></entry><entry><title>Lego Continuously Variable Transmission (CVT)</title><id>http://www.polyideas.com/journal/2012/8/12/lego-continuously-variable-transmission-cvt.html</id><link rel="alternate" type="text/html" href="http://www.polyideas.com/journal/2012/8/12/lego-continuously-variable-transmission-cvt.html"/><author><name>Jay Doscher</name></author><published>2012-08-12T13:05:34Z</published><updated>2012-08-12T13:05:34Z</updated><content type="html" xml:lang="en-US"><![CDATA[<p>Legos can be used to build all kinds of things. &nbsp;As a kid I managed to build a two speed transmission, but this is great - a CVT.</p>
<p><a href="http://www.youtube.com/watch?v=CuIG5ntUv1I">YouTube</a></p>]]></content></entry></feed>