Sunday, November 25, 2012

Dancer - a Processing test

A post on bitCraft inspired us to try the Processing language, a simple programming language for drawing interactive graphics and creating generative art. People have made some really fun and amazing stuff. Your program, called a sketch, can then be exported to all kinds of media platforms.

My program is a tweaked version of the program's own Brownian motion example. I added some cursor interaction and some forces, played around with the colors.

Moreover, I learned how to display the resulting processing sketch in blogger from here. Basically, I had to host the web page somewhere else, and then include it with an iframe.

Thursday, November 22, 2012

Girih Flower

The fivefold rotational symmetry of Girih tiles is just the thing for creating nice flowery shapes. Happy birthday Fredrik!

Sunday, November 18, 2012

Boxing the 'Berry

The raspberry router of an earlier post turned out to work well, but it definitely needs an enclosure. The fast & easy solution - put everything inside a plastic Smart Store box! (The same kind of box we modified for storing Legos.) The box contains a USB hard drive, as well as the Pi and GSM modem, so we can use the Pi as a file server.

The Pi, the network switch, the USB hub and the hard drive each has its own power supply, so we included a power strip in the box. The many power sources take up a lot of space in our current system. If all the devices could share one, the system would shrink considerably.

Each machine has its own LED, and at night, the whole thing looks like a box of holiday decorations.

The box is kept slightly ajar for the cables going into the box, which seems to provide enough ventilation as well. Measuring the raspberry's CPU temperature with
cat /sys/class/thermal/thermal_zone0/temp
consistently reports around 46 C.

This setup turned into a surprisingly nice media player as well, once I connected our old TV set to it. We have no keyboard connected to the Pi, so we just ssh to it and run the omxplayer. I plan to give XBMC a try later, but getting it set up on a standard raspbian systems seems rather involved.

The current setup is somewhat temporary - in the future, I hope to put everything inside the case of a desktop PC, to function as a power conserving and silent always-on server, independent of the main PC.

Sunday, November 11, 2012

Happy Father's day!

We have no cute ducks to post today in celebration, so we post a picture of bread instead.

This is what happens when one forgets to add yeast when operating the bread machine: a very flat bread. We are happy to report that it tasted good nevertheless, the structure was just a bit more compact than usual.

Wednesday, November 7, 2012

Favorite Games: OpenTTD

This is the first post in a small series about computer games I like. I plan to focus on open source and independently made, or just plain home made, games. Suggestions or tips are naturally welcome in the comments!

The first game is OpenTTD. This is a great game for us who did not get a model railroad when we were kids. OpenTTD is an open source variant of Transport Tycoon Deluxe from the 1990:s.

The aim is to move cargo, mail, and people between cities and factories, and of course to generate profits for your transport company. There are many vehicles to choose from, but trains are by far the best. Building an efficient railroad network with good-looking and optimal intersections is a real challenge. When a city receives good transport service it grows, and getting the cities to grow as large as possible, extending your customer base, is one of the main goals. The game can be a bit stressful when there are hoards of people in each city waiting for your trains (if you're the type to care).

I have played OpenTTD at LAN parties, which is great fun. I prefer cooperative multi player games, in which one can build huge railroad networks together with friends. The MIDI music in the game is great, both the original tunes and the free ones composed for the open version. An active community has grown around the game, with a forum and a wiki. Railway signals, for example, is a complex topic, luckily there is good help in the wiki gameplay manual.

As a bonus, one learns geography when playing scenarios set on real-world maps, such as the town of Urk in the Netherlands on the screen shot above.

The Favorite Game series

Monday, November 5, 2012

Circle Stickers - Lots of Dots

One great thing about Germany is the abundance of small, inexpensive round paper stickers - supposed to be used for archiving, I guess, but in my experience, they're also great for super-fast artwork creation, and for arranging nicely on a table.

On a side note, this company has a very impressive sticker repertoire. I haven't yet seen a shop that would sell all of these, not even in Germany.

Thursday, November 1, 2012

Raspberry Router

I wanted to set up my Raspberry Pi as a 3G router for my small home network,  and as a file server too. It worked out nicely, so here are some notes and links that helped me.  My internet connection is provided by a USB GSM modem (Huawei E173), so the first task is to get this device running on the Pi. This was surprisingly easy, thanks to the sakis3g script.

I learned that once you start messing with the network, downloading new stuff gets tricky - so it's best to get everything at once.
sudo apt-get install ppp isc-dhcp-server usb-modeswitch 
and download sakis3g
wget ""

EDIT: The Sakis3G web page is down at the moment, but a local copy of the script is here: sakis3g.gz (version 0.2.0.e).

The Pi can probably not supply enough current for the 3G modem through the USB ports (thanks for the tip), so I connected the modem through a powered hub. Without the hub, the modem did not work.

The sakis script was easy to use, it asked me to select my modem and then the network name (APN). When the connection works, one can write the selections in a configuration file to avoid having to enter them again. In sakis: "More options..." -> "Generate success report" shows a lot of info. Last in the list, there are the options needed to connect. Copy these (except  --console and --interactive) to the file /etc/sakis3g.conf with one option per line. Sakis does not like any extra whitespace on these lines. Now it should be possible to connect with  a simple sudo sakis3g connect.

I found a nice guide to setting up the pi as a router. This worked well for me, I just had to change which network interface is connected to the local network (eth0 for me) and which is connected to the outside (ppp0).

A small complication has turned up with the GSM modem. The modem is a multimode USB device, and must be switched into the correct mode before actually working as a modem. Sakis handles this automatically (using the usbmodeswitch program I installed above). The trouble is, that when the modem is switched, it changes its USB device ID. So the device option to pass to sakis is different the first time and any later time sakis is run without unplugging or powering down the modem in between.
The broadband company seems to drop the connection after 24 h. I think I will put a cron script for reconnecting at 5 in the morning or so. I came up with the following command for finding the current USB ID of  the modem and passing it to sakis.
sudo sakis3g connect USBMODEM=\
`lsusb | grep Huawei | sed 's/.*ID \([a-f0-9:]*\) Huawei.*/\1/'`
sed is a strange creature! grep finds the relevant line, and the sed command extracts the ID number between 'ID ' and ' Huawei'. This is of course assuming that exactly one huawei device is present.

I post some of the configuration files here. In this later post, I added a WLAN stick and got the Pi set up as a WLAN access point, these files are for a WLAN device as well. If you don't have one, just ignore those sections.
my /etc/networks/interfaces:

auto lo
iface lo inet loopback

auto eth0 #static address on eth0
iface eth0 inet static

auto wlan0 #static address on wlan0
iface wlan0 inet static

And then /etc/dhcp/dhcpd.conf

ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;

#for the eth0 subnet
subnet netmask {
option broadcast-address;
option routers;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
option domain-name-servers,; #Google DNS
interface eth0;

#for the wireless network on wlan0
subnet netmask {
        option domain-name-servers,;
        option routers;
        interface wlan0;

Newer Older Home
Related Posts Plugin for WordPress, Blogger...