title: Raspi-io: Error: Unknown pin "null"
body: <p>I'm using the <code>johnn-five</code> and <code>raspi-io</code> packages for <code>node</code> and I'm trying to read the events created on a PIR motion sensor, but everytime I run the application, an error is thrown.</p>
  
  <p><strong>console</strong></p>
  
  <pre><code>pi@raspberrypi ~/poc $ sudo node app.js 
  1439476578608 Device(s) RaspberryPi-IO  
  1439476578749 Connected RaspberryPi-IO  
  1439476578825 Repl Initialized  
  &gt;&gt; /home/pi/poc/node_modules/raspi-io/lib/index.js:316
        throw new Error("Unknown pin \"" + pin + "\"");
              ^
  Error: Unknown pin "null"
      at Raspi._defineProperty.value (/home/pi/poc/node_modules/raspi-io/lib/index.js:316:17)
      at Raspi.pinMode (/home/pi/poc/node_modules/raspi-io/lib/index.js:327:47)
      at Motion.Controllers.PIR.initialize.value (/home/pi/poc/node_modules/johnny-five/lib/motion.js:27:17)
      at new Motion (/home/pi/poc/node_modules/johnny-five/lib/motion.js:180:10)
      at Board.&lt;anonymous&gt; (/home/pi/poc/app.js:9:16)
      at Board.emit (events.js:104:17)
      at process._tickDomainCallback (node.js:381:11)
  </code></pre>
  
  <p><strong>package.js</strong></p>
  
  <pre><code>{
    "name": "poc",
    "version": "0.0.1",
    "main": "app.js",
    "private": true,
    "dependencies": {
      "johnny-five": "0.8.86",
      "raspi-io": "3.3.4"
    }
  }
  </code></pre>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>var raspi = require('raspi-io');
  var five  = require('johnny-five');
  
  var board = new five.Board({
    io: new raspi()
  });
  
  board.on('ready', function() {
    var motion = new five.Motion({pin: 'PI-17'});
  
    motion.on('calibrated', function() {
      console.log('calibrated');
    });
  
    motion.on('motionstart', function() {
      console.log('motionstart');
    });
  
    motion.on('motionend', function() {
      console.log('motionend');
    });
  });
  </code></pre>
  
  <p>However, the following code DOES seem to work:</p>
  
  <p><strong>snipped from another poc</strong></p>
  
  <pre><code>var raspi = require('raspi');
  var gpio = require('raspi-gpio');
  
  raspi.init(function() {
  
    var input = new gpio.DigitalInput({
      pin: 'P1-17'
    });
  
    var logInput = function() {
      console.log('Input 17: ' + input.read());
      setTimeout(logInput, 1000);
    };
  
    logInput();
  
  });
  </code></pre>
  
  <p>The Raspberry is a Rev. 2 model B.<br>
  The Motion detector I'm using is <a href="http://simplytronics.com/products/ST-00082" rel="nofollow">this one</a>.<br>
  The cables are connected as follows (physical pin, taken from <a href="http://www.raspberry-projects.com/pi/pi-hardware/raspberry-pi-model-b/model-b-io-pins" rel="nofollow">this schema</a>)  </p>
  
  <pre><code>Motion Sensor -&gt; Pi  
  1 GND -&gt;  6 GND    
  2 VDD -&gt;  1 +3/V3 OUT  
  3 OUT -&gt; 11 GPIO17  
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>