A very thoughtful article in the Economist on the consequences of automation to employment and some attempt to view the future in terms of the past.
Monday, June 8, 2015
Sunday, January 25, 2015
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."
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
Monday, July 14, 2014
Weather Station v0.1
The winds in Las Cruces can get pretty fierce and I have lost some shingles off the roof, so I decided to measure the "local" wind speed. I wanted to learn a little about the power consumption of small Wi-Fi connected devices, so rather than buy an off the shelf unit, I decided to build something from a kit.
The article Weather Station Wirelessly Connected to Wunderground was an excellent starting point and so I sourced the parts from Sparkfun. It looked like the Electric Imp had enough input capacity to do what I needed, so rather than use an Arduino to run the weather software and the Imp as a dumb modem, I attempted to use the Imp in both roles.
The Sparkfun Weather Shield "is an easy to use Arduino shield that grants you access to barometric pressure, relative humidity, luminosity and temperature. There are also connections on this shield to optional sensors such as wind speed, direction, rain gauge and GPS for location and super accurate timing"
One potential mapping of these variables to the Imp is:
Looking at the schematic for the Weather Shield, it is seen that the shield variables swing 0-5V, whereas the Imp is a 3.3V device. Now there is a bus transceiver chip, the 74LVC245, to interface the digital inputs and an op amp/divider will fix the analog inputs. But it was then I realized this speedbump was a wonderful opportunity to give me pause, get something working ... a version 0.1 of a weather station (and thus the title of this blog entry).
So I started with the following signal allocation:
A small piece of perfboard, served to mount the Imp and handful of components.
The Imp was powered by a large, sealed lead acid battery, a UB645 chosen for its price and durabilty, rather than being the smallest battery for the job. The wind speed was measured using an input, configured as "DIGITAL_IN_PULLUP", which allowed a handler function to be called every time the windspeed reed switch closed. The battery voltage is measured via a simple divider off Vin. Note that Vin is after the reverse polarity protection MOSFET on the battery input, so 0.6V lower than the actual battery voltage.
For only a few lines, the Squirrel code is pretty easy to get going. The raw data is serialized to the ElectricImp server, where the communication to Wunderground takes place. As noted in the Sparkfun blog entry announcing their data service, Wunderground does not allow custom fields in their data sets, and I wanted to track battery voltage. So I added code at the ElectricImp server to push data to a public stream on data.sparkfun, to record weather + battery voltage and RSSI ... nothing fancy, but dead simple.
Note, to form the query URL to Wunderground and Sparkfun, it is necessary to concatenate the strings in Squirrel for the various key/value pairs. Rather than using the "+" operator, which generates a lot of garbage, consider using a blob as write buffer:
buffer <- blob="" p=""> ....
buffer.seek(0, 'b');
buffer.writestring(sfDataSparkfunStr);
buffer.writestring(sfPublicKey);
buffer.writestring("?");
buffer.writestring(sfPrivateKeyPrefix);
buffer.writestring(sfPrivateKey);
....
....
local len = buffer.tell();
buffer.seek(0, 'b');
local url = buffer.readstring(len);
Now that I have been collecting data for a few days, time to look at interfacing the Weather Shield proper to the Imp.->
The article Weather Station Wirelessly Connected to Wunderground was an excellent starting point and so I sourced the parts from Sparkfun. It looked like the Electric Imp had enough input capacity to do what I needed, so rather than use an Arduino to run the weather software and the Imp as a dumb modem, I attempted to use the Imp in both roles.
The Sparkfun Weather Shield "is an easy to use Arduino shield that grants you access to barometric pressure, relative humidity, luminosity and temperature. There are also connections on this shield to optional sensors such as wind speed, direction, rain gauge and GPS for location and super accurate timing"
One potential mapping of these variables to the Imp is:
| Shield variable | Type | Imp Pin |
|---|---|---|
| Wind speed | DI | 1 |
| Wind direction | AI | 2 |
| Rain gauge | DI | 5 |
| Luminosity | AI | 7 |
| Battery voltage | AI | unused |
| Barometric pressure | I2C | 8, 9 |
| Humidity/Temperature | I2C | 8, 9 |
Looking at the schematic for the Weather Shield, it is seen that the shield variables swing 0-5V, whereas the Imp is a 3.3V device. Now there is a bus transceiver chip, the 74LVC245, to interface the digital inputs and an op amp/divider will fix the analog inputs. But it was then I realized this speedbump was a wonderful opportunity to give me pause, get something working ... a version 0.1 of a weather station (and thus the title of this blog entry).
So I started with the following signal allocation:
| Variable | Type | Imp Pin |
|---|---|---|
| Wind speed | DI | 5 |
| Battery voltage | AI | 7 |
| Temperature | AI | 9 |
A small piece of perfboard, served to mount the Imp and handful of components.
![]() |
| v0.1 sensor board + Imp |
The Imp was powered by a large, sealed lead acid battery, a UB645 chosen for its price and durabilty, rather than being the smallest battery for the job. The wind speed was measured using an input, configured as "DIGITAL_IN_PULLUP", which allowed a handler function to be called every time the windspeed reed switch closed. The battery voltage is measured via a simple divider off Vin. Note that Vin is after the reverse polarity protection MOSFET on the battery input, so 0.6V lower than the actual battery voltage.
For only a few lines, the Squirrel code is pretty easy to get going. The raw data is serialized to the ElectricImp server, where the communication to Wunderground takes place. As noted in the Sparkfun blog entry announcing their data service, Wunderground does not allow custom fields in their data sets, and I wanted to track battery voltage. So I added code at the ElectricImp server to push data to a public stream on data.sparkfun, to record weather + battery voltage and RSSI ... nothing fancy, but dead simple.
Note, to form the query URL to Wunderground and Sparkfun, it is necessary to concatenate the strings in Squirrel for the various key/value pairs. Rather than using the "+" operator, which generates a lot of garbage, consider using a blob as write buffer:
buffer <- blob="" p=""> ....
buffer.seek(0, 'b');
buffer.writestring(sfDataSparkfunStr);
buffer.writestring(sfPublicKey);
buffer.writestring("?");
buffer.writestring(sfPrivateKeyPrefix);
buffer.writestring(sfPrivateKey);
....
....
local len = buffer.tell();
buffer.seek(0, 'b');
local url = buffer.readstring(len);
Now that I have been collecting data for a few days, time to look at interfacing the Weather Shield proper to the Imp.->
Tuesday, June 24, 2014
Ian Piumarta - To trap a better mouse
If you are interested in computer languages, this is a very nice talk.
Saturday, June 14, 2014
Could robots replace nearly half of us in the workforce?
A very sobering look at the impact of robotics on employment. And instances like "... soon half of all iron ore produced in the Pilbara will be transported by driverless robotic trucks ... " are not small scale, unimportant experiments.
Subscribe to:
Posts (Atom)


