Archive for April, 2008

Debian testing (lenny) and Ruby On Rails

Wednesday, April 30th, 2008

I began a project with rails 2.0 on a Debian testing box. The goal at this point is to see how few packages I have to install to get a running Rails/PostgreSQL web application configured with some default scaffolding.

Good news is ruby on rails is available via APT. Good news, or so I thought, is that ruby-postgres is also available via APT. Unfortunately, there appears to be some kind of discrepency between this, as rails fails to load the database driver with a kind error:

MissingSourceFile in AssetsController#index
no such file to load -- postgres

Dare I install the gem and break my almost perfect run? I shall :(

Elephants, Slony and the inveitable complication

Tuesday, April 29th, 2008

The last three days have been filled with dreams of elephants. Metaphorical ones that never forget and are heavy. Slony is Russian for elephants. Slony also can replicate PostgreSQL databases in an asynchronous master/slave configuration. It is extremely complicated to configure.

I have some very minimal insights on this after reading through the documentation multiple times. Unfortunately, the documentation is very vague and filled with typos. It also has many sections where the answer to a question is “this hasn’t been agreed upon yet”. So for example, starting up the slon processes at boot time is an unsolved problem.

Put the Mitel 5220 phone into SIP mode

Sunday, April 27th, 2008

The world of SIP phones is constantly amazing to me. Crappy user interfaces, shady manufacturer websites, blackbox knowledge, i.e. “press and hold the ’super button’ after powering on and tap the second line button”.

I was asked to make sure a Mitel 5220 dual mode phone can be speak SIP and register to Asterisk. Looks like it can. Ironically, I figured all of this out without using the Mitel website since their homepage produced a 500 Internal Server Error response. Word!

The article on voip-info is accurate to get it into SIP mode. Some confusion arose on my phone because it didn’t have some buttons labeled. Trial and error nailed it down. Here’s the process:

  1. Disconnect the power from the set.
  2. Hold down the “Superkey” (or “Menu” key with some paper inserts) while powering up the set.
  3. The set will come up and ask if you want to CONFIGURE PHONE? select YES.
  4. “NETWORK PARAMETERS?” select NO
  5. “HARDWARE CONFIG?” select NO
  6. “PHONE MODE?” select YES
  7. “PROTOCOL?” select YES
  8. “PHONE MODE: Minet” select Change
  9. Select “SIP”, “Accept” and confirm with “Yes”. It will now save the settings to NVram
  10. “REBOOT NOW?” select Yes

The “super key” is the key at the top left, under the LCD screen. The “line 1″ button is the button at the bottom right, next to the keypad.

Web admin panel works. username: admin password: 5220. The registration process is a little odd, consisting of two discrete menus. Add the SIP user/pass in the Admin->User Config section, then add the SIP proxy/registrar in the Admin->SIP Config. Also in this section make sure the “Bypass NAT Firewall” is set to “off” and “Mode” is set to “static”. This applies if you are behind NAT and the Asterisk server is not. The settings are the opposite when both the server and the phone are on the same network.

Measuring speed

Saturday, April 26th, 2008

A Hall effect sensor is a better solution to measure rotational speed than a reed relay for a number of reasons. First, there are no moving parts aside from the magnet. Reed sensors are vacuum sealed glass tubes and can break under stress. Second, they are very accurate. Hall effect sensors can be found in automobile transmissions and hard disk motors.

So I’m on the hunt for some hall effect sensors I can mount to a set of rollers. Digikey is complicated, so I’ll be documenting progress.