Friday, April 24, 2009

Kiosk development - Star Micronics TSP-100 thermal printer

Thermal printers are great for printing receipts. Thermal printers requires no ink as it prints by making "burns marks" on the special thermal paper.

Star Micronics TSP-100 claims to support Linux drivers which essentially mean Red Hat variants via .rpm driver. Eg. RHEL, CentOS.

Couldn't convert the supplied .rpm file to .deb using alien but managed to find somebody who's kind enough to iron out all the dependencies and packaged a .deb

If you're using latest version of Ubuntu then it'll probably work out of the box.

To print receipts from your webapp, issue system commands directly from your controller.

Eg. using Rails

def print_receipt
system "lpr -P printer_name receipt.pdf

"lpr" is unix print command that will send print jobs to cups daemon. Better still, set the thermal printer as default printer then

system "lpr receipt.pdf"

To view print jobs on Ubuntu, either view from "System" > "Administation" > "Printing" or in browser "http://localhost:631"

To cancel all print jobs in terminal

cancel -a

Kiosk development - Setting up Elo touchscreen

I did not setup the touchscreen but there's a fairly simple instructions on how to do it on unix machines.

Just remember to access the control panel and set touch mode to be "Click on touch" else you'll find icons being dragged around while you're pressing on the screen.

Kiosk development - Fullscreen Firefox

If you ever wanna use Firefox under kiosk environment. It's a good idea to strip out all the menus and navigation and window bars using the R-Kiosk addon

Do the following configurations before you install the addon.

1. Create a "kiosk" profile using "firefox -ProfileManager". This will ensure you have access to another Firefox session that's not in kiosk mode.

firefox -ProfileManager

2. Type "about:config" in the URL and search for "browser.sessionstore.resume_from_crash" and set value to "false". This will prevent Firefox from asking to restore previous sessions if exited abruptly.

3. Uncheck anything in "Preferences" that may cause a dialog to popup while Firefox is in use.

4, Set your application's start page as the default homepage. You won't have access to the URL bar in kiosk mode!

Now you're ready to install the addon.

Once the addon has been installed, you'll be able to access your kiosked Firefox by running the following either in console or a icon command.

firefox -P kiosk

To access non-kiosk Firefox use the following

firefox -P default

If the above keeps getting kiosk then append "-no-remote" to the command

firefox -P default -no-remote

Actually there's a way to disable the kiosk addon.

firefox -P kiosk -safe-mode

This will give a dialog with option to disable all addons. ;)