Tuesday, November 25, 2014

A Brief History of Graphics

A very nice recap of the evolution of gaming graphics (and game play) on consoles and PCs.  And for those that remember when you had to go to an arcade to play a video game, it might bring a smile.

Friday, November 21, 2014

BeagleBone Black, Node.js and the Serial Port

The BeagleBone Black (BBB) is an inexpensive, powerful single board computer (SBC), with options on operating system and programming language.  Many embedded applications need serial communications and this was the position I found myself in, when I wanted to use the BBB as a gateway for a small wireless network, based on the Texas Instrument (TI) MSP430 development tool.

The MSP430 tool comes with an access point (AP) and two end devices (EDs) linked via a proprietary 2400 MHz network, using TI's SimpliciTI protocol.  SimpliciTI is described on TI's website as: SimpliciTI is a simple low-power RF network protocol aimed at small RF networks. Such networks typically contain battery operated devices which require long battery life, low data rate and low duty cycle and have a limited number of nodes talking directly to each other or through an access point or range extenders.

Out of the box, TI includes a Windows GUI application to display the network topology and ED data in real time.  I wanted to replace the Windows machine with a low watt SBC, but still be able to upload the data to a server over the internet.  The eZ430-2500T AP, as factory programmed, outputs serial data at 9600 baud, sufficient for the application. The BBB has both serial and ethernet ports, and supports the node.js application model which I was interested in trying.  There is a serialport package for node.js available on https://github.com/voodootikigod, so it appeared that BBB could act as a gateway for the EZ430 wireless network.

What followed however was a lot of googlin' to get the serial port active in node.js and the remainder of this post is a "what worked for me" narrative, rather than authoritative, guide on setup.

Download Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.12-beaglebone-2013.09.05.img.xz onto an SD card ( so that the BBB boots off the card). Node.js comes pre-installed, make sure you can execute some simple examples.


Simply attempting to install the serialport module into node.js at this point failed, as the system attempted to build the module from source and pre-requisites for that process were not met. This is alluded to on voodootikigod, under special instructions . Following the guidance on:  nodered.org specifically, Some modules, for example serialport, require native compilation, usually using node-gyp. To make sure this works you MUST install some python build tools."  

 The following steps were taken:     
    opkg update
    opkg install python-compiler python-distutils python-multiprocessing python-misc openssl-misc
    opkg upgrade

Then run
    npm install serialport

Running the command  npm ls  should show the serialport package is now installed, however attempting to run any of the samples on voodootikigod again fail.  The forum post by Yoder notes it is still necessary to declare the UART into the Linux device tree:
    echo BB-UART4 > /sys/devices/bone_capemgr.*/slots

The serial port samples should now work.  Below is a photo of the console running a simple node.js portReader application and the AP/gateway setup.