<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.2.1">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2021-10-18T20:54:29+00:00</updated><id>/feed.xml</id><title type="html">Dave’s Blog</title><subtitle>Dave's little collection of ramblings, hobbies, code, and thoughts</subtitle><entry><title type="html">Verizon using recent Net Neutrality victory to wage war against Netflix</title><link href="/2014/02/05/verizon-using-recent-net-neutrality-victory-to-wage-war-against-netflix.html" rel="alternate" type="text/html" title="Verizon using recent Net Neutrality victory to wage war against Netflix" /><published>2014-02-05T13:25:50+00:00</published><updated>2014-02-05T13:25:50+00:00</updated><id>/2014/02/05/verizon-using-recent-net-neutrality-victory-to-wage-war-against-netflix</id><content type="html" xml:base="/2014/02/05/verizon-using-recent-net-neutrality-victory-to-wage-war-against-netflix.html">&lt;hr /&gt;
&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;
The team over at Speedchecker Ltd has created a speedtest oriented around this issue.  They are going to be collecting data and presenting findings if they get enough data:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://netneutralitytest.com/&quot;&gt;http://netneutralitytest.com/&lt;/a&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;I usually don’t post articles about current affairs.   However, a recent series of events has inspired me to write about this.&lt;/p&gt;

&lt;p&gt;Towards the end of January, the president of our company - &lt;a href=&quot;https://www.iscanonline.com&quot;&gt;iScan Online, Inc.&lt;/a&gt;, was complaining that our service was experiencing major slowdowns.  I investigated the issue, but I couldn’t find anything wrong with our production environment.  We were stumped.&lt;/p&gt;

&lt;p&gt;One evening I also noticed a slowdown while using our service from my house.  I realized that the one thing in common between me and our president was that we both had FiOS internet service from Verizon.&lt;/p&gt;

&lt;p&gt;Since we host all of our infrastructure on Amazon’s AWS - I decided to do a little test - I grabbed a URL from AWS S3 and loaded it.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;40kB/s.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;WTF.&lt;/p&gt;

&lt;p&gt;I also noticed that our Netflix streaming quality is awful compared to just a few weeks ago.&lt;/p&gt;

&lt;p&gt;Next, I remoted into our office - about a mile away from my house.  I tested the same link -&lt;/p&gt;

&lt;p&gt;5000kB/s.&lt;/p&gt;

&lt;p&gt;WTF.&lt;/p&gt;

&lt;p&gt;So I contacted Verizon support over their live chat.&lt;/p&gt;

&lt;p&gt;Verizon had me do a speedtest.&lt;/p&gt;

&lt;p&gt;75Mb/s.&lt;/p&gt;

&lt;p&gt;He says “You have excellent Bandwidth - is there anything else I can help you with?”&lt;/p&gt;

&lt;p&gt;I replied - “Yes.  Why are these files slow…”&lt;/p&gt;

&lt;p&gt;So he proceeded to walk me through various troubleshooting:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;“reboot your router…”&lt;/li&gt;
  &lt;li&gt;“make sure your system has latest updates…&lt;/li&gt;
  &lt;li&gt;“change your wifi channel”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After about 30 minutes of this - I grew impatient.  I explained to him that there was something limiting the speed on their side.  He remoted into my system with a screen sharing tool, and I showed him my remote screen to the connection at the office.  He kept on saying that bandwidth is different for different locations etc…&lt;/p&gt;

&lt;p&gt;That’s when I decided to press him.  Here is a screen capture of the final part of our chat:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/verizon_fail.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Frankly, I was surprised he admitted to this.  I’ve since tested this almost every day for the last couple of weeks.   During the day - the bandwidth is normal to AWS.  However, after 4pm or so - things get slow.&lt;/p&gt;

&lt;p&gt;In my personal opinion, this is Verizon waging war against Netflix.  Unfortunately, a lot of infrastructure is hosted on AWS.  That means a lot of services are going to be impacted by this.&lt;/p&gt;

&lt;p&gt;PS&amp;gt; a number of folks have questioned the expertise of the support individual.  I completely understand.  I’m not a networking expert, but I did want to share 2 more pieces of data that I think are significant:&lt;/p&gt;

&lt;p&gt;Traceroute from Residential Side:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Tracing route to iscanonline.com [23.21.158.115]
over a maximum of 30 hops:

  1    &amp;lt;1 ms    &amp;lt;1 ms    &amp;lt;1 ms  192.168.1.1
  2     7 ms     7 ms     8 ms  L100.DLLSTX-VFTTP-65.verizon-gni.net [173.74.57.1]
  3    10 ms     6 ms     9 ms  G0-5-2-0.DLLSTX-LCR-21.verizon-gni.net [130.81.190.204]
  4    16 ms     9 ms    10 ms  so-5-0-0-0.DFW9-BB-RTR1.verizon-gni.net [130.81.199.34]
  5    10 ms     9 ms     9 ms  0.xe-3-3-0.BR2.DFW13.ALTER.NET [152.63.100.5]
  6     9 ms    10 ms     9 ms  204.255.168.158
  7    10 ms     9 ms    10 ms  ae-1.r08.dllstx09.us.bb.gin.ntt.net [129.250.3.27]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Traceroute from Business line (1 mile away)&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; traceroute to iscanonline.com (23.21.158.115), 64 hops max, 52 byte packets
 1  192.168.1.1 (192.168.1.1)  18.036 ms  1.326 ms  2.318 ms
 2  l100.dllstx-vfttp-93.verizon-gni.net (71.244.30.1)  5.870 ms  5.211 ms  5.193 ms
 3  g0-5-0-2.dllstx-lcr-21.verizon-gni.net (130.81.138.12)  7.400 ms  67.679 ms  10.605 ms
 4  so-5-0-0-0.dfw9-bb-rtr1.verizon-gni.net (130.81.199.34)  12.062 ms  6.652 ms  17.799 ms
 5  0.xe-3-3-0.br2.dfw13.alter.net (152.63.100.5)  7.207 ms  7.858 ms  9.616 ms
 6  204.255.168.158 (204.255.168.158)  7.435 ms  7.256 ms  10.366 ms
 7  ae-1.r08.dllstx09.us.bb.gin.ntt.net (129.250.3.27)  7.365 ms  10.160 ms  9.083 ms

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name></name></author><summary type="html">UPDATE: The team over at Speedchecker Ltd has created a speedtest oriented around this issue. They are going to be collecting data and presenting findings if they get enough data:</summary></entry><entry><title type="html">Hacking the GameCube controller on the Raspberry Pi</title><link href="/2013/12/27/hacking-the-gamecube-controller-on-the-raspberry-pi.html" rel="alternate" type="text/html" title="Hacking the GameCube controller on the Raspberry Pi" /><published>2013-12-27T10:03:00+00:00</published><updated>2013-12-27T10:03:00+00:00</updated><id>/2013/12/27/hacking-the-gamecube-controller-on-the-raspberry-pi</id><content type="html" xml:base="/2013/12/27/hacking-the-gamecube-controller-on-the-raspberry-pi.html">&lt;h3 id=&quot;inspiration&quot;&gt;Inspiration&lt;/h3&gt;

&lt;p&gt;So I got a &lt;a href=&quot;http://www.raspberrypi.org&quot;&gt;Raspberry Pi&lt;/a&gt; for
Christmas (thanks Secret Santa!), and I decided that I wanted to
create a little retro gaming appliance with it.&lt;/p&gt;

&lt;p&gt;First thing I did was install the &lt;a href=&quot;https://github.com/raspberrypi/noobs/blob/master/README.md&quot;&gt;NOOBS&lt;/a&gt;
software that is recommended for first time Raspberry Pi users.&lt;/p&gt;

&lt;p&gt;Next I googled for gaming emulators on Raspberry Pi.  After grokking
several forum and blog posts, I came across the RetroPie project
(http://blog.petrockblock.com/retropie/).  This certainly looked
promising.&lt;/p&gt;

&lt;p&gt;After going through the RetroPie-Setup scripts - I thought that I was
almost home.  So I started up emulationstation - a graphical frontend
for all of the emulators.  Once I did the obligatory startup of Super
Mario Bros - I was sorta happy.  However, I thought - keyboard
controls suck.  I want a game controller.&lt;/p&gt;

&lt;p&gt;Being kinda cheap, I said to myself - “hey…my son has a bunch of
game stuff up stairs…” - after digging though his gear, I found a
nice GameCube controller.&lt;/p&gt;

&lt;p&gt;I Googled for “GameCube controller
raspberry pi” - which led me to
&lt;a href=&quot;https://github.com/petrockblog/RetroPie-Setup/wiki/Module-for-GPIO-interface-for-retro-game-controllers&quot;&gt;this article.&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;installing-the-gamecon_gpio_pri&quot;&gt;Installing the gamecon_gpio_pri&lt;/h3&gt;

&lt;p&gt;I dug in a bit deeper and looked at how I would wire up this
controller.  This &lt;a href=&quot;https://github.com/petrockblog/RetroPie-Setup/wiki/gamecon_gpio_rpi&quot;&gt;site&lt;/a&gt;
describes the interface for the Revision 1 Raspberry Pi board.
However, I needed a wiring diagram for the Gamecube controller so that
I could hook it up.&lt;/p&gt;

&lt;p&gt;This &lt;a href=&quot;http://www.int03.co.uk/crema/hardware/gamecube/gc-control.html&quot;&gt;site&lt;/a&gt; had a nice description of the pins -&lt;/p&gt;

&lt;p&gt;I was super excited at this point and figured I was 90% of the way there!&lt;/p&gt;

&lt;p&gt;I wired up Pin 2 of the GC controller to GPIO 2 on the Raspberry Pi.
I also tied Pins 3, 4 and 7 together and wired them to Ground on the
Raspberry Pi.  Finally, I hooked up the controller’s Pin 6 to VCC+
which is Pin 1 on the Pi.  I used this &lt;a href=&quot;http://elinux.org/RPi_Low-level_peripherals&quot;&gt;site&lt;/a&gt; for
reference.&lt;/p&gt;

&lt;p&gt;So once I had the GameCube controller wired up, it was time to load the driver.  After some experimentation, I figured out the command to load the driver for GPIO2:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo modprobe gamecon_gpio_rpi map=0,0,0,0,3,0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The modprobe command is a Linux command to load and unload kernel modules.  The map parameter is described in the source code:&lt;/p&gt;

&lt;div class=&quot;language-c highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;module_param_array_named&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gc_cfg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gc_cfg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nargs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;MODULE_PARM_DESC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&quot;Describes the set of pad connections (&amp;lt;GPIO0&amp;gt;,&amp;lt;GPIO1&amp;gt;,&amp;lt;GPIO4&amp;gt;,&amp;lt;GPIO7&amp;gt;,&amp;lt;GPIO2&amp;gt;,&amp;lt;GPIO3&amp;gt;)&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I also added this command to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/modules&lt;/code&gt; so it would be loaded at startup time:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo vi /etc/modules
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There is a program for testing gamecontrollers hooked up called jstest - I ran it like this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pi@raspberrypi /usr/src/gamecon_gpio_rpi-0.9.1 $ jstest /dev/input/js1
Driver version is 2.1.0.
Joystick (Gamecube controller) has 8 axes (X, Y, Rx, Ry, Gas, Brake, Hat0X, Hat0Y)
and 8 buttons (BtnX, BtnY, BtnTL, BtnTR, BtnTL2, BtnTR2, BtnSelect, BtnThumbR).
Testing ... (interrupt to exit)
Axes:  0:-32767  1: -1066  2:  1065  3: -1865  4:-32767  5:-24776  6:     0  7:     0 Buttons:  0:off  1:off  2:off  3:off  4:off  5:off  6:off  7:off
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I clicked a couple of buttons, moved around the joysticks, and saw that
the values were changing.  So I figured I was done with the controller
setup.&lt;/p&gt;

&lt;p&gt;After removing &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.emulationstation/es_input.cfg&lt;/code&gt; (this causes emulationstation to run the input setup again) - I noticed some strange things:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;When the program asked me to press “Up” - It would jump 2 or 3 steps through the process after I pressed up.&lt;/li&gt;
  &lt;li&gt;After 2-3 times of running the setup (carefully timing my “Ups” and “Downs”) - I tried playing a game&lt;/li&gt;
  &lt;li&gt;The game was not responsive and didn’t seem like the controller was working correctly.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So I went back to google and started doing more research.
Unfortunately - there wasn’t much information available.  Nobody
seemed to be having my problem, but there also wasn’t much discussion
anywhere regarding the GameCube controller and the Raspberry Pi.  I
posted a question on the raspberry pi forums about this just to see if
I would get a response.  But being impatient…I wasn’t going to wait
for the answer.&lt;/p&gt;

&lt;h3 id=&quot;hacking-on-the-code&quot;&gt;Hacking on the code&lt;/h3&gt;

&lt;p&gt;After digging around the file system on the Raspberry Pi a bit, I was able to find the source code for the gamecon_gpio_rpi kernel extension.  It doesn’t appear to live in github or any other source code repository.  Although there is a deb package that includes the source.  If you’ve installed the driver with the RetroPie-Setup script, the source lives here:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;/usr/src/gamecon_gpio_rpi-0.9
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It is managed with dkms - so hacking on it is relatively straightforward.  So I started digging in a bit to the source.&lt;/p&gt;

&lt;p&gt;After looking through the source a bit, the first thing that seemed incorrect was this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#define GC_GCUBE_REQUEST          0x40c002U /* the request data command */
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The reason this seemed incorrect, is that there were a few articles written by other folks regarding the gamecube controller protocol.  The consensus was that the command should be:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#define GC_GCUBE_REQUEST          0x400302U /* the request data command */
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So I figured I’d start there and see where that got me.  I copied the whole src as follows:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo cp /usr/src/gamecon_gpio_rpi-0.9 /usr/src/gamecon_gpio_rpi-0.9.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I removed the existing module using dkms:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo dkms remove gamecon_gpio_rpi/0.9 --all
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I setup a little rebuild script:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-shell&quot; data-lang=&quot;shell&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;modprobe &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; gamecon_gpio_rpi
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;dkms remove gamecon_gpio_rpi/0.9.1 &lt;span class=&quot;nt&quot;&gt;--all&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;dkms &lt;span class=&quot;nb&quot;&gt;install &lt;/span&gt;gamecon_gpio_rpi/0.9.1
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;modprobe gamecon_gpio_rpi &lt;span class=&quot;nv&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;0,0,0,0,3,0&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;And I tried my change to the GC_GCUBE_REQUEST hoping that it would solve all my problems.&lt;/p&gt;

&lt;p&gt;After rebuilding and loading the module I ran the jstest program again.  It seemed to be working a bit better, but it still wasn’t as responsive as one would expect a controller to be.&lt;/p&gt;

&lt;p&gt;I was honestly a bit stumped at this point.  I double checked all my connections and couldn’t find any problems.&lt;/p&gt;

&lt;p&gt;So I went ahead and brought out my trusty oscilloscope.  Based on the description of the gamecube controller protocol from other articles - I expected to see a 24 bit message (23 + stop bit) containing the following:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; 1000 0000 0000 0110 0000 010 1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So here was the capture from my scope.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/o-scope-screen-initial-2us.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;After annotating it with 0s and 1s:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/o-scope-screen-initial-capture-annotated.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;So after looking at that - it looked pretty close.  And given the fact that I was receiving controller information, I figured it was probably correct.  However, I figured I needed to do a little more analysis.  First, I measured the timing of the 0s and 1s of the response from the controller.  I captured a successful 64 bit message returned from the controller and measured the time of single bit:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/o-scope-screen-command-4us.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;It measured at 4us - which matched what other articles I found while doing research.  If the response was 4us per bit - then the command sent from the gamecon_gpio_rpi driver should match.  So I measured the command signal from the Pi:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/o-scope-screen-initial-2us.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Doh!  It measured at 2us.  That doesn’t seem right…so I dug into the code that sends the command over the gpio pins:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c&quot; data-lang=&quot;c&quot;&gt;    &lt;span class=&quot;cm&quot;&gt;/* Send encoded command */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;inline&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;gc_n64_send_command&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gc_nin_gpio&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
       &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

       &lt;span class=&quot;cm&quot;&gt;/* set correct GPIOs to outputs */&lt;/span&gt;

       &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gpio&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;~&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cmd_setinputs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
       &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gpio&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cmd_setoutputs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

       &lt;span class=&quot;cm&quot;&gt;/* transmit a data request to pads */&lt;/span&gt;
       &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;request_len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;unsigned&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;request&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                 &lt;span class=&quot;n&quot;&gt;GPIO_CLR&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_bits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                 &lt;span class=&quot;n&quot;&gt;udelay&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
                 &lt;span class=&quot;n&quot;&gt;GPIO_SET&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_bits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                 &lt;span class=&quot;n&quot;&gt;udelay&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                 &lt;span class=&quot;n&quot;&gt;GPIO_CLR&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_bits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                 &lt;span class=&quot;n&quot;&gt;udelay&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
                 &lt;span class=&quot;n&quot;&gt;GPIO_SET&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_bits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                 &lt;span class=&quot;n&quot;&gt;udelay&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
       &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;We can see here that the code is correct if udelay is calibrated at 1us (1 microsecond).  This code appears to be correct because there is a 3us pull low followed by a 1us pull high for a 0 bit.  And there is a 1us pull low followed by a 3us pull high for a 1 bit.  However, the scope indicated that the delays weren’t matching.&lt;/p&gt;

&lt;p&gt;So I decided I would fiddle with those values a bit to see if I could get the command to match up with a 4us duration per bit.  After some trial and error here was the code I arrived to:&lt;/p&gt;

&lt;div class=&quot;language-c highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cm&quot;&gt;/* Send encoded command */&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;inline&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;gc_n64_send_command&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;gc_nin_gpio&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

   &lt;span class=&quot;cm&quot;&gt;/* set correct GPIOs to outputs */&lt;/span&gt;
   &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gpio&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;~&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cmd_setinputs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;gpio&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;|=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;cmd_setoutputs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

   &lt;span class=&quot;cm&quot;&gt;/* transmit a data request to pads \*/&lt;/span&gt;
   &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;request_len&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;unsigned&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)((&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;request&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
             &lt;span class=&quot;n&quot;&gt;GPIO_CLR&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_bits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
             &lt;span class=&quot;n&quot;&gt;udelay&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
             &lt;span class=&quot;n&quot;&gt;GPIO_SET&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_bits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
             &lt;span class=&quot;n&quot;&gt;udelay&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
             &lt;span class=&quot;n&quot;&gt;GPIO_CLR&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_bits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
             &lt;span class=&quot;n&quot;&gt;udelay&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
             &lt;span class=&quot;n&quot;&gt;GPIO_SET&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_bits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
             &lt;span class=&quot;n&quot;&gt;udelay&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;At a glance this didn’t make a lot of sense because the values aren’t clean multiples.  I don’t have a good explanation for this at the moment.&lt;/p&gt;

&lt;p&gt;But the capture from the scope showed that I had achieved a 4us duration for the command duration per bit:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/o-scope-screen-command-4us.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;So I ran the jstest - and all seemed to be working properly - the updates to the joystick and button data seemed to be good.  However, there was something strange happening on the scope.&lt;/p&gt;

&lt;p&gt;It seemed that the response was intermittent.  It would rapidly jump between these 2 states:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/o-scope-screen-command-no-response.png&quot; alt=&quot;&quot; /&gt;
&lt;img src=&quot;/images/o-scope-screen-command-response.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I felt that it should not be jumping back and forth between having a response sometimes and not having a response other times.  So I took another look at the code that sends the response and noticed this:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c&quot; data-lang=&quot;c&quot;&gt;    &lt;span class=&quot;cm&quot;&gt;/* send stop bit (let pull-up handle the last 2us) \*/&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;GPIO_CLR&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_bits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;udelay&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;GPIO_SET&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_bits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;So based on my previous change to the other timing, I changed that code to this:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-c&quot; data-lang=&quot;c&quot;&gt;    &lt;span class=&quot;cm&quot;&gt;/* send stop bit (let pull-up handle the last 2us) \*/&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;GPIO_CLR&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_bits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;udelay&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;GPIO_SET&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ningpio&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;valid_bits&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;After rebuilding the module one more time, it appeared to stabilize the signal so that I saw a nice constant wave form that wasn’t intermittently receiving responses - but rather receiving responses every time a command is sent.&lt;/p&gt;

&lt;h3 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;I suspect that the timing of the udelay has changed with various changes to the raspberry pi and/or Linux kernel.  It appears that udelay supports resolution of about 500ns (.5us) based on my experimentation.  However, this might change from version to version - or worse - it might change based on the load of the system.  So I will have to do further testing with actual gameplay to see if this is going to work long term or not.  Unfortunately - the raspberry pi running Linux is NOT a realtime OS.&lt;/p&gt;</content><author><name></name></author><summary type="html">Inspiration</summary></entry><entry><title type="html">1923 Southbend Lathe Restoration Photos</title><link href="/2013/05/07/1923-southbend-lathe-restoration.html" rel="alternate" type="text/html" title="1923 Southbend Lathe Restoration Photos" /><published>2013-05-07T08:39:00+00:00</published><updated>2013-05-07T08:39:00+00:00</updated><id>/2013/05/07/1923-southbend-lathe-restoration</id><content type="html" xml:base="/2013/05/07/1923-southbend-lathe-restoration.html">&lt;p&gt;At some point in the future, I will probably write a more detailed recap of my
lathe restoration.  In the meantime - these pictures will suffice :-)&lt;/p&gt;

&lt;h3 id=&quot;before-restoration&quot;&gt;Before Restoration&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;http://farm9.staticflickr.com/8146/7325269172_3dd2d6d31d_b.jpg&quot; alt=&quot;Before Photo of Lathe&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;after-restoration&quot;&gt;After Restoration&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;http://farm8.staticflickr.com/7046/8691116706_25e2c23149_b.jpg&quot; alt=&quot;After Photo of Lathe&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;flickr-photo-stream-of-in-between&quot;&gt;Flickr Photo Stream of in between&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;http://flic.kr/s/aHsjEVBYFN&quot;&gt;Photo Set of Restoration&lt;/a&gt;&lt;/p&gt;</content><author><name></name></author><summary type="html">At some point in the future, I will probably write a more detailed recap of my lathe restoration. In the meantime - these pictures will suffice :-)</summary></entry><entry><title type="html">Using stm32f4-discovery with OS X + built in st-link</title><link href="/2012/04/03/using-stm32f4-discovery-with-os-x-plus-built-in-st-link.html" rel="alternate" type="text/html" title="Using stm32f4-discovery with OS X + built in st-link" /><published>2012-04-03T11:26:00+00:00</published><updated>2012-04-03T11:26:00+00:00</updated><id>/2012/04/03/using-stm32f4-discovery-with-os-x-plus-built-in-st-link</id><content type="html" xml:base="/2012/04/03/using-stm32f4-discovery-with-os-x-plus-built-in-st-link.html">&lt;p&gt;In a previous post - I talked about using an STM32F103 based Cortex M3 with OS X.  Since that post, I’ve ordered one of these - &lt;a href=&quot;http://www.st.com/internet/evalboard/product/252419.jsp&quot;&gt;STM32F4-Discovery&lt;/a&gt;.  I am thinking about porting the work done with &lt;a href=&quot;http://smoothieware.org/&quot;&gt;smoothieware&lt;/a&gt; from the LPC17xx platform to the STM32xxxx platform.  The STM32F4-Discovery is a relatively new development board that shows a lot of promise.  At ~$15 it is a bargain platform with a lot of features.&lt;/p&gt;

&lt;p&gt;As usual, I need all of my goodies to work on my Mac and Windows boxes since I go back and forth a lot.  The following is a quick guide to getting this up and running with OS X Lion.&lt;/p&gt;

&lt;p&gt;First, you’ll need to get the stlink software compiled from &lt;a href=&quot;https://github.com/texane/stlink&quot;&gt;https://github.com/texane/stlink&lt;/a&gt;:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;stlink &lt;span class=&quot;c&quot;&gt;# this is where you've cloned the stlink software&lt;/span&gt;
make
make &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You will also need to build the Mac driver:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;stlink/stlinkv1_macosx_driver
&lt;span class=&quot;nb&quot;&gt;tar &lt;/span&gt;xzvf osx.tar.gz

&lt;span class=&quot;c&quot;&gt;# Then, install the driver using:&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;sudo &lt;/span&gt;make osx_stlink_shield

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;make sure the gdbserver works:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;cd &lt;/span&gt;stlink/gdbserver
./st_util

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If it successfully connects - you should see something like this:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;2012-04-03T13:51:50 INFO src/stlink-usb.c: -- exit_dfu_mode
2012-04-03T13:51:50 INFO src/stlink-common.c: Loading device parameters....
2012-04-03T13:51:50 INFO src/stlink-common.c: Device connected is: F4 device, id 0x20006411
2012-04-03T13:51:50 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes
Chip ID is 00000413, Core ID is  2ba01477.
KARL - should read back as 0x03, not 60 02 00 00
init watchpoints
Listening at *:4242...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;verify that you can load software through GDB (make sure you use a ARM gdb such as yagarto etc…)
Run the following:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;~/Downloads/STM32F4-Discovery_FW_V1.1.0 &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;arm-none-eabi-gdb 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You will get something like this if you successfully connect:&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type &quot;show copying&quot;
and &quot;show warranty&quot; for details.
This GDB was configured as &quot;--host=i386-apple-darwin10.8.0 --target=arm-none-eabi&quot;.
For bug reporting instructions, please see:
&amp;lt;http://www.gnu.org/software/gdb/bugs/&amp;gt;.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(gdb) load /Users/draphael/Documents/workspace/TestDiscovery/TestDiscovery.elf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Loading section .isr_vector, size 0x188 lma 0x8000000
Loading section .text, size 0x6750 lma 0x8000188
Loading section .ARM, size 0x8 lma 0x80068d8
Loading section .init_array, size 0x4 lma 0x80068e0
Loading section .fini_array, size 0x4 lma 0x80068e4
Loading section .data, size 0x5d0 lma 0x80068e8
Loading section .jcr, size 0x4 lma 0x8006eb8
Start address 0x800676d, load size 28348
Transfer rate: 3 KB/sec, 3543 bytes/write.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(gdb) file /Users/draphael/Documents/workspace/TestDiscovery/TestDiscovery.elf
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Reading symbols from /Users/draphael/Documents/workspace/TestDiscovery/TestDiscovery.elf...done.


&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content><author><name></name></author><summary type="html">In a previous post - I talked about using an STM32F103 based Cortex M3 with OS X. Since that post, I’ve ordered one of these - STM32F4-Discovery. I am thinking about porting the work done with smoothieware from the LPC17xx platform to the STM32xxxx platform. The STM32F4-Discovery is a relatively new development board that shows a lot of promise. At ~$15 it is a bargain platform with a lot of features.</summary></entry><entry><title type="html">Using a Segger JLink with OS X</title><link href="/2012/03/29/using-a-segger-jlink-with-os-x.html" rel="alternate" type="text/html" title="Using a Segger JLink with OS X" /><published>2012-03-29T10:28:00+00:00</published><updated>2012-03-29T10:28:00+00:00</updated><id>/2012/03/29/using-a-segger-jlink-with-os-x</id><content type="html" xml:base="/2012/03/29/using-a-segger-jlink-with-os-x.html">&lt;p&gt;I wanted to work on some ARM Cortex M3 programming on my Mac…&lt;/p&gt;

&lt;p&gt;In order to program my dev boards, I use a &lt;a href=&quot;http://www.segger.com/j-link-edu.html&quot;&gt;Segger J-Flash&lt;/a&gt;.  At first glance, they don’t appear to support the hardware on OS X.  However, after some digging I found that they offer a beta that includes OS X support &lt;a href=&quot;http://www.segger.com/beta-software-version.html&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once I got that installed, I received the following error:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dyld: Library not loaded: /usr/local/lib/libusb-1.0.0.dylib
  Referenced from: /Users/draphael/JLink/./JLinkGDBServer
  Reason: image not found
Trace/BPT trap: 5
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Well, of course that just means I need libusb installed.  I use homebrew for my ports of linux to mac.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;brew install libusb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This worked like a champ…except…now I get this error:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;dyld: Library not loaded: /usr/local/lib/libusb-1.0.0.dylib
  Referenced from: /Users/draphael/JLink/./JLinkGDBServer
  Reason: no suitable image found.  Did find:
	/usr/local/lib/libusb-1.0.0.dylib: mach-o, but wrong architecture
	/usr/local/lib/libusb-1.0.0.dylib: mach-o, but wrong architecture
Trace/BPT trap: 5
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;D’OH!  I’ve seen this before…time to edit the formula&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;brew edit libusb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I needed to add the i386 arch flag as shown in this code:&lt;/p&gt;

&lt;div class=&quot;language-ruby highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;require&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'formula'&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;Libusb&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;Formula&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'http://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-1.0.8/libusb-1.0.8.tar.bz2'&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;homepage&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'http://www.libusb.org/'&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;md5&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'37d34e6eaa69a4b645a19ff4ca63ceef'&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'git://git.libusb.org/libusb.git'&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;options&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;[[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;--universal&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Build a universal binary.&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]]&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ARGV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;build_head?&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;MacOS&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;xcode_version&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;4.3&quot;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;depends_on&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;automake&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:build&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;depends_on&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;libtool&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;ss&quot;&gt;:build&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;install&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;universal_binary&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ARGV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;build_universal?&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;# Added flag to compile libusb for i386&lt;/span&gt;
    &lt;span class=&quot;no&quot;&gt;ENV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;CFLAGS&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot; -arch i386&quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;./autogen.sh&quot;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;ARGV&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;build_head?&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;./configure&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;--prefix=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;prefix&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;--disable-dependency-tracking&quot;&lt;/span&gt;
    &lt;span class=&quot;nb&quot;&gt;system&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;make install&quot;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Once that was complete…&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;~/JLink &lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;./JLinkGDBServer 
SEGGER J-Link GDB Server V4.43c &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;beta&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

JLinkARM.dll V4.43c &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;DLL compiled Feb 22 2012 20:13:03&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;

The server has been started with the following settings:
&lt;span class=&quot;nt&quot;&gt;---Server&lt;/span&gt; related settings---
GDBInit file:              none
Listening port:            2331
SWO thread listening port: 2332
Accept remote connection:  &lt;span class=&quot;nb&quot;&gt;yes
&lt;/span&gt;Logfile:                   off
Verify download:           off
Init regs on start:        on
Silent mode:               off
Single run mode:           off
&lt;span class=&quot;nt&quot;&gt;---J-Link&lt;/span&gt; related settings---
J-Link script:             none
Target interface:          JTAG
Host interface:            USB
Target endian:             big
Target interface speed:    5kHz

Waiting &lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;J-Link connection...
J-Link is connected.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Success!!!&lt;/p&gt;</content><author><name></name></author><summary type="html">I wanted to work on some ARM Cortex M3 programming on my Mac…</summary></entry><entry><title type="html">getting started with my 3d printer</title><link href="/2012/03/23/getting-started-with-my-3d-printer.html" rel="alternate" type="text/html" title="getting started with my 3d printer" /><published>2012-03-23T10:09:00+00:00</published><updated>2012-03-23T10:09:00+00:00</updated><id>/2012/03/23/getting-started-with-my-3d-printer</id><content type="html" xml:base="/2012/03/23/getting-started-with-my-3d-printer.html">&lt;p&gt;I am going to write about this…I promise.&lt;/p&gt;</content><author><name></name></author><summary type="html">I am going to write about this…I promise.</summary></entry><entry><title type="html">New Blog Engine!</title><link href="/general/2012/03/16/new-blog.html" rel="alternate" type="text/html" title="New Blog Engine!" /><published>2012-03-16T14:27:00+00:00</published><updated>2012-03-16T14:27:00+00:00</updated><id>/general/2012/03/16/new-blog</id><content type="html" xml:base="/general/2012/03/16/new-blog.html">&lt;p&gt;I have deliberated for a while now on what to do with my blog.  I have not been particularly active in my blogging, but I have definitely been thinking about a number of things I need to blog about.  However, I found that my blogging engine (Typo) was very limiting for me.  It turns out, that most blogging engines are limiting to me.  I am not very comfortable using a web UI for my workflow!  I am a coder that uses SVN, git etc…day in and day out for my daily work.  So I asked my friend, Glenn Vanderburg, if he had any ideas - and he suggested Octopress.&lt;/p&gt;

&lt;p&gt;So far, it seems that &lt;a href=&quot;http://octopress.org/&quot;&gt;Octopress&lt;/a&gt; really fits the bill.  I generally like using a text editor and version control for everything - including documentation.  I am somewhat of a fan of wikis, but I prefer having raw access to my source trees.  So Octopress really allows you to hack away at your blog, and then push and deploy just like you would any other software.&lt;/p&gt;

&lt;p&gt;Migration was easy since I didn’t really have that much content to begin with.  I simply cut and pasted my blog content into new articles generated through rake.  I’ll recap the steps I took:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;First, I forked Octopress from github&lt;/li&gt;
  &lt;li&gt;Next, I edited _config.yml to reflect my site configuration…this is pretty self explanatory.&lt;/li&gt;
  &lt;li&gt;Then, I generated new posts via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rake new_post[&quot;...&quot;]&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;I edited those posts to reflect the original publication date from my former blog&lt;/li&gt;
  &lt;li&gt;Finally, I tested everything using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rake preview&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Once everything was to my liking, I edited my remote server nginx configuration to point at a directory I created to hold my content.&lt;/li&gt;
  &lt;li&gt;Restarted nginx on my remote server&lt;/li&gt;
  &lt;li&gt;ran &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;rake deploy&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;BAM!  It was done.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I absolutely love this new approach to my blog so far.  It is static content!!!  No database…at least not for now.  I hope that this can stay as static as possible.  I really just want a place to call my home page where I can rant and write about my hobbies and code etc… without thinking about another web application that I have to manage.  Not to mention - I don’t like working through a web based workflow to being with, so this really lends itself to a hacker style blog!  I’ll just have to get up to speed with all of the various formatting options…&lt;/p&gt;</content><author><name></name></author><category term="general" /><summary type="html">I have deliberated for a while now on what to do with my blog. I have not been particularly active in my blogging, but I have definitely been thinking about a number of things I need to blog about. However, I found that my blogging engine (Typo) was very limiting for me. It turns out, that most blogging engines are limiting to me. I am not very comfortable using a web UI for my workflow! I am a coder that uses SVN, git etc…day in and day out for my daily work. So I asked my friend, Glenn Vanderburg, if he had any ideas - and he suggested Octopress.</summary></entry><entry><title type="html">git Tips and Tricks</title><link href="/code/2010/05/17/git-tips-and-tricks.html" rel="alternate" type="text/html" title="git Tips and Tricks" /><published>2010-05-17T14:04:00+00:00</published><updated>2010-05-17T14:04:00+00:00</updated><id>/code/2010/05/17/git-tips-and-tricks</id><content type="html" xml:base="/code/2010/05/17/git-tips-and-tricks.html">&lt;p&gt;This is a sweet way of getting current git info in your prompt in OS X…this saves me from those “damn, I’m on the wrong branch…” moments - &lt;a href=&quot;http://www.codethatmatters.com/2010/01/git-autocomplete-in-mac-os-x/&quot;&gt;http://www.codethatmatters.com/2010/01/git-autocomplete-in-mac-os-x/&lt;/a&gt;&lt;/p&gt;</content><author><name></name></author><category term="code" /><summary type="html">This is a sweet way of getting current git info in your prompt in OS X…this saves me from those “damn, I’m on the wrong branch…” moments - http://www.codethatmatters.com/2010/01/git-autocomplete-in-mac-os-x/</summary></entry><entry><title type="html">using git with a proxy</title><link href="/code/2010/05/03/using-git-with-a-proxy.html" rel="alternate" type="text/html" title="using git with a proxy" /><published>2010-05-03T14:09:00+00:00</published><updated>2010-05-03T14:09:00+00:00</updated><id>/code/2010/05/03/using-git-with-a-proxy</id><content type="html" xml:base="/code/2010/05/03/using-git-with-a-proxy.html">&lt;p&gt;Some of us are stuck behind a corporate firewall, but need to access all the great little github plugins through git!  So what do you do?&lt;/p&gt;

&lt;p&gt;Create the following wrapper:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;/bin/sh

Put your own values

&lt;span class=&quot;nv&quot;&gt;PROXY_IP&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;127.0.0.1
&lt;span class=&quot;nv&quot;&gt;PROXY_PORT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;1090

nc &lt;span class=&quot;nt&quot;&gt;-x&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PROXY_IP&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;:&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;PROXY_PORT&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-X5&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;add this to your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.profile&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.bash_rc&lt;/code&gt; or whatever you use:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;GIT_PROXY_COMMAND&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;~/bin/proxy-wrapper
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I stole this solution from &lt;a href=&quot;http://blogs.gnome.org/juanje/2009/07/17/git_behind_proxy/&quot;&gt;http://blogs.gnome.org/juanje/2009/07/17/git_behind_proxy/&lt;/a&gt;&lt;/p&gt;</content><author><name></name></author><category term="code" /><summary type="html">Some of us are stuck behind a corporate firewall, but need to access all the great little github plugins through git! So what do you do?</summary></entry><entry><title type="html">Security on Rails is Beta!</title><link href="/code/2010/04/16/security-on-rails-is-beta-slash.html" rel="alternate" type="text/html" title="Security on Rails is Beta!" /><published>2010-04-16T14:13:00+00:00</published><updated>2010-04-16T14:13:00+00:00</updated><id>/code/2010/04/16/security-on-rails-is-beta-slash</id><content type="html" xml:base="/code/2010/04/16/security-on-rails-is-beta-slash.html">&lt;p&gt;Our book is now available as a Pragmatic Bookshelf Beta - &lt;a href=&quot;http://pragprog.com/book/fr_secure/security-on-rails&quot;&gt;Security on Rails&lt;/a&gt;&lt;/p&gt;</content><author><name></name></author><category term="code" /><summary type="html">Our book is now available as a Pragmatic Bookshelf Beta - Security on Rails</summary></entry></feed>