1.03.2009

Installing an HP F4280 on Slackware 12.1

This post and several others have been moved to darksky.info as this blog will soon be well, left alone. Please post any comments and/or violent reactions there. Thank you.

I purchased an HP DeskJet F4280 AIO as a late Christmas present for us, and installed it on my (of course) Slackware system. But before we move forward, lets look at what happened step by step.

I got the HP Deskjet F4280 because of the HPLIP drivers, which would make things easier. On opening the box, it had of course, packaging, marketing materials, one USB cable, one power supply, and one Win/MacOSX driver CD (fairly standard, don't you think?). So there I go, plugging the whole thing into the PC, fire up cups with

sh /etc/rc.d/rc.cups start

and all goes well after powering up (oddly enough, I didn't even think about running the HPLIP tools, oh well).

Now, when I ask cups to "Find New Printers" on the Administration tab, it couldn't see anything. So, I go check dmesg, and find:


$ dmesg

[lots of stuff here]
...
usb 1-2: new full speed USB device using uhci_hcd and address 3
usb 1-2: configuration #1 chosen from 1 choice
usblp0: USB Bidirectional printer dev 6 if 1 alt 0 proto 2 vid 0x03F0 pid 0x2504
...
[more stuff]


Well, there I see that Slackware CAN see the darn thing. From this, I can see that the printer was plugged into bus 1 (if 1) with the device number 6 (dev 6).

Going into /dev, I check for permissions, thinking that the device nodes didn't have r/w permissions, and true enough, ls -al shows


crw-rw---- 1 root root 189, 5 2009-01-03 00:41 usbdev1.6
crw-rw---- 1 root root 250, 4 2009-01-03 00:41 usbdev1.6_ep00
crw-rw---- 1 root root 250, 5 2009-01-03 00:41 usbdev1.6_ep01
crw-rw---- 1 root root 250, 9 2009-01-03 00:41 usbdev1.6_ep06
crw-rw---- 1 root root 250, 7 2009-01-03 00:41 usbdev1.6_ep08
crw-rw---- 1 root root 250, 6 2009-01-03 00:41 usbdev1.6_ep82
crw-rw---- 1 root root 250, 10 2009-01-03 00:41 usbdev1.6_ep87
crw-rw---- 1 root root 250, 8 2009-01-03 00:41 usbdev1.6_ep89


Simple enough, we could chmod 0666 /dev/usbdev1.6* to get r/w permissions (0666 is equivalent to chmod ugo+rw /dev/usbdev1.6*). However, printers by their nature aren't on all the time, and on powering down and powering up, I found that the HP DeskJetF4280 was assigned a different device number. Not to mention that inserting other USB devices (like your handy-dandy flash drive) are going to change things up even more.

So, what to do, what to do...? udev rules of course! First to find some information. Doing an /sbin/lsusb gave me:


Bus 002 Device 001: ID 0000:0000
Bus 001 Device 007: ID 03f0:2504 Hewlett-Packard
Bus 001 Device 001: ID 0000:0000


Kinda thin, dontchathink? But it does give me two things, the USB Vendor ID and product ID. we confirm that with udevinfo -ap /bus/usb/devices/1-2, which gives me:


looking at device '/devices/pci0000:00/0000:00:11.2/usb1/1-2':
KERNEL=="1-2"
SUBSYSTEM=="usb"
DRIVER=="usb"
ATTR{dev}=="189:6"
ATTR{configuration}==""
ATTR{bNumInterfaces}==" 3"
ATTR{bConfigurationValue}=="1"
ATTR{bmAttributes}=="c0"
ATTR{bMaxPower}==" 2mA"
ATTR{urbnum}=="14"
ATTR{idVendor}=="03f0"
ATTR{idProduct}=="2504"
ATTR{bcdDevice}=="0100"
ATTR{bDeviceClass}=="00"
ATTR{bDeviceSubClass}=="00"
ATTR{bDeviceProtocol}=="00"
ATTR{bNumConfigurations}=="1"
ATTR{bMaxPacketSize0}=="64"
ATTR{speed}=="12"
ATTR{busnum}=="1"
ATTR{devnum}=="7"
ATTR{version}==" 2.00"
ATTR{maxchild}=="0"
ATTR{quirks}=="0x0"
ATTR{authorized}=="1"
ATTR{manufacturer}=="HP"
ATTR{product}=="Deskjet F4200 series"
ATTR{serial}=="CN89P3G0TC05BR"

[more irrelevant stuff follows]


Now, wait a minute, how did I know that the proper device is 1-2? And where did /bus/usb/devices come from? Well, udevinfo reads from /sys, and so, you leave that out of your command. As for 1-2, see dmesg above. It says, usb 1-2. Not exactly rocket science, but also not immediately obvious.

Well, this confirms the vendor and product id (see ATTR{idVendor} and ATTR{idProduct}). It also shows us the product serial number (ATTR{serial}=="CN89P3G0TC05BR"). Useful things for manipulating udev with.

So, here we go, heading off to /etc/udev/rules.d, and what do I find? Nothing about printers. I did find a few lines in 50-udev-default.rules something about printers, but nothing that I'd want to toy with... so looking again, I remember that this HP F4280 IS an All-In-One (or Printer-Scanner-Copier, whichever you prefer). And there is that file that's called /etc/udev/rules.d/80-libsane.rules.

HEY!! I thought this was about installing and getting the printer to work!!!

Yes, it is, just bear with me for a few more minutes.

Anyway, checking that rule-file, I find that there is no rule for the HP F4280 in there. So, fire up vim, and add this near the bottom, just before the segment about autosuspend. If you're not sure what I'm talking about, you can add this after the last line that looks most like it.


# HP Deskjet F4280
ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="2504", MODE="0666", GROUP="scanner", ENV{libsane_matched}="yes"


If you're in vim, you'd hit ESC :wq at this point to save and quit.

You will notice that I have MODE="0666" and GROUP="scanner". Why? Well, libsane IS about scanners anyway. But about the MODE="0666"? Well, the HP F4280 again, is an All in One. If I don't change this to rwrwrw (0666) for everyone, then I'll be able to scan, but not print. Why? Because printing is a write function to the printer device.

So, after the rule is written, lets power down and power up the printer again. Lets check /dev as to what I have for my usbdev now.


crw-rw-rw- 1 root scanner 189, 7 2009-01-03 01:14 usbdev1.8
crw-rw---- 1 root root 250, 4 2009-01-03 01:14 usbdev1.8_ep00
crw-rw---- 1 root root 250, 5 2009-01-03 01:14 usbdev1.8_ep01
crw-rw---- 1 root root 250, 9 2009-01-03 01:14 usbdev1.8_ep06
crw-rw---- 1 root root 250, 7 2009-01-03 01:14 usbdev1.8_ep08
crw-rw---- 1 root root 250, 6 2009-01-03 01:14 usbdev1.8_ep82
crw-rw---- 1 root root 250, 10 2009-01-03 01:14 usbdev1.8_ep87
crw-rw---- 1 root root 250, 8 2009-01-03 01:14 usbdev1.8_ep89


Looks like we have read/write capability for this node now! But lets check some more.

ls /dev/bus/usb/001/008 -al

drwxr-xr-x 2 root root 80 2009-01-03 01:14 ./
drwxr-xr-x 4 root root 80 2009-01-03 08:09 ../
crw-r--r-- 1 root root 189, 0 2009-01-03 08:09 001
crw-rw-rw- 1 root scanner 189, 7 2009-01-03 01:14 008

Looking good!

Just one last thing. sane wouldn't be able to see your scanner. Why? It doesn't quite know about it yet. Go into /etc/sane.d and edit the file hp4200.conf. Change the figures after usb to read:

usb 0340:2504

Now drop out of root, and try xsane. If the gui launches, then you're good to go. Just to add the printer.

Fire up your browser, and head of to localhost:631, to access cups. Head to Administration, and click on Find New Printers. After that, just go on clicking on next etc. etc. When you get to the part where it asks for the "Model/Driver for HP_Deskjet_F4200_series_*", look for the HPDeskJetf4200 series driver. Follow till the end, and click "Print Test Page".

Note: If you have a default install of Slackware 12.1, you'll have to upgrade the HPLIP package from the 12.2 series to find the f4200series driver in cups.

There you have it, how to install an HP F4280 on Slackware Linux 12.1. Hope you had fun!

11.17.2008

Wine 1.1.7 and Adobe CS3

Now, this blog has been all but abandoned. My last post was several months ago. The reason for the abandonment? I'm currently rolling my own blog in python and sqlite3. The host is already actually paid for and ready, as well as the domain, but things being hectic as they are, well, things had to slide for a while.

Now, since I studied flash ActionScript3 for a year, I had a dedicated windows drive, and a dedicated linux drive as well. Yes, it used to be FreeBSD, but somehow, I found FreeBSD 7 not me... version 6.x was fine with me, but 7 seemed somehow off.

Anyway, developing on windows, I had dreamweaver on, like any good webdeveloper should. Honestly, Dreamweaver is still one of the best IDE's I've ever seen. When the windows drive finally said buh-buy ... (yes, as in buy another drive), well, it was buhbye DW as well.

Well, I didn't have the cash to spend on another drive yet, and my linux drive was pretty much packed already... plus, I didn't really want to put windows back on :)

Running through some IDE's, like Quanta, Bluefish and Nvu, I found that, after Dreamweaver, well, Dreamweaver spoils all other web development environments. I was itching to get back on dreamweaver.

So in comes wine to the rescue. I had a drive image of a fresh windows install with CS3 already installed there, so copied over the entire adobe directory to my ~/.wine/Program Files directory. I tried DW with wine 1.1.4 first. Yes it worked, but there were screen artifacts. Some parts didn't render, and a feeling of "clunkiness". So, I gave that up for a lost cause.

Now, with a wine upgrade (1.1.7), I tried it again, and voila! the interface all renders properly, most functions seem to be there (haven't dug into it much, since I only tried 5 minutes ago) and responds fairly well. For kicks, I tried to run flash cs3... and voila! same thing! :) how about photoshop? sadly, no go.

Anyway, I'll post more when I put it through the paces, but for now, a screenie... :)



you can view the full size here:

http://img134.imageshack.us/img134/6596/adobewineky0.jpg

7.07.2008

No one is immune...

Seems no one is immune to getting their domains taken away from them... specially considering that the domains for the Internet Corporation for Assigned Names and Numbers (ICANN) and Internet Assigned Numbers Authority (IANA) (icann.org and iana.org repectively) got their domains hijacked... they managed to get them back approximately 20 minutes later though.

6.18.2008

Philippines Open Source Center

Finally an Open Source Agency/Clearing house for the Philippines? I certainly hope so... But of course, that would depend on how Big Blue responds to the petitions for sponsorship on this matter. But hey, we can always hope.

5.25.2008

Since my online life is pretty much tied around google services, I may as well see which ones are useful to me...

Looks like this is something that I can get to use at work, and allow me to post to my blog at the same time.... such a time saver... my blog has been feeling deprived for the longest time already.