P910nd was broken in the new version of openwrt 23.05

Hello! Sorry for my English..
I actively used p910nd in older versions on OpenVRT (OpenVRT 18) for 2-3 printers. I wrote a small script to specifically bind printers to ports. But there was a need to switch to a new version of openwrt (23.05), everything was ok, except p910nd, I was horrified to discover an additional script in the hotplug that breaks the operation of the printers. One printer works, but when connecting the second, both do not work. Please help me, I tried all the settings - no effect..
And please tell me where I should write a request so that I can disable this script?

no errors, nothing, just "it doesn't work" ?

is P910nd: print daemon usb hotplug update perhaps related ?

This is known. There is a fix waiting to go in to 23 for this.

In the meantime, you can replace the script

1 Like

If this does not fix your "problem" then you're welcome to diagnose and provide more information.

Ooh, thank you! I'll try this

Unfortunately, the new script did not fix the problem. 2 or more printers are still not working.
Example configuration file:

config p910nd
option device '/dev/usb/lp0'
option port '0'
option bidirectional '1'
option enabled '1'

config p910nd
option enabled '1'
option device '/dev/usb/lp1'
option port '1'
option bidirectional '1'

Example of a configuration file after running the hotplug script (20-p910nd):

config p910nd
option device '/dev/usb/lp0'
option port '0'
option bidirectional '1'
option enabled '1'
option usbvidpid '0483/5743'
option mdns_mfg 'Xprinter'
option mdns_note 'Located near router'
option mdns_sn 'Гї'
option mdns_cmd 'TSPL2'
option mdns '1'
option mdns_mdl 'XP-T202UA'
option driver_file '/opt/p910nd_drivers/Xprinter_XP-T202UA_0483_5743.bin'
option mdns_cls 'PRINTER'

config p910nd
option enabled '1'
option device '/dev/usb/lp1'
option port '1'
option bidirectional '1'
option usbvidpid '0a5f/0006'
option mdns_mfg 'UPS'
option mdns_note 'Located near router'
option mdns_sn '64A074800711'
option mdns_cmd 'None'
option mdns '1'
option mdns_mdl 'Thermal 2844 '
option driver_file '/opt/p910nd_drivers/UPS__Thermal_2844__0a5f_0006.bin'

config hotplug
option driver_home '/opt/p910nd_drivers'

This does not work before the device is rebooted or after the reboot. If you configure one printer, everything works.

Tell me what other information is needed - I’ll do it

Please tell me if it is possible to completely disable this script or changes, as it was in the old version?
What does this script do, I can’t understand what problem it solves?

Thank you!

In the old version, I used my own hotplug little script so that a printer connected to a specific USB port would always be mapped to a specific TCP port (eg 9103 - USB3). The USB port number in the output does not change. The script creates links to lp* files with USB* names * - port numbers. In the p910nd configuration, it is enough to specify the path to this link, for example /tmp/usb3.

Here's an example script if it's useful:

/etc/hotplug.d/usb/02-usb-lp_Print_server

DEVICE=$(find /sys$DEVPATH | grep lp[0123]$)

 if [ "${ACTION}" != "remove" ];
  
   then if [ -z ${DEVICE} ];
         then
         exit
        fi
           LP=$(find /sys$DEVPATH | grep -io lp[01234567]$)
           USB_NAME=$(find /sys$DEVPATH | grep lp[0123]$ | grep -io usb[123456789])
        
           if test -h "/tmp/$USB_NAME"
            then
              rm /tmp/$USB_NAME
            fi
         ln -s /dev/usb/$LP /tmp/$USB_NAME

 fi

 if [ "${ACTION}" = "remove" ];
  
   then
     USB_NAME=$(echo $DEVPATH | grep -io usb[123456789])
 
     if test -h "/tmp/$USB_NAME"
         then
         rm /tmp/$USB_NAME
     fi
        fi

and an example p910nd configuration file:

config p910nd
	option device '/dev/usb/lp0'
	option port '0'
	option bidirectional '1'
	option enabled '1'

config p910nd
	option enabled '1'
	option device '/tmp/usb3'
	option port '3'
	option bidirectional '1'

config p910nd
	option enabled '1'
	option device '/tmp/usb4'
	option port '4'
	option bidirectional '1'

config p910nd
	option enabled '1'
	option device '/tmp/usb5'
	option port '5'
	option bidirectional '1'

config p910nd
	option enabled '1'
	option device '/tmp/usb6'
	option port '6'
	option bidirectional '1'

config p910nd
	option enabled '1'
	option device '/tmp/usb7'
	option port '7'
	option bidirectional '1'

config p910nd
	option enabled '1'
	option device '/tmp/usb8'
	option port '8'
	option bidirectional '1'

Everything worked perfectly. And if there is any possibility to return to the previous settings on a new version of openwrt, that would be great. I will be very grateful for your help!

I think so. Yes, the latest update is installed.
Please tell me where to write this bug information?

Unfortunately, the new script did not fix the problem. If you can, please help me with this

Hi Oleh

As I understand (thanks for the scripts and config - they help), you run a usb hotplug script. p910nd runs a usbmisc hotplug script. First, usb runs. Then, usbmisc (it's at a higher layer than usb, I think).

Can you disable your script? usbmisc internally takes care of mounting the usb devices.

Unplug your printer, disable your script (chmod -x /etc/hotplug.d/usb/02-usb-lp_Print_server), replug (a now non-working) printer then run:

ls -l /dev/usb
# then
find /sys/ | grep lp[0-9]
# then
find /sys/ | grep lp[0-9] | grep -io usb[123456789]

In principle there is no difference between the old and new configs. The new one is augmented with more info for those devices where a blob might need to be loaded.

If you only want to do this, then simply chmod -x the usbmisc hotplug script. It'd be nice to understand what your script tries to do to understand where they're colliding.

usbmisc hotplug script does not create or mount any lp devices or paths. They're done before the script runs.

Question: do any of your printers need a blob (driver) loading to themselves before running?

Hello! Thank you very much for your answer!
Everything I described above was without using my script. Before adding my script, I simply check the operation of the printers - it doesn’t work.
No, these printers do not need any blob (driver) download before starting. In the old version they work without any problems without any drivers. In the new version, too, when the printer is connected alone

These scripts do not conflict, if I add my own script - it works fine and does not affect the operation of the printers in any way. Everything is the same, one printer works alone, two do not work.

If I disable this script (chmod -x the usbmisc) then the printers do not working even when it is alone

Hi Oleh. OK, take a look at the init script. I suspect this line:

	if [ "$enabled" -gt 0 ] && [ -e "$device" ]; then

It checks whether the destination device exists. If not, that code block (procd stuff) does not run. The idea being that, no target USB LP device, don't run the daemon (which would cause errors).

But init and restart run after the scripts...? You could test this change:

	if [ "$enabled" -gt 0 ]; then

I will return to this later...

ok please give me 15 minutes..

Unfortunately, it did not produce any results. The result is the same. One works, two don't work (