Serial port problem part-way resolved

Having put the 4 port serial card back into boron, the onboard port now works again, so I’ll probably continue with developing the software. The expansion card still doesn’t work though, so I’ve ordered a cheap 2-port card from eBay in the hope that a different card will work.

Before reinstalling the card I upgraded Ubuntu to see if that would help (it didn’t) which brought its own scary moment of the 1TB RAID volume being dead. That too is solved now – the drive letter assignments had changed.

Hitch with the audio system

Today I started development of the software to control the whole-house audio system. It’s written in C# and based on the MiniHttpd project – a small but powerful implementation of a web server in C#.

However, when it came to testing the first bits of code, I’ve envountered a problem. A while ago I bought a 4 port RS232 serial card to go into boron, because the motherboard only has 1 onboard port which isn’t enough for the UPS, the matrix switcher and probably some other things such as connections to network switches.

The new card shows up fine in lspci, seems to be ok when running setserial -gb, but when trying to send or receive data nothing happens. Thinking it might be a conflict with the onboard port, I went into the BIOS and disabled it. Still nothing. So I swapped the card into another machine and re-enabled the onboard port in boron‘s BIOS. Now the onboard port doesn’t work either.

I’m going to contact the manufacturer of the card for some help. But for the onboard port I’m completely stumped. It too shows up in lspci and setserial -gb (though only when running using sudo, which wasn’t necessary before) but any attempts to use the port result in various I/O error messages. I was worried that the new card may have killed the serial communication capabilities of the matrix switcher and the UPS, but I’ve confirmed that at least the matrix switcher still works by connecting it to my test machine, iron.

If anyone thinks they might know what’s getting on, please get in contact via the comments for this post – I would be very greatful for any help.

Monitoring power via my UPS

I’ve set up a few MRTG config files and some simple shell scripts to graph the available data from my Compaq UPS via Nut. This will give a basic way to monitor the combined power consumption of everything that’s connected to the UPS. Currently this is everything in the rack plus the computer under my desk (and the peripherals on top). If you like graphs, you can see them on this site.

In addition to this method, I also have a plug-in power meter that can be used on individual items. It’s currently plugged into the incoming side of the UPS. For whole house power monitoring, the Wattson looks pretty good, but it’s not exactly cheap.

Getting NUT working with a Compaq T2400h


Several months ago I posted some information on the cable to connect a Compaq T2400h to a standard serial port. This weekend I finally got around to trying out the information that I found. I now have the 2.4KVA UPS at the bottom of my rack cabinet talking to my Ubuntu-based fileserver, boron.

The first step was to create the cable. This requires a 9 pin female ‘D’ connector and a matching male connector. For the cable I used an offcut of CAT5, though normally serial cables do not use twisted pair (usually just parallel wires).





The software part is done using NUT, for which there is a package included in the Ubuntu distribution. This software talks to the UPS, monitors it’s status and allows other computers to check the status. The monitoring applications are then responsible for shutting down the computers attached to the UPS should power fail and the battery become critical. So far this is just boron and my Windows machine, aluminium. The latter uses WinNUT to shut down Windows when needed.

There were a few problems getting NUT to work with Ubuntu. First off, the package doesnt put any configuration files in the /etc/nut path, so I had to go hunt for the examples and copy then modify them. The next problem was with permissions for the serial port. For testing purposes I tried running the protocol module as root, but this introduced different permissions problems. The solution was to add the ‘nut’ user to the ‘dialout’ group, which is one group that has access to the serial ports. To my relief this got everything working.

These are the parameters that I can access over the serial connection:

simon@boron:~$ upsc compaq@boron
battery.charge: 97.22
battery.runtime: 1620.000
battery.voltage: 0055.50
battery.voltage.nominal: 0048.00 upscode2
driver.parameter.input_timeout: 5
driver.parameter.manufacturer: Compaq
driver.parameter.port: /dev/ttyS0
driver.parameter.use_pre_lf: yes
driver.version: 2.0.5
driver.version.internal: 0.84
input.voltage: 0244.50
input.voltage.maximum: 0276.00
input.voltage.minimim: 0162.00
input.voltage.nominal: 0230.00
output.current: 0001.95
output.frequency: 0050.00
output.voltage: 0215.10
ups.delay.reboot: 000
ups.delay.shutdown: 000
ups.load: 21.875
ups.mfr: Compaq
ups.model: UPS 2400 VA FW -0023
ups.power.nominal: 2300.000
ups.serial: E########
ups.status: OL TRIM

These are the resources that I used to get the UPS/NUT combo working:

The VAMS-0808 matrix switcher and determining its protocol – part 2


As I mentioned last month, I bid on and won an 8×8 AV matrix switcher on eBay. The switcher arrived the Monday following the Saturday that I won it (speediest delivery ever!), so I took it home and plugged it all in.

I rummaged around for a serial cable to connect the switcher to boron, the Ubuntu file server and found something that I thought would do the job. Sadly the switcher has a male connector, whereas for a standard serial cable it should be a male connection on each end. So, slightly disappointed, I went ahead and ordered a M-F serial extension from eBay, assuming that this would do the job. This attempt also failed – the matrix switcher would not respond to any of the commands that I thought it should, and nothing was being returned either. After a bit more research in the little documentation that I had I noticed that the switcher requires a cross-over cable AKA a null modem cable.

The next cable I ordered was a M-M cable, so I got an M-F converter at the same time. Success! I now have the ability to control the matrix switcher via the RS232 on boron.


The following weekend I set about writing a prototype of the software to communicate with the switcher. The switcher operates in such a way that state is important, since switching channels requires at least 2 commands and at any time someone can press a button on the front panel to issue any command.

When a button is pressed on the front, a message is sent via the serial port to indicate the action that has taken place. Similarly, when an instruction is sent to the unit over the serial connection a reply is received indicating whether that command succeeded or not. Sometimes the switcher doesn’t notice that it’s been sent an instruction, so to get around that I ended up sending the same message up to 3 times.

The resulting prototype works quite well. I may release the source code at some point.

Here’s a video demonstrating the software and the switcher:


What’s next?

The Homebrew Challenge gave me a reason to progress my projects, but over Christmas things have slowed down. Winning the competition has given me some money from the sale of my old car, so it seems fitting that the money is put towards finishing the current projects. This is my plan for the projects over the next 2 years.

Purchases Actions
January 2008 Zone 2 amplifier, Zone 4 amplifier Improve rack ventilation
February 2008 Zone 3 amplifier, DVI/USB KVM
March 2008 Matrix switcher
April 2008 4u blanking plate, 1u blanking plate Write control software
May 2008 Write control software
June 2008 Netiom xAP Write control software
July 2008 Write control software
August 2008 Outdoor IP camera
September 2008 X10 modules
October 2008 Outdoor IP camera
November 2008
December 2008
January 2009 Netiom xAP + sensors
February 2009 Netiom xAP + sensors
March 2009 Netiom xAP + sensors
April 2009 Netiom xAP + sensors
May 2009 Netiom xAP + sensors
June 2009 Netiom xAP + sensors
July 2009 Netiom xAP + sensors
August 2009
September 2009
October 2009
November 2009
December 2009

I have purchased the 2 amplifiers for this month from eBay, but haven’t got around to the ventilation improvements as yet.

Completing the first phase of the MythTV setup

After finding out that the two tuner cards I already have are too large to fit in the new Camulus case of the new MythTV master backend (aka sodium), I ordered a Nova-T 500 dual-tuner PCI card. This was a little risky because Hauppauge produced a limited run of cards for the UK that are not compatible with linux. These cards are normally identified by their model number and certain stickers on the box.

Continue reading “Completing the first phase of the MythTV setup”