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 "http://www.sakis3g.org/versions/latest/armv4t/sakis3g.gz"

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
address 192.168.50.1
netmask 255.255.255.0
network 192.168.50.0
broadcast 192.168.50.255
gateway 192.168.50.1

auto wlan0 #static address on wlan0
iface wlan0 inet static
address 10.10.0.1
netmask 255.255.255.0

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 192.168.50.0 netmask 255.255.255.0 {
range 192.168.50.10 192.168.50.250;
option broadcast-address 192.168.50.255;
option routers 192.168.50.1;
default-lease-time 600;
max-lease-time 7200;
option domain-name "local";
option domain-name-servers 8.8.8.8, 8.8.4.4; #Google DNS
interface eth0;
}

#for the wireless network on wlan0
subnet 10.10.0.0 netmask 255.255.255.0 {
        range 10.10.0.25 10.10.0.50;
        option domain-name-servers 8.8.8.8, 8.8.4.4;
        option routers 10.10.0.1;
        interface wlan0;
}

Friday, October 26, 2012

Not a sixty degrees angle



The previous kind of salmiak wasn't, and this one isn't - maybe it just shouldn't be, a sixty degrees angle on the salmiak rhombus. Too bad! But at least it leaves a nice star-shaped space where the corners don't fill up in the above pattern.

Sunday, October 21, 2012

Mixed Beads

Experimenting with colors while using up some old leftover Fimo polymer clay. I formed three piles of finely chopped clay, then mixed some of each color into the others. With some of the purple and blue, I re-chopped and mixed the finished chunks.

The pink turned a bit dull in the oven (thats a risk with leftovers) but the others turned out fine. The purple-blue re-chppped ones are probably the best of them.

Wednesday, October 17, 2012

WiFi screen


We live on the edge of wireless reception. Even with an external antenna in the window, the signal was not quite strong enough and the connection was frequently dropped. Our friend Halza had the idea to use a strainer as a reflector. This trick works great for us too, and improves the reception considerably.
The WLAN antenna inside the strainer is one of these.

The WLAN signals are in the 2.4 GHz band, which means that one wave length is 12.5 cm. Already a reflecting plane, placed 1/4 wavelength (3.1 cm) behind the antenna should provide constructive interference and some signal gain. A parabolic reflector with the antenna in the focal point provides more. The strainer not exactly a parabola, but has the right general looks.

Lots of variants on this idea are available.

Sunday, October 14, 2012

Another batch of soap



We made another batch of transparent glycerin soap, using the same recipe as the last time. These above are the results.



We were so confident this time that we left the pot in the oven unguarded, and it boiled over! Or exploded, or something. Fluffy dry soap-clouds everywhere. At this point I was sure the batch was ruined! But we just scooped it all back in the pot, added some alcohol and melted it again, and everything turned out fine.



We used small soaps and scraps from the previous batch for decoration in the new ones - we arranged the old soaps in the forms, and poured new melted soap over. The aluminum foil is for keeping the round forms straight in the freezer, until the soap solidifies.



The soaps made in largish square forms I cut into three parts (for symmetry) to create reasonably size hand soaps.



Some of the finished soaps wrapped in strips of paper, as a gift wrap.

Friday, October 12, 2012

Cyborg bread

Bread with bread macine mixing blade stuck inside.

Sometimes, bread machine parts are left inside the finished product.

Saturday, October 6, 2012

Botany

Yesterday, I finished working on an idea for I had for learning to use Blender, an open-source program for making three-dimensional models. The result is called Botany, it's also on my art page.

Basically, I wanted to make something that utilizes and shows off the flat surfaces used in 3D modelling. Usually, one tries to hide away the sharp edges and use tons of triangles and effects to make it look organic. The other main idea was to make an image that's supposed to be two-dimensional, and not a snapshot of a 3D scene (which it is, too, nevertheless).

The idea came from designing boxes for the platform game. The thought is to draw simple sectors on a square, and shade them in a way that's compatible with a three-dimensional interpretation.
I thought up as many of these sectored squares as I could, and constructed and arranged them in Blender. The main part of the work was placing the nodes and connecting the right ones, to form the geometry I wanted.

As a bonus, I took some landscape snapshots as well. I used Blender's depth-of-field feature, which I probably don't know enough about, but as you can see, the result isn't that great on edges with a high contrast.

Wednesday, October 3, 2012

Thread Collection

My collection of sewing thread, small but pretty, deserves a post here as well. They're all Coats - some polyester Coats Duet, some Coats Cotton, and some are an ancient and discontinued polyester-cotton blend. I don't actually like sewing, but that doesn't keep me from wanting all the colors (pdf). Maybe if I could get into paper embroidery, to turn needlework into a form of paper craft...

Monday, October 1, 2012

Jelly beans for fall

Colorful jelly beans.

I was thinking these might make an appropriate seasonal color scheme for the summer to early fall transition. The Jelly Belly flavors can be found here.

Thursday, September 27, 2012

Printable Wall Calendar For 2013

Photos of a wall calendar for 2013.

Time for printing a new wall calendar for the coming year 2013. This one is similar to the one for 2012 - I made the days a bit bigger, and interwove the months to a continuous flow of days, to save some space. To identify the months, I gave each month its own color. Not sure how happy I am with these changes, but I'll just have to try it in real life and see what improvements I can come up with for 2014...

The calendar is on two pages, with January to June on the first and the rest on the second. The weeks begin with Mondays. Weekends are marked by a less bright white than the week days.

Download the pdf and print it on a regular printer. (The Google Docs viewer doesn't seem to understand transparency, so it doesn't show the month names or the weekend day boxes, but they'll be there when you print.)

The calendar is made in Inkscape, my favorite free vector graphics editor. The correct date/weekday arrangement for 2013 comes from Inkscape's Extensions -> Render -> Calendar function.

Monday, September 24, 2012

Emulsion separation time lapse

Fluid turbulence in a bottle of hairspray. Johanna bought a bottle of hair spray, consisting of two fluids, a clear and a white one. The product. The spray should be shaken before using, so that the two fluids mix. Above are some snapshots of turbulence achieved by gently shaking the bottle.

After a while, if left alone, the two fluids separate again. We've been quite fascinated by the mixing and re-separation processes.

This is a time lapse video of the hair spray, taken after shaking the bottle. The video starts with the emulsion completely white, that is, with the two solutions mixed. The whole separation process in the video takes about twenty hours.

From each frame in the video I cut a narrow vertical slice, always at the same position in the frame - this is apparently known as 'time slicing'. When these slices are placed beside each other a picture new is formed, where the horizontal direction represents time.



Three regions with different behavior can be seen in the picture. Here exponential curves have been fitted to the interface between the two fluids, in order to find the time constants. I expected to find a simple exponential time dependence, based on a vaguely remembered chemistry demonstration, but the result turned out to be more complex. When I searched for some explanation, I could only find complicated theories for how foams drain (pdf), and no mention of the simple exponential behavior.

Sunday, September 16, 2012

Decagon Girih Solutions



In an earlier post, I wrote about two solutions for the pattern on the ten-sided Girih tile.

In the middle is the standard one, also in paper in Science. The one on the right, with straight lines, I saw in a post on Robodino about laser cutting Girih tiles. The one on the left I might have seen somewhere, or made up myself... Anyway, these are three different solutions with tenfold rotational symmetry.

Wikipedia says: "Most tiles have a unique pattern of girih inside the tile which are continuous and follow the symmetry of the tile. However, the decagon has two possible girih patterns one of which has only fivefold rather than tenfold rotational symmetry." - but it doesn't say which ones they mean.



After some playing around, I realized that there are all kinds of ways to connect the patterns while still (I think) following the rules. The ones above have only a twofold rotational symmetry. These are probably not the only ones, but with their low symmetry, they are not the most interesting...

Instead, I'm really happy about these! They all have fivefold rotational symmetry. The upper left one is the one we cut in acrylic, and the rest are new. The lower left one might not quite conform, since it has another type of crossing in the middle, but who cares? It's pretty!

All in all, these are eleven possible girih patterns for the decagon. Could Wikipedia be wrong on this?

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