28 Sep

networking a raspberry pi through your laptop

I finally got my own Raspberry Pi; a credit-card-sized computer that’s very cheap and low-power.

It didn’t come with any of the niceties that you would expect from another computer, such as a power supply or a case, or keyboard, monitor, or anything else. Basically, it’s like being given the motherboard of a desktop computer and you need to do the rest yourself.

So first thing was to install the operating system on it. This was easy. Just buy an SD card, and download the ISO of the OS that you want and copy it onto the card.

I already had a micro-SD card from an old Bada phone, so I just stuck that in an adaptor to bring it up to SD card size, then installed the Fedora remix using the Fedora Arm Installer. Painless.

Raspberry Pi connected to laptop using cross-over cable

Next, we need to connect the machine to the network.

My network is mostly WiFi-based, so I chose to hook the RaspPi to the network by piping its network through my laptop.

We need to set up the laptop so it can hand out IP addresses. Install a DHCP server on your laptop. I’m using Fedora, so installed with “yum install dhcp”, then edited /etc/dhcp/dhcpd.conf:

option domain-name "example.org";
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet netmask {
  option domain-name-servers ns1.internal.example.org;
  option domain-name "internal.example.org";
  option routers;
  option broadcast-address;
  default-lease-time 600;
  max-lease-time 7200;

Then start the DHCP server with “service dhcpd start”.

Next, we need to connect the laptop to the RaspPi. To do this, I made a cross-over cable, and plugged it into the RaspPi.

Before plugging it into the laptop, we need to tell the laptop’s network manager not to set up DHCP over eth0 (as we’re the server, not the client, as far as the cable is concerned). To do this in Gnome, right-click your netowkr icon on the top-right, click Network Settings, and in Wired, click Options, then change the type to “Shared connection” (or whatever sounds like that).

Now plugin the ethernet cable into the laptop, then plug a USB cable into the laptop and the RaspPi.

If you “tail -f /var/log/messages”, you should get something like the below after a minute:

Sep 28 21:12:30 iga dnsmasq-dhcp[30147]: DHCPDISCOVER(em1) b8:27:eb:87:1d:86
Sep 28 21:12:30 iga dnsmasq-dhcp[30147]: DHCPOFFER(em1) b8:27:eb:87:1d:86
Sep 28 21:12:30 iga dnsmasq-dhcp[30147]: DHCPREQUEST(em1) b8:27:eb:87:1d:86
Sep 28 21:12:30 iga dnsmasq-dhcp[30147]: DHCPACK(em1) b8:27:eb:87:1d:86 raspi

That is the address of the RaspPi. You can ssh into it (username root, password fedoraarm), and do stuff!

22 Sep

New clavichord project

My last clavichord project failed at the last moment, but not through lack of momentum. I got right to the point where I could play a full scale on it, but had to stop there, because I had learned enough from the project to realise that it would not work properly in the end.

The project I had envisioned was a clavichord built from very easily-sourced material: plywood. And the strings were made from high-tensile wire, using only one strand for the higher notes, and two or more for lower-frequency notes.

I didn’t actually expect to get as far as I did. My main intention with this project was to figure out exactly how clavichords work. This was a practice run.

Some mistakes learned from the last project:

  • The key tangent positions are crucial. If they’re off by even the slightest amount, you will miss the string or (even worse) the keys will overlap with each other.
  • When the strings are on, the tension created can warp the clavichord, making it bow in the middle, thus wrecking all your careful measurements and tunings.
  • It’s very hard to find explanations online about how /exactly/ sound-boxes work, such as how to make sure all notes sound equally loud, where to place ribs (if needed), the effects of the various measurements and materials.
  • Tuning is hard.

The new project will address these. I’m planning on building something which will address each of these problems, and also will allow me to test a few things I’m unsure of, and change things easily.

Firstly, the body will not be build as a solid rectangular block, as the last one was.

Instead, it will be built as a lightweight scaffold from metal rods bolted together. This allows me to easily re-arrange it if needed.

To stop the bowing, I will build a truss rod into the base, so if the strings cause the body to bend upwards, I can counter this by tightening the truss rod, pulling it back into shape.

To counter the tangent position problems, each key will be an adjustable three-part lever, which can be bent into shape, then “bolted” once it is correct.

Because the sound-box will probably be the hardest thing to get right, I have the idea of a removable box, so I can experiment with different materials and shapes. To make this possible, the bridge (which connects the strings to the sound-box) will be raise-able in its entirety, so the sound-box can be slipped out under it.

In a traditional “double-strung” clavichord, the string is looped around a tuning peg on the right side (next to the sound-box), pulled across the bridge, across the body, and looped around a pin, then back across the body, across the bridge, and looped to another tuning peg. I don’t really like the design of this, so will be changing it in mine.

In mine, each string will have a “ball end”, like a guitar string. the ball end hooks to the right end of the clavichord, and the string then is stretched over the bridge, across the body, then around a positioning pin and into a machine head. Machine heads are much easier to tune than tuning pins. This method also makes it easier to single-, double- or even triple-string different parts of the clavichord. In pianos, for example, the bass notes are single-strung using very heavy wire, and the treble notes are triple-strung using light wire.

I will also be adding a microphone and jack to mine, so the clavichord can be optionally amplified.

Some even more far-out ideas:

  • Add a touch screen and small computer (Raspberry Pi?) which can be used to display sheet music.
  • This could also be used to display a tuner, such as the awesome DaTuner Pro for Android.
  • And the most difficult: automatic tuning. A robot mechanism for turning the machine heads and picking/tapping the strings automatically to tune to Well-tempered, Pythagorean, Mean-tone, or any other tuning.

Well – that’s the plan! Now to watch some Red Dwarf and forget all about this madness…

21 Sep

Acceptable evidence for there being a god

Wow, what fun!

Over at the Facebook page for Atheism Ireland, Brian Cullen asked a deceptively simple question; “What would be acceptable evidence for there being a God”.

This started a long discussion, and I think I might be the main protagonist in it… A load of examples of evidence were mentioned, but each of them had problems; in that they could possibly be explained by chance, hallucination, or an incomplete understanding of physical law.

I think the largest problem was that the question did not include a very important definition: What is a god?

When asked, Brian elucidated: “God , in it’s basic form as we would think of when the word is mentioned .”

But the problem there is that everyone has a different picture in their heads of what that means. Many people think of a god as a Santa Claus-like figure dressed in white instead of red, and go no further than that.

I would define a “God” (in the context of this question) as:

  1. an intelligent being
  2. that created itself from nothing
  3. then created the universe
  4. and can do almost anything that it wants.

I think most people would agree with that definition.

It is easy to think of examples of evidence that would prove points 1 and 4.

A very good example was a being which writes a book that can unambiguously be read and understood by every person that reads the book. This shows that the being is intelligent enough to write legibly, and is able to achieve something which is probably impossible.

However, this does not prove points 2 and 3, that the being created itself, and created the universe.

In fact, no matter how awesome the miracle you envisage, not one single shred of evidence can possibly prove that the being created itself and also created the universe.

Even the being taking you back through time to witness its own creation and the creation of the universe is not proof, because any being that can do that can surely also simply slip you a hallucinogenic drug and convince you that you’ve seen the described events…

It was suggested that demonstrating miracles might be evidence. For example, moving the stars to form a word, or bringing a person back to life after a week of decay.

Each of those are evidence of great power, but they do not address the identity of the being.

Not one piece of evidence in the whole thread (which went on for /ages/) was anything that could point towards the being creating itself or creating the universe.

In fact, when we got down to the more extreme demonstrations of power (like signing your name right across the sky in stars), those are actually evidence that you are not living in the real universe, but are in a “matrix” of sorts.

It was suggested that a being outside the laws of the universe can break the laws of physics or manipulate the universal constants.

But, if you can possibly change a universal constant, then it’s not a constant after all. And if you can break a law of physics, then it is not a law. If either of these happened, they would actually be evidence that we do not know all the /real/ laws and constants in physics. They would not be proof that something can somehow break laws and constants at whim.