Skip to content
Chris Williams edited this page Jun 27, 2013 · 15 revisions

##Welcome to SerialPort Land

Welcome to the fun world of hardware hacking without leaving the comfort of your favorite programming language, JS! We are trying to assemble all of various FAQs revolving around this library here, so please ask and help out. The library does utilize native code so it does require build tools to be present in order to install, this is different from most other modules in NPM and general node.js. Due to this difference, we are fully aware that installing it can be a bit of a bear, please use these guides to help get you up and running.

Installation Instructions

Windows

On Windows 7 and above, please use the following instructions. We are assuming from a vanilla Windows installation so your mileage may vary depending on things you already have installed. If you find conflicts, please let us know via a GitHub Issue

  1. Starting with a vanilla Windows 7 (or higher, should be fine) installation
  2. Download and Install the free Windows SDK 7.1 and select every option (you can unselect options if you absolutely know what you are doing by unselecting them, but it is easier just to select all options).
  3. Install node.js 0.10.12+ using the preferred compiler settings, either 32-bit or 64-bit. Those are Microsoft Installer (MSI) format, if you prefer .exe binaries, please obtain those from here. Default settings are perfect.
  4. Install Python 2.7.5 for any questions, please refer to their FAQ. Default settings are perfect.
  5. Open the Windows SDK 7.1 Command prompt (this allows the C++ compiler to be available on the path).
  6. Enter the following command in the prompt which adds Python to the path (the Python installed doesn't do this for you).
    set path=%path%;C:\Python27
  7. Enter the following command in the prompt to install serialport for you!
    npm install serialport

Mac OS X

Desktop Linux (Debian/Ubuntu)

Raspberry Pi Linux (Raspbian)

  1. Starting with a a vanilla New Out of the Box Software (NOOBS) Raspbian image (currently tested: 5/25/2013)
  2. Log into your Raspberry Pi through whatever means works best and ensure you are on a terminal prompt for the remaining steps. This could be local or through an SSH (or a serial connection if you like).
  3. Issue the following commands to ensure you are up to date:
    sudo apt-get update
    sudo apt-get upgrade -y
  4. Download and install node.js:
    wget http://nodejs.org/dist/v0.10.12/node-v0.10.12-linux-arm-pi.tar.gz
    tar xvfz node-v0.10.12-linux-arm-pi.tar.gz
    sudo mv node-v0.10.12-linux-arm-pi /opt/node/
  5. Set up your paths correctly:
    echo 'export PATH="$PATH:/opt/node/bin"' >> ~/.bashrc
    source ~/.bashrc
  6. Install using npm, note this will take a while as it is actually compiling code and that ARM processor is getting a workout.
    npm install serialport

Where its used