(This is mostly a set of instructions for myself if I ever need to format my media PC, so I know how to fix it, but it turned into a short story that might help others as well)
I have a machine connected to my TV for playing movies, both from DVDs and from my file server, TV shows and everything else I might think of. Some time ago I acquired a remote for this machine, so I could control it all from my couch. And for some time, it was good. Until I rebooted the machine, and found that my remote was no longer working. Some experimenting, and I figured out that disconnecting the cable, and reconnecting it worked. And especially if I pressed buttons on the remote at the same time as reconnecting it.
I have no idea whether this was because of the hardware (either the serial receiver, or the PC), or something software-related. There were some issues with the serial port being grabbed before LIRC had a chance to start up. After I got my Mac mini and that took over as my desktop, I started shutting down this machine before going to bed, so having to do the reconnect-dance every day grew tiring really quick.
So I went out and bought a replacement.
The new device
I found a “THERMALTAKE Media LAB with remote, Black (A2331)”, which identified itself as “SoundGraph IMON VFD Device” when connected. It has, in addition to a IR receiver, a two line VFD-display with room for 16 characters on each line.
The USB ID is 15c2:0036
Getting the IR to work
I use Gentoo, and at the time of writing, LIRC 0.8.4 was the newest version in my tree, which did not work properly. Or I chose the wrong driver. Not really sure. I downloaded the latest 0.8.5 from lirc.org and compiled it. Selected “Soundgraph iMON PAD IR/VFD” from the USB devices
setup.sh listed and it worked instantly. Modprobing the driver (
lirc_imon) created both
I have no idea what the difference between
/dev/lcd1 is, since they both can be used to change what is displayed.
/dev/lirc1 however, have huge differences. Most of the interesting buttons come through
lirc1, including Play, Eject, Fast-Forward, Rewind, Next Chapter and so on.
Then the mouse-related buttons, except the Mouse/Keyboard toggle button, and the number buttons come through
lirc0. So to get everything working, we need two LIRC daemons running.
irrecord properly, we need a
mode2 instance watching the other device, since the device maintains a buffer, and nothing new comes out of
lirc1 has events waiting to be processed, and the other way around. My remote ended up with the following configurations
toggle_bit_mask lines were originally something else, but I had to modify them a bit to prevent one event when pressing the button, and one when releasing it. Don’t remember where I found it, but it worked. Just randomly changing until only one event showed.
To get lircd running properly, I modified the init script from Gentoo, and had it start two of them, each with their own configuration:
After this, the remote part worked like a charm. Then, onto the display!
I tried running LCDproc first, which worked fine, but it seemed a bit overkill for my use, since I can just as easily write to
/dev/lcd0 and have it displayed.
/dev/lcd0 gets created 0660, and owned by root:root, which means my user can’t write to it that easily. Instead of looking for a proper solution, I just stuck
chown root:video /dev/lcd0 into my
/etc/conf.d/local.start, which took care of it.
Writing more than 32 bytes to
/dev/lcd0 gives the unhelpful error message
-bash: echo: write error: Invalid argument. Just remember to keep it under 32 bytes, and it works fine. And line breaks count, so
echo -n is recommended.
When powering down the machine, the display still keeps what was written to it last, so if you sleep in the same room as the machine, and want it dark, like I do, you need to clear the display before shutting down the machine. I fixed that with
echo -n " " > /dev/lcd0 in my