SOLUTION: HOWTO run problematic LaserJet printers on DSxxx

Got questions on using your printer with our server? Post it here.

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby xcopy » Wed Feb 23, 2011 1:31 am

efex wrote:Strange.
This procedure is working on DSM 2 and DSM 3 too.


Yes, it is strange.
Regarding to your screen:
I have these files under user / group: root / root . Except this your usb.agent is over 400 Bytes longer. Why?


I should start off by saying that I'm not a Linux guy, but I'm going to learn. :D

JFF was logged on when I did this, and owned the folder I used to transfer the files. The files were originally moved (in windows) to a folder owned by user JFF. Perhaps that's why it shows up as JFF, but I'm thinking it could be part of the problem since it isn't a "root/root" file. Should all users be logged off and is there another way to get the file to the root without going through a users folder?

As for the size, there are several lines of code that were added to the usb.agent file which would increase the size. the code added was taken directly from your post, and when I compared the old file to the new file, the new code was the only difference (i used winmerge.exe for the compare).

Maybe you can have a look to /var/log/hp. Everything looks, that in your case firmware is not sent to printer after detection. You can see somtehing like this:
Wed Dec 29 00:37:00 CET 2010 : Sending firmware to printer...
Wed Dec 29 00:37:00 CET 2010 : Sending firmware to printer...
Wed Dec 29 00:37:00 CET 2010 : done.
Wed Dec 29 00:37:01 CET 2010 : done.



I'm not following you on this. Is there something else I can/should check?

Thanks again for your assistance on this. I couldn't do it without you... :lol: :lol:
xcopy
Experienced
Experienced
 
Posts: 121
Joined: Fri Dec 03, 2010 4:34 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby Nick2011 » Sun Mar 06, 2011 3:11 am

Has anyone installed the new DSM 3.1-1594? Is the workaround still required?

Nick
Nick2011
I'm New!
I'm New!
 
Posts: 2
Joined: Sun Mar 06, 2011 3:06 am

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby xcopy » Sun Mar 06, 2011 9:39 pm

The problem never was with any version of DSM. The problem is with the way HP implemented the communications protocol. HP designed these printers (at least the ones we're discussing) to work as direct connect printers, not networked printers, for which they have different models.

This work around apparently works for most people (just not for me... yet) :(
xcopy
Experienced
Experienced
 
Posts: 121
Joined: Fri Dec 03, 2010 4:34 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby efex » Sun Mar 06, 2011 10:09 pm

Regarding to your screen:
I have these files under user / group: root / root . Except this your usb.agent is over 400 Bytes longer. Why?

JFF was logged on when I did this, and owned the folder I used to transfer the files. The files were originally moved (in windows) to a folder owned by user JFF. Perhaps that's why it shows up as JFF, but I'm thinking it could be part of the problem since it isn't a "root/root" file. Should all users be logged off and is there another way to get the file to the root without going through a users folder?

If you follow my steps, you just copy edited files to some "storage" (shared folder) as some logged user. Then you need to login as root in SSH / telnet and copy files. When I did this way, files was owned by root.

You can also try command:
Code: Select all
chown root usb.agent
in that folder.
Maybe you can have a look to /var/log/hp. Everything looks, that in your case firmware is not sent to printer after detection. You can see somtehing like this:
Wed Dec 29 00:37:00 CET 2010 : Sending firmware to printer...
Wed Dec 29 00:37:00 CET 2010 : Sending firmware to printer...
Wed Dec 29 00:37:00 CET 2010 : done.
Wed Dec 29 00:37:01 CET 2010 : done.

I'm not following you on this. Is there something else I can/should check?
[/quote]
In this log you should see if code was executed or not. If you cannot see it, script was not executed and "root" issue is probably reason why.
efex
Trainee
Trainee
 
Posts: 16
Joined: Wed May 20, 2009 10:36 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby xcopy » Mon Mar 07, 2011 7:42 pm

efex wrote:
cle
Regarding to your screen:
I have these files under user / group: root / root . Except this your usb.agent is over 400 Bytes longer. Why?

JFF was logged on when I did this, and owned the folder I used to transfer the files. The files were originally moved (in windows) to a folder owned by user JFF. Perhaps that's why it shows up as JFF, but I'm thinking it could be part of the problem since it isn't a "root/root" file. Should all users be logged off and is there another way to get the file to the root without going through a users folder?

If you follow my steps, you just copy edited files to some "storage" (shared folder) as some logged user. Then you need to login as root in SSH / telnet and copy files. When I did this way, files was owned by root.

You can also try command:
Code: Select all
chown root usb.agent
in that folder.
Maybe you can have a look to /var/log/hp. Everything looks, that in your case firmware is not sent to printer after detection. You can see somtehing like this:
Wed Dec 29 00:37:00 CET 2010 : Sending firmware to printer...
Wed Dec 29 00:37:00 CET 2010 : Sending firmware to printer...
Wed Dec 29 00:37:00 CET 2010 : done.
Wed Dec 29 00:37:01 CET 2010 : done.

I'm not following you on this. Is there something else I can/should check?
In this log you should see if code was executed or not. If you cannot see it, script was not executed and "root" issue is probably reason why.



Thanks efex. It is strange. I have no /var/log/hp directory so I can't check the log file.

Regarding the initial setup, I followed your original directions from a year ago, logged in as root, and everything worked as you said it would after I printed a page directly from my computer first. The surprising thing was the owner showed up as "JFF" (though I was logged in via telnet as root) and the group was "users".

I tried your recent suggestion to change the owner, but it didn't work. I also tried changing the group to root, which is similar to everything else I see in the directory. No good. I then made sure that the driver itself had root as both the owner and group, but again, it didn't work. I even rebooted the DS hoping that it would be loaded when I tried, but the file sits in queue for a short while, and then deletes itself.

Here's a quick snapshot of Sun; Moon, the other disk station looks the same with root/root as owner/group. Theoretically, there is no reason for it not to work. the only thing I can think of is that I'm sending the print request from a x64 machine, so perhaps it doesn't work the same as a 32-bit machine.

Are you running a 64 bit OS, or 32 bit?

Image
Last edited by xcopy on Tue Sep 20, 2011 5:20 pm, edited 1 time in total.
xcopy
Experienced
Experienced
 
Posts: 121
Joined: Fri Dec 03, 2010 4:34 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby efex » Mon Mar 07, 2011 8:56 pm

If you cannot see log, than code is not executed at all probably. Can you send me you usb.agent via PM. I will try to find problem. I don't expect 32/64 bit issue. But will see....

One more thing what comes to me mind is, that you broke end of lines with your editor. Sometimes CR+LF is used and sometimes CR at the end of each line. Some aplliacations are sensitive to this. We need to understand why your file is bigger than my.
efex
Trainee
Trainee
 
Posts: 16
Joined: Wed May 20, 2009 10:36 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby xcopy » Mon Mar 07, 2011 10:36 pm

efex wrote:If you cannot see log, than code is not executed at all probably. Can you send me you usb.agent via PM. I will try to find problem. I don't expect 32/64 bit issue. But will see....

One more thing what comes to me mind is, that you broke end of lines with your editor. Sometimes CR+LF is used and sometimes CR at the end of each line. Some aplliacations are sensitive to this. We need to understand why your file is bigger than my.


:D

I'm cautiously optimistic! I think you found the right answer!!

I followed your suggestion and checked the CR at the end of the new lines I added in the usb.agent file. I had originally edited this in Notepad ++ and even though it recognized the Unix/Linux LF, the new code had CR LF at the end of each line. The difference in file size is just the increase number of lines/code, so I don't think it's a problem. See below.

Image

I changed all the end-of-line characters first to Windows to unify them, then changed them all back to Unix (LF). I uploaded the file again, turned the printer on, did NOT print from the PC first, and the page printed. :)

I tested it from a wireless laptop and it worked, but I'd like to test a little more and make sure other users can reach the printer. It looks promising though!

There are still some strange things though. Even though I was logged on as root, the modified usb.agent file still showed up as owner = JFF and group = users. I had to use the chown root usb.agent AND chgrp root usb.agent commands to change this before testing. I'm still not sure why that happens, unless there's some override taking the file from a users directory. I may test some files coming from another users directory to see if it makes a difference.

I used the chmod command after moving the new file in as you suggested. The newly moved file has permissions set up as -rwxrwxrwx, but the chmod command updated it to -rwxr-xr-x, which makes sense to me.

I'll post again after a little more testing, but I want to thank you once again for your suggestion. Such a simple thing kept if from working, but I never thought of it. Thanks!!!

Almost forgot, I now have the hp log file with multiple entries saying "Sending firmware to printer". I never had the file before. :)
Last edited by xcopy on Tue Sep 20, 2011 5:06 pm, edited 2 times in total.
xcopy
Experienced
Experienced
 
Posts: 121
Joined: Fri Dec 03, 2010 4:34 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby efex » Mon Mar 07, 2011 11:11 pm

Great!!!
efex
Trainee
Trainee
 
Posts: 16
Joined: Wed May 20, 2009 10:36 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby synas » Sun Mar 20, 2011 9:15 pm

I did everything as instructed but printing does not succeed.

Initializing on PC usb port works (of course), then switching the printer to the NAS works.
I added the sihp1020.dl file to the proper directory, modified the usb.agent script end saved it in the proper place and finally I ran chmod 755 on it.

Code: Select all
sleep 5
if [ "$PRODUCT" = "3f0/2b17/100" ]
then
      if [ "$ACTION" = "add" ]
      then
         echo "`date` : Sending firmware (sihp1020.dl) to HP LaserJet 1020 printer (lp0)." >> /var/log/hplaserjet1020.log
         cat /usr/syno/hotplug/firmware/sihp1020.dl > /dev/usb/lp0
      fi
fi


The LaserJet 1020 is connected as lp0.
When connecting the printer via USB (or when powering it up) the usb.agent script runs and send the firmware (as can be seen in the log).
When the firmware is sent, it looks like the printer starts printing, the orange led blinks and then printer stops (green led is on). I think this is normal.
However, if I then try to print something nothing happens and the printer stays quiet.

Log file:

DiskStation> cat /var/log/hplaserjet1020.log
Sun Mar 20 20:44:35 CET 2011 : Sending firmware (sihp1020.dl) to HP LaserJet 1020 printer (lp0).
Sun Mar 20 20:44:35 CET 2011 : Sending firmware (sihp1020.dl) to HP LaserJet 1020 printer (lp0).
DiskStation>


Any ideas why the printer does not start printing?
(When initializing the printer on the PC's USB port first everything works just fine, until it's powered off of course.)

Also strange is that for each time the printer is powered-up (or reconnected via usb) the usb.agent script is run twice so firmware is send twice to the LaserJet.
synas
I'm New!
I'm New!
 
Posts: 4
Joined: Sun Mar 20, 2011 7:32 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby efex » Mon Mar 21, 2011 4:23 pm

If you send firmware twice, it is working fine and it is normal.

Are you able to print if you send firmware directly from PC or not?

Which printer you have?
efex
Trainee
Trainee
 
Posts: 16
Joined: Wed May 20, 2009 10:36 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby xcopy » Mon Mar 21, 2011 5:51 pm

Hi all,

I want to confirm that after fixing several issues, with efex's help, my printer is still working from several wireless and wired computers.

I don't think this will solve more complex problems, but the one caveat I'll add is to make sure the DS is booted first, before turning the printer on. Seems to make a difference in my case, but I'm not sure why.
xcopy
Experienced
Experienced
 
Posts: 121
Joined: Fri Dec 03, 2010 4:34 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby synas » Wed Mar 23, 2011 4:19 pm

efex wrote:If you send firmware twice, it is working fine and it is normal.

Are you able to print if you send firmware directly from PC or not?


synas wrote:Initializing on PC usb port works (of course), then switching the printer to the NAS works.


efex wrote:Which printer you have?


synas wrote:The LaserJet 1020 is connected as lp0.
synas
I'm New!
I'm New!
 
Posts: 4
Joined: Sun Mar 20, 2011 7:32 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby synas » Tue Mar 29, 2011 7:59 pm

Hi efex,

See my response above.
Do you have any tips about what could be wrong / why the LaserJet 1020 does not print?
synas
I'm New!
I'm New!
 
Posts: 4
Joined: Sun Mar 20, 2011 7:32 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby rollout » Fri Apr 01, 2011 8:14 pm

I'm a total Windows/Mac person, never used Linux or Telnet...can anybody transcribe the following instructions for me?

1.) find proper firmware file on net. Filename should be sihp10xx.dl (for LJ1020 it is sihp1020.dl and I found it here: http://oleg.wl500g.info/hplj/sihp1020.dl)
2.) Go to DS management settings and allow Telnet or SSH
3.) Copy sihp10xx.dl file to some of your shares on DS (for example "Share" root)
4.) connect to DS with telnet or SSH client (you can use putty client for example)
5.) Login as "root", as password put your admin password
6.) copy your firmware file to folder /usr/syno/hotplug/fimrware with command mv /volume1/Share/sihp1020.dl /usr/syno/hotplug/firmware
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
8.) now copy it to Share to edit it mv /usr/syno/hotplug/usb.agent /volume1/Share/
9.) now open file usb.agent in your Share folder (on File explorer) with notepad or similar editor.

Step 1: done.
Step 2: And I have enabled Telnet on my Windows machine...but dont know where to look for DS Management settings (DSM 3.0) to allow Telnet.
Step 3: can do
Step 4: How is this done? What do I enter at the Telnet prompt: Microsoft Telnet>
Step 5: Not sure of what this means...
Step 6: Sounds easy enough
Step 7: Can do
Step 8: Not sure what "edit it mv" means.
Step 9: Think I can do this...

Thanks ahead of time.
rollout
I'm New!
I'm New!
 
Posts: 3
Joined: Fri Apr 01, 2011 8:01 pm

Re: SOLUTION: HOWTO run problematic LaserJet printers on DSx

Postby xcopy » Tue Apr 05, 2011 4:33 pm

rollout wrote:I'm a total Windows/Mac person, never used Linux or Telnet...can anybody transcribe the following instructions for me?

1.) find proper firmware file on net. Filename should be sihp10xx.dl (for LJ1020 it is sihp1020.dl and I found it here: http://oleg.wl500g.info/hplj/sihp1020.dl)
2.) Go to DS management settings and allow Telnet or SSH

Control Panel, Network Settings Row, click on terminal

3.) Copy sihp10xx.dl file to some of your shares on DS (for example "Share" root)
4.) connect to DS with telnet or SSH client (you can use putty client for example)

go thru windows telnet (turn on if you haven't enabled it)

5.) Login as "root", as password put your admin password

1. type "Open {your diskstation name), as in "open ds710"
2. it will ask for a login user, enter "root" as the user
3. enter password

6.) copy your firmware file to folder /usr/syno/hotplug/fimrware with command mv /volume1/Share/sihp1020.dl /usr/syno/hotplug/firmware
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
8.) now copy it to Share to edit it mv /usr/syno/hotplug/usb.agent /volume1/Share/


it means "move" the file to a shared folder (e.g., x:\myfolder where myfolder is one you've set up and is accessible via windows. You also need to read this thread completely to make sure you understand where you might get hung up. I had a permissions problem and had to do some extra work, but everything is documented here.


9.) now open file usb.agent in your Share folder (on File explorer) with notepad or similar editor.

Step 1: done.
Step 2: And I have enabled Telnet on my Windows machine...but dont know where to look for DS Management settings (DSM 3.0) to allow Telnet.
Step 3: can do
Step 4: How is this done? What do I enter at the Telnet prompt: Microsoft Telnet>
Step 5: Not sure of what this means...
Step 6: Sounds easy enough
Step 7: Can do
Step 8: Not sure what "edit it mv" means.
Step 9: Think I can do this...

Thanks ahead of time.
xcopy
Experienced
Experienced
 
Posts: 121
Joined: Fri Dec 03, 2010 4:34 pm

PreviousNext

Return to USB Printer Server

Who is online

Users browsing this forum: No registered users and 0 guests