SOLUTION: HOWTO run problematic LaserJet printers on DSxxx

Got questions on using your printer with our server? Post it here.
Forum rules
Synology Community is the new platform for the enthusiasts' interaction, and it will soon be available to replace the Forum.
User avatar
BakedPizza
Apprentice
Apprentice
Posts: 94
Joined: Sun Dec 09, 2012 12:19 am
Location: localhost

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by BakedPizza » Fri Nov 21, 2014 9:58 am

@gavinjb
Could only find one post on a Polish forum stating that DSM 5.1 now uses /lib/udev/. There seem to be device rules in /lib/udev/rules.d/:

Code: Select all

drwxr-xr-x    2 root     root          4096 Nov  7 15:32 .
drwxr-xr-x    6 root     root          4096 Nov  7 15:32 ..
-rw-r--r--    1 root     root            62 Nov  7 15:32 05-system-default.rules
-rw-r--r--    1 root     root           335 Nov  6 09:42 05-system-env.rules
-rw-r--r--    1 root     root           335 Nov  6 09:42 40-check-rdx.rules
-rw-r--r--    1 root     root           346 Nov  6 09:42 40-usb-env.rules
-rw-r--r--    1 root     root           614 Nov  6 09:42 50-disk.rules
-rwxr-xr-x    1 root     root           243 Nov  6 09:42 50-firmware.rules
-rwxr-xr-x    1 root     root           272 Nov  6 09:42 50-hiddev.rules
-rwxr-xr-x    1 root     root           315 Nov  6 09:42 50-iscsi.rules
-rw-r--r--    1 root     root           135 Nov  6 09:42 50-net.rules
-rw-r--r--    1 root     root           357 Nov  6 09:42 50-printer-bus.rules
-rw-r--r--    1 root     root          1377 Nov  6 09:42 50-printers.rules
-rwxr-xr-x    1 root     root           373 Nov  6 09:42 50-scsi.rules
-rw-r--r--    1 root     root           327 Nov  6 09:42 50-scsi_host.rules
-rw-r--r--    1 root     root           242 Nov  6 09:40 50-tty.rules
-rwxr-xr-x    1 root     root           932 Nov  6 09:43 50-ups.rules
-rw-r--r--    1 root     root           447 Nov  6 09:40 50-usb-bluetooth.rules
-rwxr-xr-x    1 root     root           526 Nov  6 09:42 50-usb-dvb.rules
-rw-r--r--    1 root     root           371 Nov  6 09:40 50-usb-modem.rules
-rw-r--r--    1 root     root           397 Nov  6 09:40 50-usb-wifi.rules
-rwxr-xr-x    1 root     root           484 Nov  6 09:42 50-usb.rules
But I'm not sure what this means for us.
My DSM 6.0-6.1 VPN check-reconnect script can be found here: https://github.com/DcR-NL/synology-vpn-reconnect
[DS713+ & DX213 w/ 3x3.0TB (SHR) & 1.5TB & 4GB DDR3-1333 (most recent stable DSM)]

gavinjb
Trainee
Trainee
Posts: 16
Joined: Sat Sep 13, 2014 3:47 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by gavinjb » Tue Nov 25, 2014 9:54 pm

Thanks for the reply, I was going to for the short term solution of manually using cat to copy the file to the printer, but I have noticed that /dev/usb no longer exists as well.

I have used udev in the past in Linux to mount HD's to particular mount points, but how to connect to a printer and copy the .dl file to the printer (particularly without /dev/usb/lp?)is beyond my knowledge, so any ideas form anyone would be great :)
DS218+ (6GB RAM, 2 x 4TB SHR), Firmware: Latest Stable Release, Backup: 2 x 4TB Ext Disks (on weekly rotation)

berbere
Trainee
Trainee
Posts: 19
Joined: Thu Sep 23, 2010 3:48 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by berbere » Wed Nov 26, 2014 12:03 pm

@gavinjb,

I didn't upgrade to DSM 5.1 (my Synology is a DS-210j :) ) but if you can send me the files listed below, I can try to find the right spot to insert the code. I make no promises of success though.
BakedPizza wrote:@gavinjb
Could only find one post on a Polish forum stating that DSM 5.1 now uses /lib/udev/. There seem to be device rules in /lib/udev/rules.d/:

Code: Select all

drwxr-xr-x    2 root     root          4096 Nov  7 15:32 .
drwxr-xr-x    6 root     root          4096 Nov  7 15:32 ..
-rw-r--r--    1 root     root            62 Nov  7 15:32 05-system-default.rules
-rw-r--r--    1 root     root           335 Nov  6 09:42 05-system-env.rules
-rw-r--r--    1 root     root           335 Nov  6 09:42 40-check-rdx.rules
-rw-r--r--    1 root     root           346 Nov  6 09:42 40-usb-env.rules
-rw-r--r--    1 root     root           614 Nov  6 09:42 50-disk.rules
-rwxr-xr-x    1 root     root           243 Nov  6 09:42 50-firmware.rules
-rwxr-xr-x    1 root     root           272 Nov  6 09:42 50-hiddev.rules
-rwxr-xr-x    1 root     root           315 Nov  6 09:42 50-iscsi.rules
-rw-r--r--    1 root     root           135 Nov  6 09:42 50-net.rules
-rw-r--r--    1 root     root           357 Nov  6 09:42 50-printer-bus.rules
-rw-r--r--    1 root     root          1377 Nov  6 09:42 50-printers.rules
-rwxr-xr-x    1 root     root           373 Nov  6 09:42 50-scsi.rules
-rw-r--r--    1 root     root           327 Nov  6 09:42 50-scsi_host.rules
-rw-r--r--    1 root     root           242 Nov  6 09:40 50-tty.rules
-rwxr-xr-x    1 root     root           932 Nov  6 09:43 50-ups.rules
-rw-r--r--    1 root     root           447 Nov  6 09:40 50-usb-bluetooth.rules
-rwxr-xr-x    1 root     root           526 Nov  6 09:42 50-usb-dvb.rules
-rw-r--r--    1 root     root           371 Nov  6 09:40 50-usb-modem.rules
-rw-r--r--    1 root     root           397 Nov  6 09:40 50-usb-wifi.rules
-rwxr-xr-x    1 root     root           484 Nov  6 09:42 50-usb.rules
But I'm not sure what this means for us.

User avatar
BakedPizza
Apprentice
Apprentice
Posts: 94
Joined: Sun Dec 09, 2012 12:19 am
Location: localhost

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by BakedPizza » Sat Nov 29, 2014 3:26 pm

@berbere
I've uploaded the udev folder here.
My DSM 6.0-6.1 VPN check-reconnect script can be found here: https://github.com/DcR-NL/synology-vpn-reconnect
[DS713+ & DX213 w/ 3x3.0TB (SHR) & 1.5TB & 4GB DDR3-1333 (most recent stable DSM)]

berbere
Trainee
Trainee
Posts: 19
Joined: Thu Sep 23, 2010 3:48 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by berbere » Sun Nov 30, 2014 1:32 am

Thanks BakedPizza,

I'll look into it and post my findings here.

berbere
Trainee
Trainee
Posts: 19
Joined: Thu Sep 23, 2010 3:48 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by berbere » Sun Nov 30, 2014 2:53 am

@BakedPizza,

Please try this:

- Put the firmware file sihp1020.dl in folder /lib/udev/script
- Insert the following lines into file /lib/udev/script/usb.sh. The numbers on the left are line numbers within the file:

Code: Select all

83	sleep 5
84	cat /lib/udev/script/sihp1020.dl > /dev/usb/lp0
85	echo "Device is an HP LaserJet 1020 printer. Firmware sent to printer." >> /tmp/usbdebug
This is what the code should look like around the inserted lines:

Code: Select all

79  GetBusNumDevNumAndGUID
80
81  case ${ACTION} in
82  add)
83	sleep 5
84	cat /lib/udev/script/sihp1020.dl > /dev/usb/lp0
85	echo "Device is an HP LaserJet 1020 printer. Firmware sent to printer." >> /tmp/usbdebug
86	if [ "USB" != "${SYNO_DEV_DISKPORTTYPE}" -a "USBHUB" != "${SYNO_DEV_DISKPORTTYPE}" ]; then
87		echo "Skip empty SYNO_DEV_DISKPORTTYPE event" >> /tmp/usbdebug
88		exit 0
89	fi
- Connect your printer to an USB port on the NAS, turn the printer on and see if it works.

User avatar
BakedPizza
Apprentice
Apprentice
Posts: 94
Joined: Sun Dec 09, 2012 12:19 am
Location: localhost

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by BakedPizza » Sun Nov 30, 2014 7:37 pm

@berbere

DSM 5.1-5004 Update 2
HP LaserJet P1005 (sihpP1005.dl)


Amazing (and quick) work berbere, thank you! I've got some good and some 'bad' news. First the positive news:

IT PRINTS! :D
Image

Since I own a P1005, I had to adjust the lines to:

Code: Select all

	sleep 5
	cat /lib/udev/script/sihpP1005.dl > /dev/usb/lp0
	echo "Device is an HP LaserJet 1005 printer. Firmware sent to printer." >> /tmp/usbdebug
And now for the 'bad' news (two issues):
1. I need to reboot my NAS every time I connect the printer, otherwise it won't load the .dl file.
There's is also no output visible in /tmp/usbdebug when I just plug it in. Calling

Code: Select all

udevadm trigger
does trigger some output, but only 33 lines saying: DEVNAME is empty ?

2. Sometimes the loading of the .dl failes (printer loads and suddenly turns off). This means that I have to reboot again.
This issue may be related to DSM calling the "add" part in usb.sh multiple times during the boot, and thus overlapping previous calls.

To test this I cleared the /tmp/usbdebug file and performed an reboot. When it didn't load properly, the log contained:

Code: Select all

DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
But when it did work, the same log contained (notice the little difference in sequence):

Code: Select all

DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
Skip empty SYNO_DEV_DISKPORTTYPE event
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
I hope you (or somebody else) have any idea on how to fix the two issues. :)

Again, thanks a lot! :D
My DSM 6.0-6.1 VPN check-reconnect script can be found here: https://github.com/DcR-NL/synology-vpn-reconnect
[DS713+ & DX213 w/ 3x3.0TB (SHR) & 1.5TB & 4GB DDR3-1333 (most recent stable DSM)]

berbere
Trainee
Trainee
Posts: 19
Joined: Thu Sep 23, 2010 3:48 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by berbere » Mon Dec 01, 2014 1:02 am

@BakedPizza

I'm glad it worked, sorry to hear about the NAS reboot though. :(
Let's try and find a way to send the firmware only once.

Please insert this echo line (81) in the script:

Code: Select all

79  GetBusNumDevNumAndGUID
80
81  echo "$$ : ACTION=$ACTION , SYNO_DEV_DISKPORTTYPE=$SYNO_DEV_DISKPORTTYPE , 
    SYNO_KERNEL_VERSION=$SYNO_KERNEL_VERSION , DEVICE=$DEVICE , DEVNAME=$DEVNAME , 
    DEVGUID=$DEVGUID , SUBSYSTEM=$SUBSYSTEM , KERNEL_VERSION=$KERNEL_VERSION , 
    DEVPATH=$DEVPATH , PHYSDEVPATH=$PHYSDEVPATH , 
    SYNO_ATTR_BUSNUM_DEVNUM=$SYNO_ATTR_BUSNUM_DEVNUM , SYNO_ATTR_SERIAL=$SYNO_ATTR_SERIAL" >> 
    /tmp/usbdebug
82  case ${ACTION} in
83  add)
84	sleep 5
85	cat /lib/udev/script/sihpP1005.dl > /dev/usb/lp0
86	echo "$$ : Device is an HP LaserJet 1005 printer. Firmware sent to printer." >> /tmp/usbdebug
Line 81 is splitted here for readability, it must be all in one line.
Also mind the $$ addition to line 86.

Reset the logfile /tmp/usbdebug, plug the printer and post the debug lines here.

User avatar
BakedPizza
Apprentice
Apprentice
Posts: 94
Joined: Sun Dec 09, 2012 12:19 am
Location: localhost

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by BakedPizza » Mon Dec 01, 2014 11:26 am

@berbere

Okay, like before, a reboot was needed for any output:

Code: Select all

DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
3020 : ACTION=add , SYNO_DEV_DISKPORTTYPE= , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/000/000 , DEVNAME=sda , DEVGUID=0 , SUBSYSTEM=scsi , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0 , PHYSDEVPATH= , SYNO_ATTR_BUSNUM_DEVNUM= , SYNO_ATTR_SERIAL=
3059 : ACTION=add , SYNO_DEV_DISKPORTTYPE= , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/000/000 , DEVNAME=sdb , DEVGUID=0 , SUBSYSTEM=scsi , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 , PHYSDEVPATH= , SYNO_ATTR_BUSNUM_DEVNUM= , SYNO_ATTR_SERIAL=
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
7074 : ACTION=add , SYNO_DEV_DISKPORTTYPE=SATA , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/000/000 , DEVNAME=sdb , DEVGUID=0 , SUBSYSTEM=block , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sdb , PHYSDEVPATH=/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 , SYNO_ATTR_BUSNUM_DEVNUM= , SYNO_ATTR_SERIAL=
7141 : ACTION=add , SYNO_DEV_DISKPORTTYPE=SATA , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/000/000 , DEVNAME=sda , DEVGUID=0 , SUBSYSTEM=block , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda , PHYSDEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0 , SYNO_ATTR_BUSNUM_DEVNUM= , SYNO_ATTR_SERIAL=
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
My DSM 6.0-6.1 VPN check-reconnect script can be found here: https://github.com/DcR-NL/synology-vpn-reconnect
[DS713+ & DX213 w/ 3x3.0TB (SHR) & 1.5TB & 4GB DDR3-1333 (most recent stable DSM)]

berbere
Trainee
Trainee
Posts: 19
Joined: Thu Sep 23, 2010 3:48 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by berbere » Mon Dec 01, 2014 1:43 pm

@BakedPizza

I noticed the debug lines where the printer is mentioned don't have a trailing number, unlike the big debug line, with the numbers 3020, 3059, 7074 and 7141.
Did you add the $$ to the printer debug line?

The $$ registers the Process ID of the script on the debug file. The script is called many times and I was trying to correlate the big echo output with the printer output.

Having to reboot the NAS is a pain. If you want to stop with these tests it's your call.

User avatar
BakedPizza
Apprentice
Apprentice
Posts: 94
Joined: Sun Dec 09, 2012 12:19 am
Location: localhost

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by BakedPizza » Mon Dec 01, 2014 2:52 pm

@berbere

Oh snap, reading can be hard before some coffee in the morning. Sorry for wasting your time with that log.

I'm not going to give up now, just too curious... Let me know if you feel like it's been enough. :P
Log after adjusting:

Code: Select all

DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
3131 : ACTION=add , SYNO_DEV_DISKPORTTYPE= , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/000/000 , DEVNAME=sdb , DEVGUID=0 , SUBSYSTEM=scsi , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 , PHYSDEVPATH= , SYNO_ATTR_BUSNUM_DEVNUM= , SYNO_ATTR_SERIAL=
3090 : ACTION=add , SYNO_DEV_DISKPORTTYPE= , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/000/000 , DEVNAME=sda , DEVGUID=0 , SUBSYSTEM=scsi , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0 , PHYSDEVPATH= , SYNO_ATTR_BUSNUM_DEVNUM= , SYNO_ATTR_SERIAL=
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
3131 : Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
3090 : Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
7333 : ACTION=add , SYNO_DEV_DISKPORTTYPE=SATA , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/000/000 , DEVNAME=sda , DEVGUID=0 , SUBSYSTEM=block , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda , PHYSDEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0 , SYNO_ATTR_BUSNUM_DEVNUM= , SYNO_ATTR_SERIAL=
7322 : ACTION=add , SYNO_DEV_DISKPORTTYPE=SATA , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/000/000 , DEVNAME=sdb , DEVGUID=0 , SUBSYSTEM=block , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sdb , PHYSDEVPATH=/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 , SYNO_ATTR_BUSNUM_DEVNUM= , SYNO_ATTR_SERIAL=
DEVNAME is empty ?
DEVNAME is empty ?
8530 : ACTION=add , SYNO_DEV_DISKPORTTYPE= , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/006/002 , DEVNAME=synoboot , DEVGUID=1304250704a4ab0 , SUBSYSTEM=scsi , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb6/6-1/6-1:1.0/host7/target7:0:0/7:0:0:0 , PHYSDEVPATH= , SYNO_ATTR_BUSNUM_DEVNUM=6.2 , SYNO_ATTR_SERIAL=1304250704a4ab
7322 : Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
7333 : Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
8530 : Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
My DSM 6.0-6.1 VPN check-reconnect script can be found here: https://github.com/DcR-NL/synology-vpn-reconnect
[DS713+ & DX213 w/ 3x3.0TB (SHR) & 1.5TB & 4GB DDR3-1333 (most recent stable DSM)]

berbere
Trainee
Trainee
Posts: 19
Joined: Thu Sep 23, 2010 3:48 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by berbere » Mon Dec 01, 2014 3:43 pm

@BakedPizza,

We inserted the firmware feed in usb.sh script and I think it works because it gets called for other reasons (during a boot, for other hardware). When you plug in the printer, with the NAS online, nothing happens (has you said before).

I see DEVNAME=sdb/sda, I think this has to do with disks and not the printer. There's another entry where DEVNAME=synoboot and SUBSYSTEM=scsi, don't think it has to do with the printer also.

Let me take another look at the scripts and I'll get back to you later.

BakedPizza wrote:@berbere

Oh snap, reading can be hard before some coffee in the morning. Sorry for wasting your time with that log.

I'm not going to give up now, just too curious... Let me know if you feel like it's been enough. :P
Log after adjusting:

Code: Select all

DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
3131 : ACTION=add , SYNO_DEV_DISKPORTTYPE= , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/000/000 , DEVNAME=sdb , DEVGUID=0 , SUBSYSTEM=scsi , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 , PHYSDEVPATH= , SYNO_ATTR_BUSNUM_DEVNUM= , SYNO_ATTR_SERIAL=
3090 : ACTION=add , SYNO_DEV_DISKPORTTYPE= , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/000/000 , DEVNAME=sda , DEVGUID=0 , SUBSYSTEM=scsi , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0 , PHYSDEVPATH= , SYNO_ATTR_BUSNUM_DEVNUM= , SYNO_ATTR_SERIAL=
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
3131 : Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
3090 : Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
7333 : ACTION=add , SYNO_DEV_DISKPORTTYPE=SATA , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/000/000 , DEVNAME=sda , DEVGUID=0 , SUBSYSTEM=block , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda , PHYSDEVPATH=/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0 , SYNO_ATTR_BUSNUM_DEVNUM= , SYNO_ATTR_SERIAL=
7322 : ACTION=add , SYNO_DEV_DISKPORTTYPE=SATA , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/000/000 , DEVNAME=sdb , DEVGUID=0 , SUBSYSTEM=block , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sdb , PHYSDEVPATH=/devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0 , SYNO_ATTR_BUSNUM_DEVNUM= , SYNO_ATTR_SERIAL=
DEVNAME is empty ?
DEVNAME is empty ?
8530 : ACTION=add , SYNO_DEV_DISKPORTTYPE= , SYNO_KERNEL_VERSION=3.2 , DEVICE=/proc/bus/usb/006/002 , DEVNAME=synoboot , DEVGUID=1304250704a4ab0 , SUBSYSTEM=scsi , KERNEL_VERSION= , DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb6/6-1/6-1:1.0/host7/target7:0:0/7:0:0:0 , PHYSDEVPATH= , SYNO_ATTR_BUSNUM_DEVNUM=6.2 , SYNO_ATTR_SERIAL=1304250704a4ab
7322 : Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
7333 : Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
8530 : Device is an HP LaserJet 1005 printer. Firmware sent to printer.
Skip empty SYNO_DEV_DISKPORTTYPE event
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?
DEVNAME is empty ?

berbere
Trainee
Trainee
Posts: 19
Joined: Thu Sep 23, 2010 3:48 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by berbere » Mon Dec 01, 2014 4:17 pm

@BakedPizza

Could you please try this? (no reboot involved! :) )

- Execute the command tail -f /var/log/messages
- Plug the printer, check what messages appear (if any). Something with udev_printer on it.

User avatar
BakedPizza
Apprentice
Apprentice
Posts: 94
Joined: Sun Dec 09, 2012 12:19 am
Location: localhost

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by BakedPizza » Mon Dec 01, 2014 5:08 pm

@berbere
This appears:

Code: Select all

Dec  1 17:09:06 DS713p udev_printer: /usr/syno/sbin/bind_driver --count  [0]
Dec  1 17:09:06 DS713p udev_printer: (add) [1078] SYNO_USB_PRINTER_REMAIN_SLOTS=2
Dec  1 17:09:06 DS713p udev_printer: (add) [1078] 03f0:3d17:BB081S0 (usblp)
Dec  1 17:09:06 DS713p udev_printer: add printer=[03f0:3d17:BB081S0] devpath=[/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb7/7-1/7-1:1.0/usb/lp0]
Dec  1 17:09:07 DS713p hotplugd: hotplugd.c:1170 ##### ACTION:add
Dec  1 17:09:07 DS713p hotplugd: DEVNAME:lp0
Dec  1 17:09:07 DS713p hotplugd: DEVICE:/proc/bus/usb/007/003
Dec  1 17:09:07 DS713p hotplugd: DEVGUID:BB081S00
Dec  1 17:09:07 DS713p hotplugd: DEVPATH:lp0
Dec  1 17:09:07 DS713p hotplugd: SUBSYSTEM:usb
Dec  1 17:09:07 DS713p hotplugd: PHYSDEVPATH:/devices/pci0000:00/0000:00:1c.3/0000:04:00.0/usb7/7-1/7-1:1.0
Dec  1 17:09:07 DS713p hotplugd: hotplugd.c:543 create virtual node=/dev/usb/03f0:3d17:BB081S0, minor=0
Dec  1 17:09:07 DS713p hotplugd: hotplugd.c:870 ##### complete device hotplug!!
Dec  1 17:09:07 DS713p hotplugd: hotplugd.c:543 create virtual node=/dev/usb/03f0:3d17:BB081S0, minor=0
Dec  1 17:09:07 DS713p CUPS: Starting cupsd...
Dec  1 17:09:07 DS713p synoprint: printer_cups_printer_add.c:198 add cups printer=usbprinter1, ok
Dec  1 17:09:07 DS713p synoprint: printer_cups_printer_add.c:198 add cups printer=usbprinter, ok
Dec  1 17:09:07 DS713p CUPS: Hup cupsd...
Dec  1 17:09:07 DS713p cupsd[2806]: [job.c:332] lock available, printer=03f0:3d17:BB081S0
Dec  1 17:09:07 DS713p cupsd[2806]: [job.c:332] lock available, printer=03f0:3d17:BB081S0
Dec  1 17:09:07 DS713p cupsd[2806]: active jobs: 0
Dec  1 17:09:07 DS713p cupsd[2806]: ===RELOAD===
Dec  1 17:09:08 DS713p kernel: [ 8475.572565] usbip_common_mod: module is from the staging directory, the quality is unknown, you have been warned.
Dec  1 17:09:08 DS713p kernel: [ 8475.589564] usbip: module is from the staging directory, the quality is unknown, you have been warned.
Dec  1 17:09:08 DS713p usbipd: syno_usbipd_func.c:3175(Inappropriate ioctl for device) init usb device=03f0:3d17:BB081S0
Dec  1 17:09:08 DS713p usbipd: syno_usbipd_func.c:2932(Inappropriate ioctl for device) init new printer=03f0:3d17:BB081S0, iIndex=1
My DSM 6.0-6.1 VPN check-reconnect script can be found here: https://github.com/DcR-NL/synology-vpn-reconnect
[DS713+ & DX213 w/ 3x3.0TB (SHR) & 1.5TB & 4GB DDR3-1333 (most recent stable DSM)]

berbere
Trainee
Trainee
Posts: 19
Joined: Thu Sep 23, 2010 3:48 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by berbere » Mon Dec 01, 2014 6:17 pm

@BakedPizza

That log is so much better. :)

Let's try this:

Edit the script printer-usbdev-check.py
Insert these 3 lines:

Code: Select all

time.sleep(5)
subprocess.call('cat /lib/udev/script/sihpP1005.dl > /dev/usb/lp0', shell=True)
log_msg('Firmware sihpP1005.dl sent to HP LaserJet 1005 printer')
Like this:

Code: Select all

253    # close usbdev.conf and release lock
254    fd.close()
255
256	time.sleep(5)
257	subprocess.call('cat /lib/udev/script/sihpP1005.dl > /dev/usb/lp0', shell=True)
258	log_msg('Firmware sihpP1005.dl sent to HP LaserJet 1005 printer')
259
260    return 0
- Save the script and execute the command tail -f /var/log/messages
- Plug the printer and check the result.

I've never used Python before, so bear with me if this somehow breaks the script.

Post Reply

Return to “Printer Server”