Monday, 10 June 2013

Controlling GPIO with WebIOPi

Using the software.

Follow the installation instructions ( This can take a few minutes depending on internet speed and SDCard speed (lots of Python and SSL libs downloaded IIRC).

The instruction page is easy to follow, but to replicate the instructions here:

$ wget
$ tar xvzf WebIOPi-0.6.0.tar.gz
$ cd WebIOPi-0.6.0
$ sudo ./

Once installed, run the sudo webiopi command as follows:

pi@raspberrypi ~/WebIOPi-0.6.0 $ sudo webiopi
2013-06-10 21:33:45 - WebIOPi - INFO - Starting WebIOPi/0.6.0/Python3.2
2013-06-10 21:33:46 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2013-06-10 21:33:46 - WebIOPi - WARNING - Access unprotected
2013-06-10 21:33:46 - WebIOPi - INFO - HTTP Server binded on
2013-06-10 21:33:46 - WebIOPi - INFO - CoAP Server binded on coap:// (MULTICAST)
2013-06-10 21:33:46 - WebIOPi - INFO - CoAP Server binded on coap://

Now you can log in to the web app: http://raspberrypi:8000/app/gpio-header. This page looks like:

Using this site for reference (, connect

GND (Pin 6) -> LED -> 330Ω resistor -> GPIO-17 (Pin 11)

I have connected this up rather flimsily by jabbing the resistor and LED into a ribbon cable.

And here it is in use. Look for the underwhelming LED in centre screen!

(Video roated using the nifty YouTube editing capabilities -

Saturday, 5 January 2013

Component Odds and Sods

PPN13LB10A Brush Motor

Brush motor taken from a CDROM drive.


I think my motor must be old/obsolete, because I can't find the exact spec sheet.

Model Operating Voltage
Rated Voltage
No Load Speed
No Load Current
Rated Load
[gf・cm] [mN・m]
PPN13PB10C 2 to 9 7.4 7014 29 7.5 0.74
PPN13PB11C 2 to 9 7.4 9125 34 7.5 0.74
PPN13PB12C 2 to 9 5.0 7084 34 5.0 0.49

Model Rated Load Speed
Rated Load Current
Starting Torque Starting Current
Shaft Length a [mm]
[gf・cm] [mN・m]
PPN13PB10C 5677 108 39.6 3.9 442 11.0
PPN13PB11C 7473 137 41.7 4.1 601 11.0
PPN13PB12C 6117 114 36.6 3.6 618 11.0

Thursday, 3 January 2013

Syntax Highlighting in Blogger

Because Blogger does not seem to allow you to serve your own separate JS files, I've cloned the Git repo of alexgorbatchev/SyntaxHighlighter and use Github's capability to serve raw files.

E.g., this block of code is at the bottom of my Blogger template.

<!-- GRIMBO JS -->
<script src=''></script>
<script src='' type='text/javascript'>
<script src='' type='text/javascript'>
<script src='' type='text/javascript'></script>
<script src='' type='text/javascript'></script>
<script src='' type='text/javascript'></script>
<script type='text/javascript'>SyntaxHighlighter.all();</script>
<!-- GRIMBO JS -->

It works fairly well, apart from the delays caused by the number of files that Blogger downloads by default (76 requests, 449KB transferred, 15.34s total time, 10.28s onload, 8.89s DOMContentLoaded, from one empty-cache test).

NOTE: Github seems to respond to the script requests over http with "301 Moved Permanently", redirecting to the https protocol; thus adding a HTTP 301 per request and slowing the page load. So I use https in the first place. (Correct as of 04/01/2012)

Useful Links