Situation snapshot :
- Ubuntu Desktop
- USB label printer
- A custom software written by me in C in order to drive the printer
- An angry colleague
The incident :
the colleague : “What’s happened today, I remember friday I’ve printed some label with it!”
me : “I dont know… may be the printer is faulty… ehm … I’ll check! (Arrgh! I know… was the latest apt-get upgrade)”
him : “Ok… get a move on!”
me : “Yes, you can count on it!”
Some investigations :
My software detects the printer by VID&PID and if it exists,it sends the right commands to /dev/usb/lp0 (but some years have passed from the moment I wrote this sofware and I haven’t remebered immediately all details).
‘Well’, I said to my self, ‘it might be a permissions issue, nothing else!!’, after checking the group membership and tested the software,nothing happened even after launching it directly from the root account.
The clue :
Ok,hit a ‘dmesg’, after unplugging and replugging the USB printer, never hurt.
Well, the last line said : ‘ usb 4-2: new full-speed USB device number 2 using uhci_hcd’ …
What? Nothin else? Whats hapening? the printer is no longer recognized? NO! IT’S IMPOSSIBLE!
I’ve opened one CUPS interface, and I’ve discovered that it recognizes the printer!
In fact the printer is recognized by the system, but the ‘/dev/usb/lp0’ is not created (the acces node I use in order to send commands)
The solution :
Googling around I’ve discovered (almost quickly in fact) that in a recent CUPS upgrade, ‘usblp’ module has sets as blacklisted by a file called ‘blacklist-cups-usblp.conf’ in the modprobe configuration directory (/etc/modprobe.d/).
Well at this point the solution is clearly simple : comment the blacklist directive or delete the file!
I’ve choose the first option and as a magic the labeler has come back to life again… and my colleague has ceased to scold me!