From NAS-Central Buffalo - The Linkstation Wiki
<<LCDKuro>> -- Add a Display and Keyboard to your Kurobox
An Entry For the 8/1-11/15 2006 Contest by russK
If you are wishing you could see what your Kurobox is doing without network access, or if you want another way to log in to your Kurobox, then this project might be for you.
Goals and Wishlist for LCDKuro
This project is to add an LCD display device to the kurobox. The display will be used to provide useful information and a handy console for logging in with a keyboard.
The goals I have set for this project are
- Provide a small console with an LCD display and a keyboard that can be used for logging in and running command line commands
- Provide machine status information on an LCD display with statistics like current time, CPU activity, CPU Load, memory usage, disk space usage, etc. Most of this information can be provided by an open-source package called LCDProc. LCDKuro can rely heavily on LCDProc.
- I would like to be able to provide multiple virtual consoles selected with alt-Fkey like on many typical linux distributions. This would ideally include switching between the console logins and the LCDProc functionality.
- I would like to have the LEDs on the side of my chosen LCD device to provide some useful information, e.g. flashing for disk activity, mimic the kurobox's LEDs, blink when new mail arrives, blink when a new topic is posted to the kurobox forums, whatever.
Crystalfontz CFA635-TMF LCD Display
There are all sorts of LCDs of available from various manufacturors. I have chosen the Crystalfontz CFA635-TMF (CFA635TMFKU1) for this project. It's a 20x4 display with a USB interface, has good support in LCDProc, has some nifty buttons that might prove useful and most of all, it looks cool. It is designed to fit in a typical 5-1/4 half-height PC bay on the front panel of a PC case. I will install the display in a small box and set it on the desk next to the keyboard. I ordered one through the crystalfontz web site ... it includes a USB cable with the proper connector. The total cost of $81.50 includes $9.00 for shipping. This seems a bit high, but considering the cool factor of the envisioned product, I can live with it.
I already own a USB keyboard I am going to use for this project - if you don't have one, I think they can be had for around $10.
LCDProc is an open-source package for controlling LCD displays under Linux. LCDProc has a server component for controlling the display, while clients can connect to the server and provide data to be displayed. Many different types of displays are supported by LCDProc. The different displays are supported by LCDProc through drivers. Only the server needs to worry about the details of the drivers and display types, while the client can remain somewhat unaware of the details. This makes it easy to change display types and leaving the client code very much intact.
The latest released version of LCDProc is 0.5.0 as of 4/15/2006. I use gentoo on my kurobox, and the latest version of LCDProc available in portage is 0.4.5 which is 2 years old. Around 9/9/06 I found I could not get LCDproc 0.5.0 up and running. It did work on my AMD64 box. I captured the output of the serial packet driver example program with usbmon and I saw byte-swapping issues. After looking at the code, it was fairly simple to fix, the only issue was a CRC word in the packet protocol. I fixed my copy and sent a patch to the LCDProc mailing list. The developers of LCDProc fixed their CVS version the same day and asked me to try their nightly build. Their nightly build is on sourceforge. Now that's what is so awesome about opensource software! I am using the CVS nightly build lcdproc-CVS-current-20060923 for LCDKuro.
- Virtual Console
Someone has created a virtual console driver for LCDProc - this will come in handy for logging into the LCD device and running command-line commands. The virtual console client for LCDProc is called lcdvc. The nightly build also fixes a bug in lcdvc, so that's another good reason for using the nightly build.
There is some talk about LCDProc 0.5.1 coming out soon. If LCDProc 0.5.1 (or better) is out as you read this, you may want to use the stable release instead of the nightly build.
Kernel Support for LCDKuro
There are several kernel modules I had to build for LCDKuro. You can either follow along here to build your own modules, or you can download a prebuilt kernel and modules that Sylver has built. You can download Sylver's kernel and modules here: Sylver's 2.6.18 kernel modules. Also see the end of this wiki in the Closing for the necessary .config settings.
Using a keyboard on the kurobox requires support in the kernel. This support is not provided in the regular kurobox kernels, so a custom kernel will have to be built or possibly just a module.
At the start of the project, I discovered my kernel does not have USB Keyboard support. In my .config file I had:
# # USB HID Boot Protocol drivers # # CONFIG_USB_KBD is not set
I am using Sylver's 220.127.116.11 uImage kernel I so I prepared the kernel source per his instructions he graciously provided in the kurobox forums. This is what I did to create a new kernel and keyboard modules:
# cd /usr/src # wget http://kernel.org/pub/linux/kernel/v2.6/linux-18.104.22.168.tar.bz2 # wget http://genbako.vodapone.com/kurobox-sources-2.6.17.patch # wget http://www.holtmann.org/linux/kernel/patch-2.6.17-mh1.gz # tar xjf linux-22.214.171.124.tar.bz2 # cd linux-126.96.36.199 # patch -Np1 < ../kurobox-sources-2.6.17.patch # gzcat ../patch-2.6.17-mh1.gz | patch -Np1 # vi (or nano) Makefile # add -mh1 to EXTRAVERSION = .1, result: EXTRAVERSION = .1-mh1 # cp /boot/.config .config # export ARCH=ppc # make oldconfig # this step may be uneccessary but I did it anyway # make menuconfig # select Device Drivers -> USB support # # navigate down to USB Human Interface Device (full HID) support # # press 'M' to select support as a kernel module # # Exit # # Exit # # Device Drivers -> Input Device Support # # navigate down to Event Interface # # press 'M' to select support as a kernel modules # # Exit # # Exit # # Exit Yes (Save configuration) # make vmlinux