Sunday, December 28, 2008

CUPS - Wifi Brother HL-2170W



basics (through USB)


Appears there are several steps.
1. Unbox and confirm printer works using test page.
2. The Brother drivers appear to come only in .deb and .rpm formats, so I verified the rpm program was installed (if not, netpkg rpm).
3. Download rpm printer drivers from Brother site, both the cupswrapper and the lprdrivers.
4.Install the lpr driver
# rpm -ihv --nodeps brhl2170wlpr-2.0.2-1.i386.rpm
5. Install the cupswrapper
# rpm -ihv --nodeps cupswrapperHL2170W-2.0.2-1.i386.rpm
6. Verify these have properly installed by finding them in the results from this command:
# rpm -qa
7. Turn-off printer and connect with USB. Turn-on printer.
8. Add printer to CUPS
# lpadmin -p Brother -E -v usb://dev/usb/lp0 -m HL2170W.ppd
9. Restart CUPS
# service restart cups
10. Should work

Saturday, December 27, 2008

XFCE4 start-up actions

I was recently at my folks' for the holidays and plopped-in Zenwalk 5.2 on an old system they have there. One thing I wanted Xfce4 to do when Mom logged-in was to
$xgamma -gamma 0.7

startup


To solve this, I created a .desktop file (I named mine xgamma.desktop) made it executable (chmod 755 xgamma.desktop), and placed it in the xfce autostart folder (~/.config/autostart). This format for the .desktop file worked the first time:
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=xgamma
Comment=takes screen to .7 bright
Exec=xgamma -gamma 0.7
StartupNotify=false
Terminal=false
I then logged-out. After logging back in, the screen went to 0.7 brightness automagically.

Friday, December 26, 2008

CUPS - usb HP DJet F300

(HP a1350e)
    Zenwalk 5.2
    2.3G Athalon X64 two part processor
    400 MB Ram
    HP Deskjet F300 (USB)

CUPS, good documentation here.

Sketchy CUPS Webtool


I was at my folks house recently for the holidays and installed Zenwalk 5.2, a Slack-based OS that's pretty light. All went well until I attempted to add a HP Deskjet F300 All-In-One. The HP website says support only begins with F310. I figured I could get a workaround going.
1. In spite of (significant) password efforts, you will likely find that the webtool athttp://localhost:631simply rejects any and all passwords, no matter what, when, or why, and will deny you adding a printer, always waiting until the final step in a timely 6-part process to do so. After a couple of lost days working with /etc/cups/cupsd.conf and password, this of course will become ballistically frustrating. The temptation to sledge-hammer the computer will become more pronounced as one realizes the rejection of the CUPS webtool means the printer must be added manually using lpadmin and, like any CLI, it is powerful and simultaneously filled with the potential for damaging errors. One can easily spend days. But what are you going to do - you have to print, right?
2. The ppd file has to be locatable by lpadmin. Put the ones which need to be found in /usr/share/cups/model/ . I renamed the original ppd to dj350.ppd. for ease of loading and made sure it was the proper permission for ppd files "644". Now try this:
#lpadmin -p HP300 -E -v usb:/dev/usb/lp0 -m dj350.ppd 
The printer added easily. If a mistake is made and a PPD file is installed that you later want to substitute with a different PPD file, put the new file in /usr/share/cups/model/ and run the following command:
#lpadmin -p HP300 –P another.ppd
To delete a printer entirely, use the command:
#lpadmin -x HP300
To make certain, you can always check the list of installed printers using:
#lpstat -v



Day 2 (Afternoon/Evening) More lpadmin and configuration files


It may be possible, though unlikely, to work via CUPS web interface. If not, look at the file /etc/cups/printers.conf and note its arrangement. Pay particular attention to this line.
DeviceURI usb://dev/usb/lp0
This critical printer setting must be accurate.

test prints


Test prints are one easy thing from the CUPS web interface; although lpadmin is required to stop testprints, the CUPS interface is an easy way to initiate them. While testing the printer configs, many test prints might be desired. If they don't print, they pile-up in queue and use resources re-attempting. One can't use CUPS web interface to stop prints, so cancel them from lpadmin:
#lpstat -o
provides pending print jobs and the job number eg, "HP1100-1". Then
#cancel HP1100-1
will get rid of the job. Run "lpstat -o" again to verify, if you like.

xfce4 connection


To print from Mousepad and others that use X-settings, xfce printing needs to recognize the CUPS printer. Try printing in Mousepad and see if the CUPS printer is available. If not, configuring xfce4 to CUPS will be necessary. This was simple for me. I simply went to the XFCE menu, then access Settings ->Settings Manager -> Printing System. Once in Printing System, I selected the CUPS network printer and closed the menu. I then opened a Mouspad file to print; sure enough, the CUPS printer appeared in my options.

SNMP HPLIP


SNMP (Simple Network Management Protocol) is a powerful process originally designed to simplify web management. Many processes take advantage of SNMP functionality and one of them is HPLIP

If hp-setup doesn't work, then the road may be long. Try using SNMP to determine if the kernel can see the printer at the nework address:
snmpwalk -Os -c public -v 1 ip.address.of.printer 1.3.6.1.4.1.11.2.3.9.1.1.7.0 

Per this site HP tshoot, the response should be something which shows the manufacturer, or SNMP may not be installed correctly. This means working with the /etc/snmp/snmpd.conf file.