OpenWrt Forum Archive

Topic: Which (small) printserver for TL-WR1043ND + Lexmark E322 (postscript)

The content of this topic has been archived on 27 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

TP-Link TL-WR1043ND
Backfire (10.03.1, r29592)

I am looking for a printserver with an old postscript-printer (Lexmark E322) and found http://wiki.openwrt.org/doc/howto/printer.overview

p910nd says at http://wiki.openwrt.org/doc/howto/p910nd.server usb.essentials is needed and cups - http://wiki.openwrt.org/doc/howto/cups.server needs usb.essentials too. But http://wiki.openwrt.org/doc/howto/usb.essentials says: "Most images offered on the OpenWrt download page, come with the basic USB support already included, if yours doesn't, you are right here."

An external-USB-drive is recognized, so do I need to install usb.essentials and which printer-server to you recommend?

I want to print from Clients with Linux 32 and 64 bit (Ubuntu 12.04, Opensuse 12.2), XP Home 32bit, Win7 Prof. 64bit.

Below you find some info re installed packages and available space.

root@wr1043-openwrt-ap-wds:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 1.9M      1.9M         0 100% /rom
tmpfs                    14.4M     56.0K     14.3M   0% /tmp
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock3            4.7M      2.4M      2.3M  51% /overlay
mini_fo:/overlay          1.9M      1.9M         0 100% /

opkg list-installed
base-files - 43.32-r29592
block-hotplug - 0.1.0-2.2
block-mount - 0.1.0-2.2
busybox - 1.15.3-3.4
crda - 1.1.1-1
dnsmasq - 2.55-6.1
dropbear - 0.53.1-5
firewall - 2-34.8
hotplug2 - 1.0-beta-3
iptables - 1.4.6-3.1
iptables-mod-conntrack - 1.4.6-3.1
iptables-mod-nat - 1.4.6-3.1
iw - 0.9.22-2
kernel - 2.6.32.27-1
kmod-ath - 2.6.32.27+2011-11-15-1
kmod-ath9k - 2.6.32.27+2011-11-15-1
kmod-ath9k-common - 2.6.32.27+2011-11-15-1
kmod-button-hotplug - 2.6.32.27-1
kmod-cfg80211 - 2.6.32.27+2011-11-15-1
kmod-crc-ccitt - 2.6.32.27-1
kmod-crc16 - 2.6.32.27-1
kmod-crypto-aes - 2.6.32.27-1
kmod-crypto-arc4 - 2.6.32.27-1
kmod-crypto-core - 2.6.32.27-1
kmod-fs-exportfs - 2.6.32.27-1
kmod-fs-ext2 - 2.6.32.27-1
kmod-fs-ext4 - 2.6.32.27-1
kmod-fs-mbcache - 2.6.32.27-1
kmod-fs-vfat - 2.6.32.27-1
kmod-fs-xfs - 2.6.32.27-1
kmod-input-core - 2.6.32.27-1
kmod-input-gpio-buttons - 2.6.32.27-1
kmod-input-polldev - 2.6.32.27-1
kmod-ipt-conntrack - 2.6.32.27-1
kmod-ipt-core - 2.6.32.27-1
kmod-ipt-nat - 2.6.32.27-1
kmod-ipt-nathelper - 2.6.32.27-1
kmod-leds-gpio - 2.6.32.27-1
kmod-mac80211 - 2.6.32.27+2011-11-15-1
kmod-nls-base - 2.6.32.27-1
kmod-nls-cp437 - 2.6.32.27-1
kmod-nls-iso8859-1 - 2.6.32.27-1
kmod-nls-utf8 - 2.6.32.27-1
kmod-ppp - 2.6.32.27-1
kmod-pppoe - 2.6.32.27-1
kmod-scsi-core - 2.6.32.27-1
kmod-usb-core - 2.6.32.27-1
kmod-usb-ohci - 2.6.32.27-1
kmod-usb-storage - 2.6.32.27-1
kmod-usb2 - 2.6.32.27-1
libc - 0.9.30.1-43.32
libgcc - 4.3.3+cs-43.32
libip4tc - 1.4.6-3.1
libiwinfo - 18
libiwinfo-lua - 18
liblua - 5.1.4-7
libnl - 1.1-4
libnl-tiny - 0.1-1
libpcap - 1.0.0-2
libpopt - 1.7-5
libstdcpp - 4.3.3+cs-43.32
libuci - 12012009.7-4
libuci-lua - 12012009.7-4
libxtables - 1.4.6-3.1
lua - 5.1.4-7
luci - 0.10.0-1
luci-app-firewall - 0.10.0-1
luci-i18n-english - 0.10.0-1
luci-lib-core - 0.10.0-1
luci-lib-ipkg - 0.10.0-1
luci-lib-lmo - 0.10.0-1
luci-lib-nixio - 0.10.0-1
luci-lib-sys - 0.10.0-1
luci-lib-web - 0.10.0-1
luci-mod-admin-core - 0.10.0-1
luci-mod-admin-full - 0.10.0-1
luci-proto-core - 0.10.0-1
luci-proto-ppp - 0.10.0-1
luci-sgi-cgi - 0.10.0-1
luci-theme-base - 0.10.0-1
luci-theme-openwrt - 0.10.0-1
mtd - 13
opkg - 576-2
ppp - 2.4.4-16.1
ppp-mod-pppoe - 2.4.4-16.1
rsync - 3.0.8-3
swconfig - 9
uci - 12012009.7-4
udevtrigger - 106-1
uhttpd - 28
wireless-tools - 29-4
wpad-mini - 20111103-2

(Last edited by linuxuser on 4 May 2013, 17:53)

There is no way you are going to install cups on the internal memory of your router, simply not enough space.

You can put the overlayfs on a usb stick and have more space that way (see pivot root in the wiki).
So I would try p910nd in this case, also windows and linux can print directly to it. (for linux you do need cups, but you needed that anyway to connect a network printer)

Thanks, so I have to try http://wiki.openwrt.org/doc/howto/p910nd.server

I did _not_ install usb.essentials!
But kmod-usb-printer and p910nd

usb 1-1: new full speed USB device using ar71xx-ehci and address 2
usb 1-1: configuration #1 chosen from 1 choice
usblp0: USB Bidirectional printer dev 2 if 0 alt 0 proto 2 vid 0x043D pid 0x0052

cat /etc/config/p910nd
config p910nd
    option device        /dev/lp0
    option port          0
    option bidirectional 1
    option enabled       0

How can I search for the printer (Lexmark E322), which is connected to the openwrt-device in a shell or whatever?

I am not sure, what I need else and what not, as described at http://wiki.openwrt.org/doc/howto/p910nd.server

How can I do a test using Linux?

(Last edited by linuxuser on 4 May 2013, 17:54)

/dev/lp0 is your printer. You need to point your printer setup to the router's IP and find out which protocol to use (it's often RAW I believe). Been a while since I set up a networked printer. You'll still need to install the drivers (usually not necessary on Linux, but you will need to on Windows). Usually it involves installing the printer locally first.

Well for starters I think option enabled should be 1
option port is new to me, but since there is only one printer connected I would go with 9100 (default tcp port)

you don't have to do anything with /dev/lp0 on a client you are connecting to the printer, of course it should be a valid printer on the server. But it is working because the log that contains it was allready posted.

To install the printer in windows, you need to select local printer and create a new port and select tcp/ip and the protocol is indeed RAW.

And in linux you just simply can install it under cups.

tutorial for linux: http://www.noah.org/wiki/Printing_CUPS_lpr

Of course in both cases you do need the driver that is needed for the printer. the server p910nd will simply forward the data from the network port to the printer and vice versa, nothing more.

for cups you need: socket://hostname:port

(Last edited by FriedZombie on 4 May 2013, 19:48)

Let's talk about Linux first, Windows is not so important. I mentioned it, because I thought it could be interesting to choose the privterserver. "option enabled       1" was set and the TL-WR1043ND was rebooted.

I have to say, that I could already print with the linux pc, when the printer was connected to an avm fritzbox via usb. To get it work with avm I had to execute "lpadmin -p E322 -E -v socket://192.168.178.1:9100 -m foomatic-db-compressed-ppds:0/Lexmark-Optra_E312-Postscript.ppd" I used E312 because there is no driver for E322 and it works.

#on the linux pc

# whoami
root

# lpadmin -p E322TP -E -v socket://192.168.178.50:9100 -m foomatic-db-compressed-ppds:0/Lexmark-Optra_E312-Postscript.ppd
lpadmin: Unable to copy PPD file.
lpinfo -m | grep -i Lexmark-Optra_E3
foomatic-db-compressed-ppds:0/ppd/foomatic-ppd/Lexmark-Optra_E310-Postscript.ppd Lexmark Optra E310 Foomatic/Postscript (recommended)

foomatic-db-compressed-ppds:0/ppd/foomatic-ppd/Lexmark-Optra_E312-Postscript.ppd Lexmark Optra E312 Foomatic/Postscript (recommended)

gutenprint.5.2://lexmark-optra_e321/expert Lexmark Optra E321 - CUPS+Gutenprint v5.2.8-pre1
foomatic-db-compressed-ppds:0/ppd/foomatic-ppd/Lexmark-Optra_E321-hpijs-pcl5e.ppd Lexmark Optra E321 Foomatic/hpijs-pcl5e (recommended)
foomatic-db-compressed-ppds:0/ppd/foomatic-ppd/Lexmark-Optra_E321-lj4dith.ppd Lexmark Optra E321 Foomatic/lj4dith
foomatic-db-compressed-ppds:0/ppd/foomatic-ppd/Lexmark-Optra_E321-ljet4.ppd Lexmark Optra E321 Foomatic/ljet4
gutenprint.5.2://lexmark-optra_e323/expert Lexmark Optra E323 - CUPS+Gutenprint v5.2.8-pre1

A firewall problem?

It looks like port 9100 is not open, although I added the rule from http://wiki.openwrt.org/doc/howto/p910nd.server

Nmap scan report for wr1043-openwrt-ap.wds (192.168.178.50)
Host is up (0.00019s latency).
PORT     STATE  SERVICE
9100/tcp closed jetdirect
/etc/config/firewall

config defaults
    option syn_flood    1
    option input        ACCEPT
    option output        ACCEPT 
    option forward        REJECT
config zone
    option name        lan
    option network        'lan'
    option input        ACCEPT 
    option output        ACCEPT 
    option forward        REJECT
config zone
    option name        wan
    option network        'wan'
    option input        REJECT
    option output        ACCEPT 
    option forward        REJECT
    option masq        1 
    option mtu_fix        1
config forwarding 
    option src          lan
    option dest         wan
config rule
    option name        Allow-DHCP-Renew
    option src        wan
    option proto        udp
    option dest_port    68
    option target        ACCEPT
    option family        ipv4
config rule
    option name        Allow-Ping
    option src        wan
    option proto        icmp
    option icmp_type    echo-request
    option family        ipv4
    option target        ACCEPT
config rule
    option name        Allow-DHCPv6
    option src        wan
    option proto        udp
    option src_ip        fe80::/10
    option src_port        547
    option dest_ip        fe80::/10
    option dest_port    546
    option family        ipv6
    option target        ACCEPT
config rule
    option name        Allow-ICMPv6-Input
    option src        wan
    option proto    icmp
    list icmp_type        echo-request
    list icmp_type        destination-unreachable
    list icmp_type        packet-too-big
    list icmp_type        time-exceeded
    list icmp_type        bad-header
    list icmp_type        unknown-header-type
    list icmp_type        router-solicitation
    list icmp_type        neighbour-solicitation
    option limit        1000/sec
    option family        ipv6
    option target        ACCEPT
config rule                                   
    option name        Allow-ICMPv6-Forward
    option src        wan
    option dest        *
    option proto        icmp
    list icmp_type        echo-request
    list icmp_type        destination-unreachable
    list icmp_type        packet-too-big
    list icmp_type        time-exceeded
    list icmp_type        bad-header
    list icmp_type        unknown-header-type
    option limit        1000/sec
    option family        ipv6
    option target        ACCEPT
config include
    option path /etc/firewall.user
config 'rule'
        option 'src' 'lan'
        option 'proto' 'tcp'
        option 'dest_port' '9100'
        option 'target' 'ACCEPT'

(Last edited by linuxuser on 4 May 2013, 21:26)

By default the router doesn't block anything lan side. (also not in your case).

is the daemon p910nd actually started?
have you changed the port and enabled in the config?
on the router you can see the listening tcp ports with netstat -tnl
add a p as well to see what programs acompany the ports

(protocol is the same as the fritzbox)

I found 2 things: the daemon was not started and when I start it manually I see another port.

netstat -tnl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:9109            0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      
netstat: /proc/net/tcp6: No such file or directory

I started it with "/etc/init.d/p910nd restart". How do I start the server automatically after a reboot?

Why do I get port 9109 instead of 9100?

 cat /etc/config/p910nd
config p910nd
    option device        /dev/lp0
    option port          9100
    option bidirectional 1
    option enabled       1

to start the server automatically after a reboot type
/etc/init.d/p910nd enable

why it does start on 9109 not a clue, what happens if you drop 'option port' all together from the config?
because mine doesn't seem to need it. (after looking at my config) but the rest is identical.

edit: Lol, I think I know where the 9 came from, try to change the port number to 0 again, and see what happens (or drop the whole line)

(Last edited by FriedZombie on 5 May 2013, 22:31)

root@wr1043-openwrt-ap-wds:~# cat /etc/config/p910nd
config p910nd
    option device        /dev/lp0
    option port          0
    option bidirectional 1
    option enabled       1
root@wr1043-openwrt-ap-wds:~# netstat -tnl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       
tcp        0      0 0.0.0.0:9100            0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN
 cat /etc/issue
Ubuntu 12.04.2 LTS \n \l

root@linuxpc:~# lpadmin -p E322TP -E -v socket://192.168.178.50:9100 -m foomatic-db-compressed-ppds:0/Lexmark-Optra_E312-Postscript.ppd
lpadmin: Unable to copy PPD file.

Any ideas?

(Last edited by linuxuser on 5 May 2013, 20:05)

Well, I don't think the problem is at the router at this point. Because it is a rather simplistic server. It just forwards data.
(other then a cups server, that can do some more interesting things).

what does the cups error log (on the client computer) tell you? it could yield some more info.

(Last edited by FriedZombie on 5 May 2013, 22:35)

If I open a text-editor an the pc (client) I see a printer named "E322TP" (see error above!) and if I click on print, it prints garbage.

cat /var/log/cups/error_log
...
E [04/May/2013:20:42:03 +0200] Unknown directive SystemGroup on line 16 of /etc/cups/cupsd.conf.
E [04/May/2013:22:05:55 +0200] copy_model: empty PPD file
E [04/May/2013:22:05:55 +0200] Returning IPP server-error-internal-error for CUPS-Add-Modify-Printer (ipp://localhost:631/printers/E322TP) from localhost
E [04/May/2013:23:30:45 +0200] Unknown directive SystemGroup on line 16 of /etc/cups/cupsd.conf.
E [04/May/2013:23:34:31 +0200] Unknown directive SystemGroup on line 16 of /etc/cups/cupsd.conf.
E [04/May/2013:23:47:39 +0200] Unknown directive SystemGroup on line 16 of /etc/cups/cupsd.conf.
E [05/May/2013:01:41:22 +0200] Unknown directive SystemGroup on line 16 of /etc/cups/cupsd.conf.
E [05/May/2013:01:46:53 +0200] Unknown directive SystemGroup on line 16 of /etc/cups/cupsd.conf.
E [05/May/2013:01:54:41 +0200] Unknown directive SystemGroup on line 16 of /etc/cups/cupsd.conf.
E [05/May/2013:12:43:51 +0200] Unknown directive SystemGroup on line 16 of /etc/cups/cupsd.conf.
E [05/May/2013:19:48:55 +0200] Unknown directive SystemGroup on line 16 of /etc/cups/cupsd.conf.
E [05/May/2013:20:59:08 +0200] copy_model: empty PPD file
E [05/May/2013:20:59:08 +0200] Returning IPP server-error-internal-error for CUPS-Add-Modify-Printer (ipp://localhost:631/printers/E322TP) from localhost

(Last edited by linuxuser on 5 May 2013, 22:52)

Well I think the printer will work flawlessly on your windows computer.

At least remove line 16 of your /etc/cups/cupsd.conf
it doesn't work there anymore after a security update, systemgroup is migrated to cups-files.conf
(other then making a mess of the logs not the issue).

For the other issue try removing the printer and readd it.
Not sure if it makes a difference in this case

lpadmin -x E322TP && lpadmin -p E322TP -E -v socket://192.168.178.50:9100 -m foomatic-db-compressed-ppds:0/Lexmark-Optra_E312-Postscript.ppd

It could be the result of that the printer took longer then 30 secconds to install. (see a bug report somewhere on cups) Had the issue somehwere in the past as well.

edit: the driver shouldn't be the issue in this case.
If all else fails, you could still and try if your windows computer works better.
see http://dougmunsinger.com/posts/adding-h … ws-xp.html
(jetdirect is the raw protocol, and if no port is specified it defaults to 9100)

edit2: or try to set it up on your other linux computer, same way

(Last edited by FriedZombie on 5 May 2013, 23:35)

I will give you feedback after I could test it, at the moment I have access to only 1 linux pc. Thanks for you suggestions.

(Last edited by linuxuser on 5 May 2013, 23:55)

The path changed, a folder ppd was put in between. Now it works with Linux. lpinfo -m shows the correct path already ;-), but I used a path, which I found in a forum and worked a long time ago.

#doesn't work
lpadmin -p E322TP -E     -v socket://192.168.178.50:9100 -m foomatic-db-compressed-ppds:0/Lexmark-Optra_E312-Postscript.ppd

#works:
lpadmin -p E312-PS -E    -v socket://192.168.178.50:9100 -m foomatic-db-compressed-ppds:0/ppd/foomatic-ppd/Lexmark-Optr312-Postscript.ppd
lpadmin -p E321-ljet4 -E -v socket://192.168.178.50:9100 -m foomatic-db-compressed-ppds:0/ppd/foomatic-ppd/Lexmark-Optra_E321-ljet4.ppd

I tried a text-only page and this is ok. Don't know, when I can test windows. Thanks for your help!

If your printer is supported by Google Cloud Print I'd use that :-)

Glad you got it to work, but if it works from linux it does work from windows as well because they use the same protocol to transfer the data.

Also stupid I missed that slight path change as well wink

The discussion might have continued from here.