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 » Mon Dec 01, 2014 6:42 pm

@berbere

Congrats, I think you made a lot of LaserJet users very happy right now. :)
Image

This means I can restore the original usb.dev file, right?
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:54 pm

Glad I could help. 8)

And yes, you can restore the original usb.dev file.

loizi
I'm New!
I'm New!
Posts: 1
Joined: Thu Dec 04, 2014 6:33 am

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by loizi » Thu Dec 04, 2014 6:40 am

Hi,

i've tried every step like descripted. But the printer (HP Laserjet 1020) still does not print.
I executed the command: tail -f /var/log/messages
Then i replugged the printer and tried to send a print-job to it.

This is the result:
LoiziNAS> tail -f /var/log/messages
Dec 3 21:11:29 LoiziNAS cupsd[5077]: active jobs: 1
Dec 3 21:11:29 LoiziNAS cupsd[5077]: ===DELAY_RELOAD===
Dec 3 21:11:41 LoiziNAS cupsd[5077]: release lock
Dec 3 21:11:41 LoiziNAS usbipd: syno_usbipd_func.c: 284(No child processes) release lock request, op=RELEASE_LOCK, host=CUPS, printer id=03f0:2b17:FN2YGBE, pid=5077
Dec 3 21:11:41 LoiziNAS usbipd: syno_usbipd_func.c:1139(No child processes) remove active client, printer[1]=03f0:2b17:FN2YGBE, socket=-1, pid=5077, client name=CUPS
Dec 3 21:11:41 LoiziNAS usbipd: syno_usbipd_func.c: 208(No such file or directory) signal AP=5077
Dec 3 21:11:41 LoiziNAS cupsd[5077]: [job.c:332] lock available, printer=03f0:2b17:FN2YGBE
Dec 3 21:11:41 LoiziNAS cupsd[5077]: [job.c:332] lock available, printer=03f0:2b17:FN2YGBE
Dec 3 21:11:41 LoiziNAS cupsd[5077]: active jobs: 0
Dec 3 21:11:41 LoiziNAS cupsd[5077]: ===RELOAD===
Dec 3 21:13:43 LoiziNAS usbipd: syno_usbipd_func.c: 277(No child processes) get lock request, op=GET_LOCK, host=CUPS, printer id=03f0:2b17:FN2YGBE, pid=5077
Dec 3 21:13:43 LoiziNAS usbipd: syno_usbipd_func.c: 282(No such file or directory) wait queue insert ok
Dec 3 21:13:43 LoiziNAS usbipd: syno_usbipd_func.c:1266(No such file or directory) choose client ok, start change client, printer=03f0:2b17:FN2YGBE, pid=5077, name=CUPS
Dec 3 21:13:43 LoiziNAS usbipd: syno_usbipd_func.c: 208(No such file or directory) signal AP=5077
Dec 3 21:13:43 LoiziNAS cupsd[5077]: active jobs: 1
Dec 3 21:13:43 LoiziNAS cupsd[5077]: ===DELAY_RELOAD===
Dec 3 21:13:55 LoiziNAS cupsd[5077]: release lock
Dec 3 21:13:55 LoiziNAS usbipd: syno_usbipd_func.c: 284(No child processes) release lock request, op=RELEASE_LOCK, host=CUPS, printer id=03f0:2b17:FN2YGBE, pid=5077
Dec 3 21:13:55 LoiziNAS usbipd: syno_usbipd_func.c:1139(No child processes) remove active client, printer[1]=03f0:2b17:FN2YGBE, socket=-1, pid=5077, client name=CUPS
Dec 3 21:13:55 LoiziNAS usbipd: syno_usbipd_func.c: 208(No such file or directory) signal AP=5077
Dec 3 21:13:55 LoiziNAS cupsd[5077]: ===RELOAD===
Dec 3 21:13:56 LoiziNAS cupsd[5077]: [job.c:332] lock available, printer=03f0:2b17:FN2YGBE
Dec 3 21:13:56 LoiziNAS cupsd[5077]: [job.c:332] lock available, printer=03f0:2b17:FN2YGBE
Dec 3 21:13:56 LoiziNAS cupsd[5077]: active jobs: 0
Can anyone solve the Problem?

Thx in advance

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 » Tue Dec 09, 2014 11:40 pm

Hi @loizi,

Where are you trying to print from? (application and operating system)

rj45jack
I'm New!
I'm New!
Posts: 4
Joined: Thu Dec 11, 2014 12:44 am

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by rj45jack » Thu Dec 11, 2014 12:50 am

Hi berbere,

I joined just to share my experience with this new fix for my HP P1005. It seems your Python addition didn't do it for me either.

Here is what my /var/log/message reports too:

Code: Select all

Dec 10 19:48:34 Kruger usbipd: syno_usbipd_func.c: 277(No child processes) get lock request, op=GET_LOCK, host=CUPS, printer id=03f0:3d17:BC10QPK, pid=5886
Dec 10 19:48:34 Kruger usbipd: syno_usbipd_func.c:1913(No child processes) cannot correct wait queue, printer id=03f0:3d17:BC10QPK
Dec 10 19:48:34 Kruger usbipd: syno_usbipd_func.c: 279(No child processes) insert wait queue failed
Dec 10 19:48:45 Kruger usbipd: syno_usbipd_func.c: 277(No child processes) get lock request, op=GET_LOCK, host=CUPS, printer id=03f0:3d17:BC10QPK, pid=5886
Dec 10 19:48:45 Kruger usbipd: syno_usbipd_func.c:1913(No child processes) cannot correct wait queue, printer id=03f0:3d17:BC10QPK
Dec 10 19:48:45 Kruger usbipd: syno_usbipd_func.c: 279(No child processes) insert wait queue failed
Dec 10 19:48:56 Kruger usbipd: syno_usbipd_func.c: 277(No child processes) get lock request, op=GET_LOCK, host=CUPS, printer id=03f0:3d17:BC10QPK, pid=5886
Dec 10 19:48:56 Kruger usbipd: syno_usbipd_func.c:1913(No child processes) cannot correct wait queue, printer id=03f0:3d17:BC10QPK
Dec 10 19:48:56 Kruger usbipd: syno_usbipd_func.c: 279(No child processes) insert wait queue failed
Dec 10 19:49:08 Kruger usbipd: syno_usbipd_func.c: 277(No child processes) get lock request, op=GET_LOCK, host=CUPS, printer id=03f0:3d17:BC10QPK, pid=5886
Dec 10 19:49:08 Kruger usbipd: syno_usbipd_func.c:1913(No child processes) cannot correct wait queue, printer id=03f0:3d17:BC10QPK
Dec 10 19:49:08 Kruger usbipd: syno_usbipd_func.c: 279(No child processes) insert wait queue failed
That keeps repeating and floods the messages logs. I cannot print from PCs or directly on my Synology.

Any ideas?

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 » Thu Dec 11, 2014 10:16 am

@rj45jack

1. Are you sure you placed the sihpP1005.dl file in the right directory? Do you get some 'weird' output or does it say "No such file or directory" if you run:

Code: Select all

tail /lib/udev/script/sihpP1005.dl
2. Can you share the lines that you changed (and the line before and after the addition)? Just to be sure it isn't caused by an accidental typo or something like that.

Just for the record.. Yesterday I reconnected the printer and it still worked fine. On the first run (after moving from the old method to udev) I removed the old printer entry and install the new one on my Windows 8.1 device. Not sure if that was needed, tho.

What I eventually needed to get DSM 5.1 to work with my P1005:
Special thanks to berbere for providing the solution!

1. Inside the /lib/udev/script/printer-usbdev-check.py file I have added these lines between fs.close() and return 0:

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')
So that line 253 to 260 of /lib/udev/script/printer-usbdev-check.py file looks like this:

Code: Select all

    # close usbdev.conf and release lock
    fd.close()
              
    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')

    return 0
Indentation is very important for Python, so be sure that the new lines start with exactly the same amount of spaces as used with fd.close() and return 0.

2. And I moved the sihpP1005.dl file inside the /lib/udev/script/ directory.
Last edited by BakedPizza on Thu Dec 11, 2014 7:53 pm, edited 2 times in total.
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)]

rj45jack
I'm New!
I'm New!
Posts: 4
Joined: Thu Dec 11, 2014 12:44 am

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by rj45jack » Thu Dec 11, 2014 7:15 pm

@BakedPizza

Thanks for the reply.

Here is what I have so far:

Inside the /lib/udev/script/:

Code: Select all

Kruger> ls
firmware.sh                  sihpP1005.dl
hotplugd-util.sh             syno_default_env.sh
iscsi-add.sh                 tty-util.sh
iscsi-remove.sh              ups-check.sh
printer-remove-check.py      usb-bluetooth-util.sh
printer-usbdev-check.py      usb-env-util.sh
printer-usbdev-check.py.bak  usb-modem-util.sh
printer-util.py              usb-parse-vidpid.sh
rdx_util.sh                  usb-wifi-util.sh
sas-bs-pwrctl.sh             usb.sh
sas-snapshot-update.sh
Kruger>

Here is what I have inside of printer-usbdev-check.py:

Code: Select all

    # close usbdev.conf and release lock
    fd.close()

	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')

    return 0
This is what shows up in /var/log/messages when I plug in my HP P1005:

Code: Select all

rt wait queue failed
Dec 11 14:12:17 Kruger udev_printer: /usr/syno/sbin/bind_driver --count  [0]
Dec 11 14:12:17 Kruger udev_printer: (add) [566] SYNO_USB_PRINTER_REMAIN_SLOTS=2
Dec 11 14:12:17 Kruger udev_printer: (add) [566] 03f0:3d17:BC10QPK (usblp)
Dec 11 14:12:18 Kruger usbipd: syno_usbipd_func.c: 277(No child processes) get lock request, op=GET_LOCK, host=CUPS, printer id=03f0:3d17:BC10QPK, pid=5886
Dec 11 14:12:18 Kruger usbipd: syno_usbipd_func.c:1913(No child processes) cannot correct wait queue, printer id=03f0:3d17:BC10QPK
Dec 11 14:12:18 Kruger usbipd: syno_usbipd_func.c: 279(No child processes) insert wait queue failed

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 » Thu Dec 11, 2014 7:45 pm

@rj45jack

I think I've got good news for you. After some trial and error I noticed that you are missing a space before the three new lines. Indentation is very important for Python.

Please add a space before "time", "subprocess" and "log_msg", so that they line up exactly with the start of "fd.close()" and "return 0". :)
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)]

rj45jack
I'm New!
I'm New!
Posts: 4
Joined: Thu Dec 11, 2014 12:44 am

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by rj45jack » Thu Dec 11, 2014 9:06 pm

@BakedPizza

I added 3 spaces to each line, and I still get this:

Code: Select all

Dec 11 16:06:46 Kruger usbipd: syno_usbipd_func.c: 277(No child processes) get lock request, op=GET_LOCK, host=CUPS, printer id=03f0:3d17:BC10QPK, pid=5886
Dec 11 16:06:46 Kruger usbipd: syno_usbipd_func.c:1913(No child processes) cannot correct wait queue, printer id=03f0:3d17:BC10QPK
Dec 11 16:06:46 Kruger usbipd: syno_usbipd_func.c: 279(No child processes) insert wait queue failed
Printing a test page from Windows, Linux or the device still does nothing :(

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 » Thu Dec 11, 2014 10:54 pm

@rj45jack
3 spaces to each line, as in 9 spaces total? I meant one space for each line (and repeat till they line up with "fd.close()" and "return 0"). I'm still pretty sure that's the issue, since I'm having the same issue when I copy your content from here.

Let's try it another way.
1. First be sure you're running DSM 5.1-5004 Update 2.
2. Download my file over here.
3. Place the file on your NAS and do this:

Code: Select all

cat /locationToMyFile/printer-usbdev-check.py > /lib/udev/script/printer-usbdev-check.py
4. Verify the content of /lib/udev/script/printer-usbdev-check.py.
5. Replug your p1005 after this.
6. You should see the following line in /var/log/messages:

Code: Select all

Dec 11 23:00:34 DS713p udev_printer: Firmware sihpP1005.dl sent to HP LaserJet 1005 printer
If this doesn't work, I'm out of ideas. :?
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 » Fri Dec 12, 2014 3:01 pm

Hello everybody,

Synology said DSM 5.1 could be installed on my old DS-210j so I went ahead with the upgrade.
I modified the Python printer script to include my solution, shared with you earlier on this forum.

I noticed some problems by looking at the logs in /var/log/messages, a bunch of error lines after the firmware was sent to the printer. I also couldn't print anything from my Windows Desktop.

I inserted a new sleep line to the script, after the firmware feed and adjusted both sleep times. This solved the error lines in the messages log file:

Code: Select all

    # close usbdev.conf and release lock
    fd.close()

    time.sleep(2)
    subprocess.call('cat /lib/udev/script/sihp1020.dl > /dev/usb/lp0', shell=True)
    log_msg('Firmware sihp1020.dl sent to HP LaserJet 1020 printer')
    time.sleep(8)

    return 0
The first sleep (2 seconds) is enough time for the printer to finish its power on cycle before the script feeds it the firmware.
The second sleep (8 seconds) is to give the printer time to finish "eating" the firmware.
These times worked for me, I measured them with a stopwatch by looking at the output of tail -f /var/log/messages.

But I still couldn't print from Windows so I followed this tutorial:
https://www.synology.com/en-global/know ... orials/573

After this I was able to print and everything is OK now.

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 » Fri Dec 12, 2014 3:55 pm

@loizi, @rj45jack,

Before printing we should check if plugging the printer is handled correctly by the system. Look in the messages log file, do you see something like this when you plug the printer?

(this is what I see in my log file when I plug an HP LaserJet 1020 to my DS-210j with DSM 5.1-5004 Update 2 and the printer is working fine)
Dec 5 09:09:07 PATINHAS udev_printer: /usr/syno/sbin/bind_driver --count [0]
Dec 5 09:09:07 PATINHAS udev_printer: (add) [754] SYNO_USB_PRINTER_REMAIN_SLOTS=2
Dec 5 09:09:07 PATINHAS udev_printer: (add) [754] 03f0:2b17:FN2FJFS (usblp)
Dec 5 09:09:08 PATINHAS udev_printer: add printer=[03f0:2b17:FN2FJFS] devpath=[/devices/platform/orion-ehci.0/usb1/1-1/1-1.2/1-1.2:1.0/usb/lp0]
Dec 5 09:09:10 PATINHAS udev_printer: Firmware sihp1020.dl sent to HP LaserJet 1020 printer
Dec 5 09:09:20 PATINHAS hotplugd: hotplugd.c:1170 ##### ACTION:add
Dec 5 09:09:20 PATINHAS hotplugd: DEVNAME:lp0
Dec 5 09:09:20 PATINHAS hotplugd: DEVICE:/proc/bus/usb/001/015
Dec 5 09:09:20 PATINHAS hotplugd: DEVGUID:FN2FJFS0
Dec 5 09:09:20 PATINHAS hotplugd: DEVPATH:lp0
Dec 5 09:09:20 PATINHAS hotplugd: SUBSYSTEM:usb
Dec 5 09:09:20 PATINHAS hotplugd: PHYSDEVPATH:/devices/platform/orion-ehci.0/usb1/1-1/1-1.2/1-1.2:1.0
Dec 5 09:09:20 PATINHAS hotplugd: hotplugd.c:543 create virtual node=/dev/usb/03f0:2b17:FN2FJFS, minor=0
Dec 5 09:09:20 PATINHAS hotplugd: hotplugd.c:870 ##### complete device hotplug!!
Dec 5 09:09:20 PATINHAS hotplugd: hotplugd.c:543 create virtual node=/dev/usb/03f0:2b17:FN2FJFS, minor=0
Dec 5 09:09:20 PATINHAS CUPS: Starting cupsd...
Dec 5 09:09:21 PATINHAS synoprint: printer_cups_printer_add.c:198 add cups printer=usbprinter, ok
Dec 5 09:09:21 PATINHAS CUPS: Hup cupsd...
Dec 5 09:09:21 PATINHAS cupsd: active jobs: 0
Dec 5 09:09:21 PATINHAS cupsd: ===RELOAD===
Dec 5 09:09:23 PATINHAS kernel: [305726.590000] usbip_common_mod: module is from the staging directory, the quality is unknown, you have been warned.
Dec 5 09:09:23 PATINHAS kernel: [305726.630000] usbip: module is from the staging directory, the quality is unknown, you have been warned.
Dec 5 09:09:24 PATINHAS usbipd: syno_usbipd_func.c:3175(Success) init usb device=03f0:2b17:FN2FJFS
Dec 5 09:09:24 PATINHAS usbipd: syno_usbipd_func.c:2932(Success) init new printer=03f0:2b17:FN2FJFS, iIndex=1

rj45jack
I'm New!
I'm New!
Posts: 4
Joined: Thu Dec 11, 2014 12:44 am

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by rj45jack » Fri Dec 12, 2014 8:23 pm

BakedPizza wrote:@rj45jack
3 spaces to each line, as in 9 spaces total? I meant one space for each line (and repeat till they line up with "fd.close()" and "return 0"). I'm still pretty sure that's the issue, since I'm having the same issue when I copy your content from here.

Let's try it another way.
1. First be sure you're running DSM 5.1-5004 Update 2.
2. Download my file over here.
3. Place the file on your NAS and do this:

Code: Select all

cat /locationToMyFile/printer-usbdev-check.py > /lib/udev/script/printer-usbdev-check.py
4. Verify the content of /lib/udev/script/printer-usbdev-check.py.
5. Replug your p1005 after this.
6. You should see the following line in /var/log/messages:

Code: Select all

Dec 11 23:00:34 DS713p udev_printer: Firmware sihpP1005.dl sent to HP LaserJet 1005 printer
If this doesn't work, I'm out of ideas. :?
This worked!

I must have messed the formatting up beyond repair. I was going to roll back to a backup I made, but you just saved the day!

Thanks :D

Teove76
I'm New!
I'm New!
Posts: 6
Joined: Thu Dec 25, 2014 11:52 am

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by Teove76 » Thu Dec 25, 2014 12:15 pm

Thanks Efex for your instructions,

it worked with an HP Laserjet 1018.
I mean, the firmware (http://oleg.wl500g.info/hplj/sihp1018.dl) + change in usb.agent.

I wanted only add that my printer is behind a USB Hub, and all works fine.

Ciao,
Matteo

--- system info ---
DS214se
DSM 5.0
APC 350
Win 7
--------
DS214se
DSM 5.2-5967 Update 2
Packages: Audio Station / Download Station / Media Server
Network: n.3-4 laptops, n.2 smartphones, n.1 smart TV

windhund
I'm New!
I'm New!
Posts: 1
Joined: Wed Dec 31, 2014 6:51 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Unread post by windhund » Wed Dec 31, 2014 7:01 pm

Hi everybody,

I tried to follow efex' guide but struggled with point 7:
7.) you need to edit file /usr/syno/hotplug/usb.agent. First make a backup: cp /usr/syno/hotplug/usb.agent /usr/syno/hotplug/usb.agent.old
I just cannot find the file "usb.agent" - I really don't know what's happening... I am using DSM 5.1 latest version.

Image

I would be thankful for every hint!

Best

windhund

Post Reply

Return to “Printer Server”