P910nd doesn't print (owrt 22.03 + doesn't print)

Hi All! I installed p910nd, kmod-usb2, kmod-usb-core kmod-usb-printer, but the printers do not print. On owrt 17 everything worked.

My configs:
/etc/config/p910nd

config p910nd
	option runas_root '0'
	option mdns '0'
	option mdns_ty 'HP Deskget GT 5810'
	option mdns_note 'Color Print'
	option enabled '1'
	option device '/dev/descjet5800'
	option port '1'
	option bidirectional '1'

config p910nd
	option enabled '1'
	option device '/dev/scx4200'
	option port '2'
	option bidirectional '1'

firewall rule:

config rule
	option name 'Allow_p910'
	option target 'ACCEPT'
	option src '*'
	option dest_port '9100-9102'
	list proto 'tcp'

/etc/hotplug.d/usb/samsungScx4200

DEV_PRODUCT="4e8/341b/100"
SYMLINK="scx4200"

if [ "${PRODUCT}" = "${DEV_PRODUCT}" ];
then
   if [ "${ACTION}" = "add" ];
   then
      DEVICE_NAME=$(ls /sys$DEVPATH/usbmisc | grep lp)
      if [ -z ${DEVICE_NAME} ];
      then
         exit
      fi
      logger -t hotplug Device name of SAMSUNG SCX 4200 is $DEVICE_NAME
      ln -s /dev/usb/$DEVICE_NAME /dev/${SYMLINK}
      logger -t hotplug Symlink from /dev/usb/$DEVICE_NAME to /dev/${SYMLINK} created
   fi

   if [ "${ACTION}" = "remove" ];
   then
      if [ -L /dev/${SYMLINK} ];
      then
         rm /dev/${SYMLINK}
         logger -t hotplug Symlink /dev/${SYMLINK} removed
      fi
   fi
fi

/etc/hotplug.d/usb/hpDeskjet5800

DEV_PRODUCT="3f0/ed11/100"
SYMLINK="descjet5800"

if [ "${PRODUCT}" = "${DEV_PRODUCT}" ];
then
   if [ "${ACTION}" = "add" ];
   then
      DEVICE_NAME=$(ls /sys$DEVPATH/usbmisc | grep lp)
      if [ -z ${DEVICE_NAME} ];
      then
         exit
      fi
      logger -t hotplug Device name of HP DESKJET 5800 is $DEVICE_NAME
      ln -s /dev/usb/$DEVICE_NAME /dev/${SYMLINK}
      logger -t hotplug Symlink from /dev/usb/$DEVICE_NAME to /dev/${SYMLINK} created
   fi

   if [ "${ACTION}" = "remove" ];
   then
      if [ -L /dev/${SYMLINK} ];
      then
         rm /dev/${SYMLINK}
         logger -t hotplug Symlink /dev/${SYMLINK} removed
      fi
   fi
fi

/etc/hotplug.d/usb/20-saned - auto

Windows firewall is turned off. If I send .prn to the device from the router (for e.x.: cat scx.prn > /dev/scx4200), printing works. Doesn't work from the computer anymore.

netstat -an (192.168.2.1 - ROUTER IP):

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:9101            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:9102            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN
tcp        0      0 192.168.1.143:53        0.0.0.0:*               LISTEN
tcp        0      0 192.168.2.1:53          0.0.0.0:*               LISTEN
tcp        0      0 192.168.2.1:22          0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN
tcp        0      0 192.168.2.1:22          192.168.2.8:63411       ESTABLISHED
tcp    96540      0 192.168.2.1:9102        192.168.2.8:63452       ESTABLISHED

If you plug in the LAN interface, it doesn't work either. Any ideas?

Is this path still correct in 22.03?
Should be due to the soft link, but check anyway.

/dev# ls
bus          mtd1ro       mtdblock1    random       ttyS11       ttyS7
console      mtd2         mtdblock2    scx4200      ttyS12       ttyS8
descjet5800  mtd2ro       mtdblock3    shm          ttyS13       ttyS9
full         mtd3         mtdblock4    stderr       ttyS14       urandom
hwrng        mtd3ro       mtdblock5    stdin        ttyS15       usb
kmsg         mtd4         null         stdout       ttyS2        watchdog
log          mtd4ro       port         tty          ttyS3        zero
mtd0         mtd5         ppp          ttyS0        ttyS4
mtd0ro       mtd5ro       ptmx         ttyS1        ttyS5
mtd1         mtdblock0    pts          ttyS10       ttyS6

lsusb
Bus 001 Device 008: ID 03f0:ed11 HP DeskJet 5810 series
Bus 001 Device 009: ID 04e8:341b Samsung SCX-4200 Series
Bus 001 Device 005: ID 05e3:0608  USB2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux 5.10.201 ehci_hcd EHCI Host Controller

In my limited experience with this daemon, various printers required some binary blob sending to it ( its 'driver' if you will ) before anything would work. Similar to your cat command above. Next is to add the printer as an IPP ( I think ) printer, with openwrt IP.

I run 23.05.2 and followed step by step the guides to advertise the printer with Zeroconf and to configure Windows and Linux clients and everything works... did you install luci-app-p910nd?

My printer is connected with USB and this is my /etc/config/firewall:

config rule
	option name 'Allow HP-DJ3050'
	option family 'ipv4'
	list proto 'tcp'
	option src 'lan'
	option dest_port '9100'
	option target 'ACCEPT'

Printers have already been added to Windows. I just moved owrt 17.h to 22.03 and got such a strange problem(

Yes)

I tried your rule, it had no effect.
In theory, traffic from the lan to the device does not need to be allowed at all, because it is initially open. I did not create such rules in owrt 17.

Still, I wonder why scanning works but printing doesn't. It is not clear how to diagnose this.

For the test, I created the /dev/test file and specified it as a printer. I tried different options by submitting the task and checking the contents of the file. The file was empty and filled up only when the runas_root option is '1'.

It turns out that the daemon did not have write rights to the device.
There was no such thing in owrt 17. In any case, printing is now working.

Solution: option runas_root '1'

Nice work.

This could also be an ujail issue, it wasn't around in 17.

there was a change in the default device for p910nd sometme over the last few major releases. i recall having had to reconfigure my daemon to use /dev/ubb/lp0 when upgrading.
my device permissions are:

root@ap12:~# ls -l /dev/usb
crw-rw----    1 root     lp        180,   0 Dec 30 12:16 lp0

Yeah, thats why I asked about the path in my 1st reply, but the hotplug script @ghoffman posted seems to create a soft link between the device in /dev/usb and /dev.

The permissions or group could another be another issue, since root seems to be working.

Yeah, it would be difficult without creating soft links, since there are several printers and it is not known in what order they will be included. This will make it impossible to print if the devices are under the wrong ports :slightly_smiling_face:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.