Tuesday, June 17, 2008

Printing from Linux to Windows(R). Part I Window(R) 98

Yes, maybe I'm suprising you, but it is my real history. At the (chemistry) laboratory, where I'm working we have an old machine with pre-installed Windows(R) 98, to which is connected a Xerox 3121 through parallel port (parport or LPT). At work I've just installed Kubuntu 8.04 to check how people made it popular (Debian Lenny works perfectly on my home desktop). In my opinion, Kubuntu, in particular, and Ubuntu, in general, are worth to be desktop distrib. But it is another history.


1. My attempt to print from Kubuntu box to Windows(R) 98 by CUPS/Samba was fail. But I going to describe it here:

1.1. Share printer on Windows(R) 98 host:
Open Control Panel -> Network Settings -> Access to Files and Printers (or similar, I use Russian Version of Windows(R) 98). Open Printers Setting -> Share (under a simple name, for example, XEROX).

1.2. Make sure you have cupsys, splix packages installed, because Xerox 3121 uses splix driver, then open in a web browsers CUPS administration interface at http://127.0.0.1:631. Add printer via device URI smb://192.168.8.210/XEROX, and choose driver (manufacturer Xerox, model Xerox 3121 with locale version of driver, en and some others available). Finally, give root as username and its password to add new printer. At the end, you can configure the new added printer.

Attention: Ubuntu users must give their name (not root). I think they know better than me :).

But when printing to new printer I got this error message in the Printer tab of CUPS administration web interface: "Unable to connect to CIFS host". And:

$ smbclient -L 192.168.8.210
session request to 192.168.8.210 failed (Called name not present)
session request to 192 failed (Called name not present)
session request to *SMBSERVER failed (Called name not present)

I'm not a super user, but I guest Windows 98 does not support printer sharing via Samba, or that feature is not working the right way, because of this concret Windows(R) distribution. Although, files sharing (read & write) works well.

2. I've resolved this problem in the other way. Search a bit, I've found an article about LPD Win (developed by G. Zander) - a LPD service for Windows(R) before 2000. Download it, extract the archive, and configure this small program (setup spool, allowed hosts, add to registry to run as service, add new printer, configure this printer as local one), that all we need to do on the server side. I don't tell you where to download because I don't know under which license LPD Win is released. I even didn't found it (the license) at all.

Configuration the client side (Ubuntu box) remains the same. Only different is the device URI (use lpd://192.168.8.210/XEROX, insteed).

Read more: http://gentoo-wiki.com/HOWTO_print_winserver
http://www.penmachine.com/techie/lpdprinting_2003-08.html

Thursday, June 12, 2008

Install Mustek BearPaw 1200CU Plus Scanner on Debian Lenny

First, we need sane backend, that is what works with your scanner on the apparatus level, include driver, firmware, etc and some utilities, which very help us in configuration and diagnostics. As root:

# apt-get install libsane sane-utils

Then go to get firmware. I have a Mustek BearPaw 1200CU Plus and as shown on SANE home page it uses gt68xx backend. Thus, I went to get firmware from http://www.meier-geinitz.de/sane/gt68xx-backend/, put in /usr/share/sane/gt68xx/, and make sure it is readable for everyone:

# chown root.scanner /usr/share/sane/gt68xx/PS1Dfw.usb
# chmod 755 /usr/share/sane/gt68xx/PS1Dfw.usb

The sane-utils package contain two tools we need. First we use sane-find-scanner to check if kernel support USB scanner:

$ sane-find-scanner
found USB scanner (vendor=0x055f, product=0x021c [USB Scanner], chip=GT-6816) at libusb:003:002

It's seem OK. Let's check if scanimage works:

$ scanimage -L
No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).

But under root, scanimage gives a positive answer:

# scanimage -L
device `gt68xx:libusb:003:003' is a Mustek Bearpaw 1200 CU Plus flatbed scanner

Yes, you guess right. We have permission problem, programs works successfully under root and not as user. Although, Debian Lenny uses UDEV, all we need is to add appreciated users to scanner group, you know how :). Don't forget to logout and login again after that.

Mustek BearPaw 1200 CU Plus doesn't need any manual settings, so editing is no-needed, but take a look at /etc/sane.d/gt68xx.conf or your scanner backend's configuration file.

Now, when scanner is ready, scan your documents, images, etc by:

$ scanimage --device-name gt68xx:libusb:003:003 --resolution 300 --format png > test.png

Or, better, get a GUI frontend like Xsane:

# apt-get install xsane


Additional steps: Here, when configured the hotplug subsystem I needed to get sane-backends source from http://www.sane-project.org/, untar & copy hotplug files in subdir tools/hotplug into /etc/hotplug/usb then restart UDEV:

# /etc/init.d/udev restart

Note: If you have other scanner, just look for other sane backend.
Read more:
1. SANE home page (especially documentations section).
2. http://gentoo-wiki.com/HOWTO_Installing_USB_Scanner
3. Script and configuration files (/etc/hotplug/usb/*, /etc/sane.d/*)

Thursday, June 05, 2008

Install HP LaserJet 1018 printer on Debian systems.
Part III. Sharing with Windows system

Printer sharing is something common now. Because even at home we can have more than one computers, which in the most cases are connected to a local network (LAN). Now, when you've got your HP LJ 1018 be configured and works well on Linux system, it's time to make printer shared by CUPS. CUPS has client/server model, it means we must configure CUPS server on Linux to accept client requests from other machines. It requires you know how to install printer on Windows(R) systems. Trust me, it is not such easy in cases with Vista ;).

Open web interface (http://localhost:631/) to configure the server side. At this web page, choose Administration tab, in Basic Server Settings: tick Share published printers connected to this system, then update by click Change settings. Don't forget to open port 631 in your firewall's setting and check Allowed users setting of the shared printer.

Client side configuration here applies for Windows(R) 2000/XP/Vista. I prefer installing drivers before from the CD with printer. Then just open printer setting in Control Panel, click add printer, choose network printer and adding by yourself. Then type the address of printer, something like this:

http://192.168.0.22:631/printers/HP

where HP is the printer name. After that, install correct driver, etc. That's all. Additionally, you can configure new printer and print the test page. Everything is simple, but you need to be lucky, at least because Windows(R) system are unpredictable :).

Note: when you add new printer to your new purchased Vista box, some strange things can happen. Just ignore them. Restart Vista. Hope printer will be ready.

Read more:
http://wiki.archlinux.org/index.php/CUPS_Setup#Printer_Sharing
cupsd.conf(5) -- a short man page.

Monday, June 02, 2008

Install HP LaserJet 1018 printer on Debian systems.
Part II. About hotplug.

Now, when printer was configured and work for you, you may want the hotplug system loads firmware to your device instead of typing command cat /usr/share/foo2zjs/firmware/sihp1018.dl > /dev/usb/lp0 every cycle turn of/on.

To configure hotplug, you can use the instruction on foo2zjs homepage. See Part I for that link. But then you must download source of foo2zjs, make it and then make install-hotplug. Be sure to read /etc/hotplug/usb/hplj1000 (a bash script) and in this file clearly show the place of your device (/dev/usb/lp0).

Instead, you can take that file from my system. Put it in /etc/hotplug/usb/. Give it executable properties and make link(s):

# mv hplj1000 /etc/hotplug/usb/
# chmod a+x /etc/hotplug/usb/hplj1000
# cd /etc/hotplug/usb
# ln -s hplj1000 hplj1018

Maybe, you need to restart cupsys service. And then turn on printer. It should work now.

Sunday, June 01, 2008

Install HP LaserJet 1018 printer on Debian systems.
Part I. Quick start.

This shows how to install this USB printer in 4 steps:
Step 1. Installing CUPS:
# apt-get install cupsys

Step 2. Installing foo2zjs driver
# apt-get install foo2zjs

Step 3. Turn on the printer and get the firmware to take its power
# getweb 1018

gunzip: stdin: not in gzip format
Error: Can't open '/usr/share/foo2zjs/tmp/sihp1018.img'

(c) Copyright Hewlett-Packard 2005

# file /usr/share/foo2zjs/firmware/sihp1018.dl
/usr/share/foo2zjs/firmware/sihp1018.dl: empty

No!!! But, OK, we will get the firmware directly from website:

# wget http://foo2zjs.rkkda.com/firmware/sihp1018.tar.gz
# tar xzvf sihp1018.tar.gz

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors

Oh, it seems that file is not in gzip format. So we need to check:
# file sihp1018.tar.gz
sihp1018.tar.gz: POSIX tar archive
# tar xf sihp1018.tar.gz
# arm2hpdl sihp1018.img > sihp1018.dl
# mv sihp1018.dl /usr/share/foo2zjs/firmware/sihp1018.dl
# file /usr/share/foo2zjs/firmware/sihp1018.dl
/usr/share/foo2zjs/firmware/sihp1018.dl: HP Printer Job Language data
# cat /usr/share/foo2zjs/firmware/sihp1018.dl > /dev/usb/lp0

Step 4. Add new printer by CUPS's interface at http://localhost:631/. That all, let's go print your documents, e-mail, poems, etc.

Note: my Debian system is Lenny, but I think the instruction works for other. If have troubles, you may want to install foo2zjs from the source (newer version, than the one in Lenny). In that case please read how to do at http://foo2zjs.rkkda.com/. If still have problems, you can ask on forums for supports.