How to use a USB printer ?

Hi, everybody

I'd like to print with my USB printer but the handbook only explains how to use a serial or a parallel one.

My printer is a HP PSC 1410. It's recognised in /dev/ as ulpt0. I've activated the usb and ulpt modules in /boot/loader.conf. Here is what /var/run/dmesg.boot has to say about it:

Code:
ulpt0 : <HP PSC 1400 series, class 0/0, rev 2.00/1.00, addr 2> on usbus1
ulpt0 : using bi-directional mode

Of course, none of the tests suggested by the handbook for serial and parallel printers work with mine.

How can I fix this?
 
Just follow the procedures for a parallel printer and use /dev/ulpt0 instead of /dev/lpt0
 
I had tried this with the interrupt-driven method. I just tried it with the polled method. In both cases, I encounter the same problem with lptcontrol, which tells me :

Code:
lptcontrol: ioctl: Operation not supported by device

Of course, I replaced lptN with ulpt0.
 
Same result with ulpt0 and unlpt0.

I tried:

lptcontrol -i -d /dev/ulpt0

and

lptcontrol -i -d /dev/unlpt0

with the line

Code:
hint.ppc.0.irq="7"

uncommented in /boot/device.hints.

Then, I commented this very same line, rebooted and tried:

lptcontrol -p -d /dev/ulpt0

and

[CMD="]"]lptcontrol -p -d /dev/unlpt0[/CMD]

Each time, the output is exactly the same:

Code:
lptcontrol: ioctl: Operation not supported by device

After reading another thread, I added the line :

Code:
/dev/ulpt0 0664

to /etc/devfs.conf and

Code:
lpd_enable="YES"

to /etc/rc.conf.

But that doesn't change anything.
 
BTW, why would you run lptcontrol(8) on the USB printer
After setting up /etc/printcap and restarting lpd(8)the printer should be ready.

See also lpc(8) to check to status of your printer.
 
errandonea said:
I installed hplip and cups

CUPS is an alternative to lpd(8).

then I carefully followed your how-to but when I tried this :

% printf “This is a test\r\n\f” | lpr

the answer was :

Code:
lpr: lp: unknown printer

Yes, because the real lpr(1) is in /usr/bin/, while the CUPS replacement lpr goes in /usr/local/bin.

I replaced ulpt0 with unlpt0 but nothing changed. Is there a way to print with this printer ? Do I have to configure hplip and/or cups ?

I think CUPS is required for HPLIP, and you'll probably have to use the built-in web management to set up the printer. See CUPS on FreeBSD.
 
Hello,

Following wblock's advice, I read the CUPS chapter in the handbook, activated cupsd and used CUPS's web interface (localhost:631).

When I click Add Printer on this web interface, I have to choose the model of my printer in a list. This list features numerous HP printers but neither my HP PSC 1410 nor any 1400 serie.

Alternatively, it's written that I can send a PPD file. What is a PPD file and where can I find the good one ?
 
A PPD for the PSC 1400 series is included with HPLIP, /usr/local/share/ppd/HP/hp-psc_1400_series-hpijs.ppd.gz. Whether CUPS should find that automatically, I don't know.
 
It works ! I gunziped the .ppd.gz file and gave the path and name of the resulted .ppd one on CUPS' web interface. Now, I can print both plain text and PDF files. I think other formats will work as well.

Thanks to everyone.
 
Troubles are back. I've enabled the mounting of USB storage devices. The mounting works fine. But now, I can't print anymore. On the 'Printers' section of its web interface, CUPS complains :

Code:
"impossible to open file /dev/ulpt0 : Permission denied"

Here are my devfs.rules and rc.conf :

devfs.rules :

Code:
[localrules=10]
add path 'unlpt*' mode 0660 group cups
add path 'ulpt*' mode 0660 group cups
add path 'lpt*' mode 0660 group cups
add path 'usb/1.2*' mode 0660 group cups
add path 'da*' mode 0660 group operator

Bottom of rc.conf :

Code:
devfs_system_ruleset="localrules"

lpd_enable="YES"
cupsd_enable="YES"

I tried to return these files to their previous states but didn't succeed. Where did I make a mistake ?
 
errandonea said:
Troubles are back. I've enabled the mounting of USB storage devices. The mounting works fine. But now, I can't print anymore. On the 'Printers' section of its web interface, CUPS complains :

"impossible to open file /dev/ulpt0 : Permission denied"

Here are my devfs.rules and rc.conf :

devfs.rules :

Code:
[localrules=10]
add path 'unlpt*' mode 0660 group cups
add path 'ulpt*' mode 0660 group cups
add path 'lpt*' mode 0660 group cups
add path 'usb/1.2*' mode 0660 group cups
add path 'da*' mode 0660 group operator

USB devices are dynamically numbered. The printer may not always show up as 1.2. Depending on what you feel is permissible, you might want to make that "usb/*".

Bottom of rc.conf :

Code:
devfs_system_ruleset="localrules"

lpd_enable="YES"
cupsd_enable="YES"

CUPS doesn't need lpd.
 
I tried usb/*. It doesn't change anything. No matter lpd is enabled or not. CUPS still complains he can't access ulpt0. I don't understand why I can't print anymore.
 
What are the permissions on ulpt0?
% ls -l /dev/ulpt0

As root, you can change permissions, owner, and group on ulpt0. If that works, then it's a devfs or devfs.rules problem.
 
I tried everything about ulpt0, even this :

Code:
# ls -l ulpt0
crwxrwxrwx  1 cups  cups    0, 103 18 avr 15:23 ulpt0

CUPS still pretends he can't access /dev/ulpt0. I restarted it but nothing changed. It's clearly a cups problem but which one?
 
I continued giving more and more right to cups. I made him a member of groups operator, wheel and, of course, cups.

No more success...
 
Back
Top