Monday, November 30, 2009

Remote Control Light Switch

I ordered a single and double light switch from www.carymart.com about 4 weeks ago. I has just arrived.

It is quite a nice product and fairly cheap. The single $24.50, about €16. The double is just a few dollars more.



I installed the single one in the kitchen controlling some florescent lights. The build of the switch is a bit old fashioned looking but it functions perfectly. When installed it looks great.

The remotes are a bit 'Get Smart' looking, with a pull up aerial. Secret agent walkie-talkie.

They work fine.




Hidden screw holes. Street Cred = 100.
One of the things I liked about it is that works with CFL and florescent bulbs.

The only issue I have is that the switch has a toggle operation.

Press the button and it switches on. Press it again and it turns off.

There is no way to know the state of the switch, i.e. if it is on or off.

I would much prefer a switch that I can send a specific 'On' or 'Off' command. That would fit in with my plans for for my Home Automation set-up.

Would I recommend them? Yes.

I will probably get a couple more.

The double switch will probably be installed in the hall to remotely control the lights in the porch and hall. Very handy on a cold wet dark evening, to be able to turn the lights from the car.

Thursday, November 19, 2009

Thai Restaurant @ the Beacon, Sandyford

I went for lunch to the Thai Restaurant at the Beacon in Sandyford, Dublin 18 yesterday.

It was to mark the departure of a work colleague, John Milner. No this is not the John Milner, who was the Hot Rod driver from the movie American Graffiti. It was the other one, the world famous database administrator.

This is the third time I was there and had a similar experience each time.

The setting is nice and relaxed and the service is fair to good for lunch time.

The food on all three occasions was decidedly bland.

I do quite a bit of cooking myself and am a big fan of chilli and garlic. Can you have too much? Definitely in relation to chilli, yes. Garlic on the other hand, requires much higher densities before reaching critical mass.

I had Nasi Goreng this time. This is a sort of a stir fry with rice, wegitables, chicken and prawns. This was accompanied with a fried free range egg on top. Sounds good, eh?

There was also chicken satay stick on a bed of pineapple and onions covered in a satay sauce. I must admit that I am not a big fan of onions, but usually partake, as they are part of the whole experience (one hopes).

There were also some non descript fried cracker fellas, which were nice and crispy but didn't taste of anything.

The Nasi Goreng followed this trend by not really having much flavour. Even the fried egg was bland. The chicken didn't taste like chicken and was very soft. I wondered how freshly it was cooked. The prawns had the correct texture but that was it.

The chicken satay stick, which was sort of flattened, as they usually are. It was very well cooked. Maybe that was very very well cooked. I sort of like crispy fried chicken, so I persevered. In my attempts to consume it, I had a bit of a problem distinguishing between the chicken and the skewer.

I began to do what I normally do in these cases, which is to loosen the skewers grip on the chicken. This then allows the chicken to be easily pushed off the wood.

So there I was holding down the chicken with my fork and twisting the skewer, as you do. Then the chicken slipped from beneath my fork and the chicken spun and paddled the sauce in all directions. I received 4 large drops on my front. They turned out to be those nasty greasy stains that cannot be washed off and serve only as a symbol of ones ineptitude with the whole eating process.

I even think some of the other drops landed on someone else's plate.

Eek!

I fully understand that this was my fault and not necessarily a result of the quality of the food.

Having seamlessly carried out this procedure, totally unnoticed by companions, I continued to complete my repast.


The pineapple was nice.

Did I eat everything? Damn right I did. I was paying enough for it and it was not offensive. It was just a bit dull. I know that Thai is not the spiciest of Asian food styles but still should not be considered dull.


I freely admit that Thai food would not be my cuisine of choice. Not enough chilli and garlic and too much ginger.

Was this any worse then previous experiences with Thai food at different establishments? Probably not.

At the previous Thai restaurant, did I say that I would never go to another Thai restaurant? Yes.

Am I being fair in my views of this one? Who cares!

Wednesday, November 18, 2009

USB Temperature Sensor and Linux

I picked up an USB Temperature Sensor on eBay a few weeks ago. Total cost just over 4 Euros. It would have been rude not to get one. It is a HIP TEMPer model from http://www.pcsensor.com/. They have a few mad products such as a three foot switch. I like it.



I took quite a while to actually arrive.

It arrived today, so I plugged it into a Windows XP machine and installed the software. Yep, worked fine. The software that comes with it is basically crap. The colour scheme is way ugly.

This is not a problem at all as I planned to use it on Linux. I wanted to be able to poll the device and pull a temperature reading off it, stick it in a mySql database and present the data via a PHP web page. Bob's your aunty.

After consulting Dr. Google for a while, I came across this site, that had what I was looking for. http://relavak.wordpress.com/2009/10/17/temper-temperature-sensor-linux-driver/

I downloaded the driver and ran it. Perfect, almost.

It ran in a loop with lots of other data being shown. The default executed in a debug mode.

So, I had a look at the source code. I am not a C programmer but it was easy to follow.

I changed a few settings, commented out a few lines, compiled and tested it. Wash, rinse and repeat.

After a very short period of time, I had what I wanted.

The program just reads once and outputs the temperature in centigrade.

Done.

Just the thing to use in a script and automate.

I think I will get a few more. Very cheap and useful. Brilliant piece of kit.

I use 1-wire sensors for a lot of my temperature measurements. This is another tool for the toolbox. This is all due to the Linux drivers provided by http://relavak.wordpress.com/2009/10/17/temper-temperature-sensor-linux-driver/.

He is the hero.

I have added an update to this blog   - USB Temperature Sensor and Linux (Part 2)  on 10/08/2012. Included come compiled code.

Saturday, November 14, 2009

Linux Media Player Part 2

This time I tried one of the most popular ones, MythTV.

I tried this first a few years ago and failed dismally to get it to work properly.

This time around I did not fair much better. It is overly complicated and poorly documented. Sure, there is loads of docs but I found it difficult to follow. After two days of install and set-up, what I ended up with was a poorly operating system. It was slow and sluggish.

Too many things. I just wanted to play a few cds and watch a few videos.

A single application device.

So, I basically abandoned Myth TV.

Hello again Freevo.

It installed fairly easily on Fedora 11. There is just 1 configuration file. Excellent.

It all works. No issues.

There are many new features added since I first set-up Freevo.

The Question: "Which is a good and lightweight Home Theatre / Media Player to install on an old or low spec PC?"

The Answer: Freevo

It is really an answer and not the answer. There are other other ones.

Another one I played around with last year was GeeXboX. It was fairly good. The best thing was that it came on a bootable cd, so it was easy to test out.

I think I shall just do that.

In the mean time, I am a Freevo sort of guy.

Monday, November 9, 2009

Linux Media Player

I have been a fan of Freevo for a few years now, but decided to review what the current state is with other application.

The reason I chose Freevo, was because it was relatively easy to set-up and did not require a powerful computer to run on.

The PC I choose to run the tests on is a 1.? Ghz machine with 512Mb of RAM.

The first candidate was XBMC. It looked good. Downloaded and installed it, no problems. When I started to use it, there were some serious issues. It played fine but the user interface was very, very slow. Dragging the mouse accross the screen produced a large number of jumps.

This product was quickly dismissed, as it would fail the UAT (User Acceptance Test) straight away.


The next fella was LinuxMCE. This requires a specific version of Kubuntu to install. It is all contained on the DVD image which is handy.

The install took many hours, about 5, to complete. There were a few hangs and reboots. It didn't fail but just picked up from where it left off.

When I got it installed, I had some trouble setting preferences, such as IP address. The changes were not retained. This gets very frustrating, after 5 or 5 attempts to set something.

I noticed that it failed to pick up various media available.

The main issue was the customisation. It wouldn't take the changes.

After a number of hours, there was only one decision and that was /bin.

The end.

The next system is MythTV. I have it installed on Fedora Core 11 and need to configure it.

More next time.

Friday, November 6, 2009

Sinead's 1-Wire Alarm Clock


My daughter Sinead has a problem getting up for college in the morning.

She finds standard alarm clocks do not work for her. Too easy to turn off and go snoozing again.

We investigated a number of solutions, such as louder alarm clocks etc, but nothing really provided a complete solution.

I have been involved, some people would say obsessed, with Home Automation for a while now. One of the technologies that I use is called '1-Wire'.

1-Wire is basically a 2 wire network, that can be used with a number of components supplied by Dallas Semiconductor Co (now Maxim) to perform a number of functions, controlled by a computer for example.

They are probably best known, in geekdom, for their DS18S20 temperature sensor. I use these throughout the house to measure the temperature in different rooms.

They product other chips that do different things. The one I used in this case was a DS2405 addressable switch. It is an oldish device that has been superseded by the DS2406 and DS2408.

Anyway, it can be used as a switch and as a sensor to detect voltage. Pretty useful.

When the alarm goes off, the patron will need to get out of the scratcher, go to where the computer is, bring up a web page and click 'OFF'. She has an iPaq which is connected to the network. There will be a block on using an iPaq to turn off the alarm. Hehe! Evil, evil, evil.

My design is as follows:

1. Use my existing 1-Wire network to control the DS2405.
2. Use the DS2405 to control a relay.
3. Use the relay to switch on and off a sound source.
4. Use a PHP web page to interface with the set-up, i.e. turn on/off, set-up schedules, etc.
5. Use bash scripts to manage the schedule automatically.
6. Cost me nothing, except time.

List of materials:

DS2405 (or DS2406 or DS2408)

Some relay. I used a Opto-Isolator, which I already had. I used Opto-isolator,ISD74 5300Vac/50mA DIP8 which I got from Radionics.ie

A door /window alarm I got from Lidl a number of years ago. There is a small siren, that is loud enough for this application. I shouldn't wake people in other rooms.

5V Transformer. I used one from an old Sony walkman.

Various cabling, cat-5 and phone cable.

Some heat shrink sleeving (to make it all neat-o)


Construction:

Prepare the alarm. Strip out the button batteries, remove the battery contacts. You are left with a red and black wire. I also removed the reed relay sensor.

Connect the 1-Wire cable to the GND and 5V of the DS2405.

Connect the PIO and GND of the DS2405 to the appropriate pins. See spec sheet for this chip.

Connect the output pins to the 5V+. One to the walkman and the other to the 5V on the alarm siren (red wire).

Connect the black wire from the alarm to the gnd on the transformer.


I was able to fit all the components in to the alarm, after removing the batteries and cutting a plastic separator.


Wired it up to the 1-Wire controller and tested it. Worked perfectly.

Patched it through from where the main computer is to Sinead's bedroom.


Next Step:

Write the PHP script to provide an interface to turn it off, when the patron has arisin.

Put together a bash script to automate the switch on and off of the alarm. I think 30 mins on would be sufficient. I you can't get up in that time, you are not there or there is a serious problem.

This will be the easy part.

Power failure - Restart not successful - No Email

There was a power failure here yesterday and knocked out the computers that were running.

One of these was my Internet server. It provides my web sites 'www.thegiblins.com' and 'shankillweather.com' and acts as my email server.

It is based on Linux, so, I thought that it should recover fairly easily.

This was not 100% true. The web site came up fine but email was working well.

I use sendmail as my MTA, which can be very difficult to configure and maintain.

I noticed that I hadn't received any emails since the afternoon. There are always emails being sent, either externally or internally from the various scheduled jobs that are always running. Something was wrong.


On further inspection of the /var/log/maillog, I say many messages like:

Milter: data, reject=451 4.3.2 Please try again later

and

to=, delay=00:00:04, pri=31034, stat=Please try again later

and even

to=root, ctladdr=root (0/0), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=30341, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: 451 4.3.2 Please try again later

I said to myself, "What the Feck!".

I did the usual quick fix, i.e. "Did you try turning it off and on again?". No change.

I run Spamassassin and Clamav (Virus Protection), which can be troublesome boys, so, they were the next suspects.

The main clue from the maillog, was the word 'Milter'. This is basically a mail filter. There is one for Spamassassin and Clamav.

If you have ever set these up on Linux, you will know how tricky it can be. The documentation is not clear enough. It becomes clear after you have completed the job, which is not very helpful. Clamav has many components and it is not clear what are required.

Spamassassin seemed to be fine. It was identifying spam and non spam correctly.

Next was Clamav. I checked the configs, all OK. Ran an update on the data ans s/w. No change.

Checked my old notes. No help there. Talked to DR Google. Same.

I had a look through the bash history and noticed something.

I could see that 'clamav-milter' was running bit 'clamd' was not.

I started 'clamd' and restarted 'clamav-milter'. All good.

Done.

Mail logs looked good. Emails were coming through. Happy days.


What did I learn?

Make better notes (probably never happen).

Fully automate for a restart. I remember when I recently rebuilt the Internet server, there were issues with these email components. I obviously did not fully complete the install and left things not starting on boot.