Posts

Controlling an LG TV via serial from Linux.

I have an LG plasma TV. Like most electronic home entertainment stuff these days, it comes with a port on the back for controlling it. In this case a serial port. LG helpfully put all the commands for controlling it in the back of the manual.  The commands are along the lines of: ka 01 00 - Which turns the power off. or kf 01 ff - Which is query, "what is the power status?" Which will return: a 01 OK01x     - A string as to whether the TV is On or Off, in this case "ON". This is useful as it provides a feedback mechanism, rather than shooting commands down the line and hoping that they'll have an effect (a la X10). So if I want to increase the volume by 1, I can read the current volume and add 1 to it. So this gives me the opportunity to automate tasks based on external events. Now a lot of my stuff I control from BASH Linux shell scripts and this is no different.  To control it from BASH is quite easy, you can just "echo" to or ...

Getting SNMP info by phone.

Hi, I have a small Asterisk VOIP PBX running. It's the PBX in a Flash version from the Nerd Vittles site and I have it running off a USB key plugged into a Acer Revo small PC. One of the useful things about having your own PBX is that you can play about with things like IVR's (Interactive Voice Response), those annoying voice menu things you get when you ring up the gas board with a billing query. On Asterisk IVR's can also be very useful for technical doing stuff like running Linux command line utilities and getting the output read back to you with a text to speech voice. I have mine reading back my current ADSL connection speed, as my mine gets gradually slower after a few days. Here's how to do it: If you have a Centos/Redhat based Asterisk server you need to install SNMP utils. $> yum install net-snmp-utils Install any dependencies too. This will get you the snmpget command line tool. To get the connection speed out of my router, I would need to issue the command...

Linux autofs and Wake on Lan bodge.

Hi, Like many people, I have a media server which stores all of my films, music and pictures in all one central place. It's a Centos Linux box with a SATA card and software Raid5, it serves to devices like my Acer Revo running Xbmc and Mythtv frontend. With this configuration it's a little noisy, creates a bit of heat and probably uses a bit of electricity, but turning it on can be a bit of a hassle. Particularly when it's at the other end of the house. My solution autofs and wake on lan. autofs is a suite of tools that will auto mount devices and NFS shares when you first use them. Wake on LAN on my setup was a small cable that goes between my (dlink) PCI network card and my motherboard and I had to edit the BIOS to allow the machine to be woken. There seems to be a number of different ways to setup WOL on linux. I had to use ethtool to put the network card in a fit state to be woken up when the server was shutdown: ethtool -s eth1 wol g I actually put this in a Bash scri...