http://www.adamsinfo.com/custom-linux-router-the-story/
I have two separate internet providers, two separate static ranges, one from each provider, and a LAN. The purpose of the exercise here was to split traffic between the two providers on an equal 50/50 basis.
My router of choice was a Mikrotik Routerboard 532a on which I’m running OpenWrt (Linux, 2.6.23.16 kernel). I also modified the device to add a wifi minipci card (atheros based) and a lenovo minipci USB card. I had to solder two points on the routerboard where I could safely draw 5.0V at ~200mA to power passive USB devices, as the minipci socket only provides 3.3V as standard. With this all done, the hardware and enclosure was complete. On – I also bought a picolcd usb device and attached it to the casing just for fun. (http://www.apnicsolutions.com/images/2_big.jpg and http://www.apnicsolutions.com/images/1_big.jpg)
With this done, I then installed OpenWrt, added Webif^2 and some other custom packages, and had a nice wireless/lan router.
linux
User:davidapnic
routerboard
mikrotik
minipci
OpenWRT
USB
wireless
router
532a
http://www.adamsinfo.com/using-picolcd-on-linux-lcdproc-routerboard-liblcdusb/
I’ve posted previously about my embedded device and picolcd. I wanted to put some thoughts down about using picolcd.
The easiest way to drive your picolcd is with lcdproc I’ve found. The device doesn’t require any special drivers which is great, as long as you have USB support working you’re fine. Make sure uhci-hcd and usbcore are loaded, you should be able to use ehci-hcd as well as it supports USB 1.1 and 2.0 but I haven’t tested that.
Use lsusb to make sure that the device is shown and recognised. If you see:
Bus 002 Device 003: ID 04d8:0002 Microchip Technology, Inc.
then great. Your device is connected, working and your machine supports USB.
Make sure that libusb and libhid are installed, and then grab a copy of: usblcd from: http://www.mini-itx.com/store/information/usblcd/usblcd-src-0.1.4.tgz, compile and install it.
Here’s some relevant parts of the documentation on using usblcd from the archive. It’s pretty complete and you should now be able to use usblcd to control your device. I’ll cover writing your own applications as well as using lcdproc further down, anyway, here’s the docs:
usblcd backlight [0|1] turns on or off LCD screen backlight
usblcd contrast [0-40] set the contrast. 0 is maximum contrast and 40 minimum
usblcd led led number turn on/off one of the front panel leds (1-8)
usblcd clear clears LCD screen
usblcd text row:0-1[text] prints text on LCD screen starting with row and column
usblcd splash [filename] sets the splash screens content from filename. Samples of splash files are located in doc/ directory. After the splash file has been loaded into EEPROM the usb lcd should be restarted by reconnecting it to USB port.
Example of a splash file:
00 05 12345678901234567890 12345678901234567890 00 15 12345678901234567890 12345678901234567890 00 25 12345678901234567890 12345678901234567890 00 35 12345678901234567890 12345678901234567890 00 45 12345678901234567890 12345678901234567890
usblcd setfont [filename] overwrite the first 10 characters from LCD CG-RAM with the characters from filename.
usblcd flash [filename] write the firmware from filename into EEPROM
usblcdread read events (key press and infrared data) and outputs to stderr This data can be piped and parsed by another application.
Format is: KEY: For keyboard events means key release or more than 2 keys pressed at the same time.
wait [seconds] wait for a number of seconds before executing the next command
Examples ——–
usblcd led 1 1 wait 1 led 2 1 wait 1 backlight 1 contrast 0 text 1 2 “mini-box.com USB LCD” read This will lightup first led then wait 1 second, light the second led and wait 1 second, will turn backlight on, set the contrast to maximum, write the “mini-box.com USB LCD” text to second row starting from third column, and will continue printing events till closed with CTRL+C or SIGTERM
For more examples see the examples directory.
Now that we’ve got used to usblcd, we can move on to building our own application on libusblcd. Take a look here: http://resources.mini-box.com/online/picoLCD%2020×2%20(OEM)/Documentation/libusblcd-development-guide.txt for the full function set, but here’s a simple example in C to get started with:
int main(int argc, char **argv) { usblcd_operation *picolcd; if (argc == 2) { picolcd = new_usblcd_operations(); picolcd->init(picolcd); picolcd->backlight(picolcd,1); picolcd->settext(picolcd, 0, 0, argv1); sleep(SLEEP_FOR); picolcd->backlight(picolcd,0); picolcd->close(picolcd); } else { printf(“Usage is: %s \n”, argv0); return 1; } return 0; }
Make sure that you compile with -lusblcd and you’ll be on your way.
Lastly, I’m not going to go too far into the lcdproc project, they have a great informative site and it’s pretty simple to get working. Suffice to say, it works perfectly with picolcd! It also seems to run and respond a lot faster than libusblcd
linux
uhci-hcd
pico
USB
lcd
lcdproc
Drivers
on
embedded
usbcore