LaserJet 1020 on RT-AC87U

DKEBeck88

Occasional Visitor
Hi all - new to ASUSWRT, new to ASUSWRT-Merlin, and new to the SNB forums. Nice to meet you.

I just set up my brand new RT-AC87U, having finally retired my trusty RT-N16. I ran Shibby's mod of TomatoUSB on my old router, so as I said I am new to ASUSWRT-Merlin. So far so good - have been able to recreate almost everything in no time (samba share off of the USB3 port, media server, etc.).

The one thing I am not quite able to figure out is setting up my LaserJet 1020 on the USB2 port. This model printer is a bit quirky in that every time it is turned on, a firmware file needs to be loaded on to it. So I was in no way surprised when printing didn't work "out of the box" with this new router (although it is recognized as being plugged in and correctly identified, so that's good). In Tomato on the RT-N16, I put the necessary firmware file (sihp1020.dl) on the jffs partition and then put the following code in the "hotplug script" field in the "USB Support" section of the GUI:

Code:
if [ $PRODUCT = "3f0/2b17/100" ]; then
    if [ $ACTION = "add" ]; then
        sleep 7
        cat /jffs/sihp1020.dl > /dev/usb/lp0
    fi
fi

Is something like this possible in ASUSWRT-Merlin? I already formatted the jffs partition and copied the sihp1020.dl firmware file to it. I'm guessing that if this is possible, I'll need to put a custom script in the jffs/scripts folder, right? I read the documentation about the various scripts available but didn't see anything about usb hotplug. Am I missing something?
 

DKEBeck88

Occasional Visitor
I just saw this post in a different thread - so at least in May of 2103 this may not have been possible:
http://forums.smallnetbuilder.com/showthread.php?p=70718#post70718

Simply connecting to the router via SSH and running that command loads the firmware, so I can always do that as an option (although not sure if I can teach my wife how to do that, or if I'd want to). Also, I could just always keep the printer on and then have that command run when the router starts, but if possible I'd like to avoid that as we only print maybe once a week so that would be a lot of unnecessary uptime for such an infrequently used printer.

Any other ideas?
 

john9527

Part of the Furniture
I looked, and it does look like the original tomato code is still there.....

If you want to give it a try.....

Take your original script and add the shebang....

Code:
#!/bin/sh
if [ $PRODUCT = "3f0/2b17/100" ]; then
    if [ $ACTION = "add" ]; then
        sleep 7
        cat /jffs/sihp1020.dl > /dev/usb/lp0
    fi
fi
and save it to /jffs/script_usbhotplug.tmp

then execute the following

Code:
nvram set script_usbhotplug="`cat /jffs/script_usbhotplug.tmp`"
nvram commit && reboot

while rebooting make an offering to the router gods :)
 

DKEBeck88

Occasional Visitor
I looked, and it does look like the original tomato code is still there.....

If you want to give it a try.....

Take your original script and add the shebang....

Code:
#!/bin/sh
if [ $PRODUCT = "3f0/2b17/100" ]; then
    if [ $ACTION = "add" ]; then
        sleep 7
        cat /jffs/sihp1020.dl > /dev/usb/lp0
    fi
fi
and save it to /jffs/script_usbhotplug.tmp

then execute the following

Code:
nvram set script_usbhotplug="`cat /jffs/script_usbhotplug.tmp`"
nvram commit && reboot

while rebooting make an offering to the router gods :)

Thanks for this. I knew I should have "worked from home" today. I will try this when I get home. I've always treated my routers with kindness and respect, so hopefully the router gods will take that in to consideration when processing my request!
 

DKEBeck88

Occasional Visitor
Unfortunately, that did not work. Didn't break anything, so the router gods don't hate me, but the firmware does not load after turning the printer on after running through the outlined steps and rebooting the router.

I've manually loaded the firmware and the printer works without a problem, so for the time being I'll just leave the printer on and look in to this some more.

Thanks for the help, and if anyone has any additional ideas I'm all ears.
 

john9527

Part of the Furniture
Oh well.....I was hoping to take a shortcut....on tomato the shebang is in a separate file and I had hoped that it would run if I included it in your script. I'll take another look and see if I can find out where the right location for it would be in the Merlin builds.
 

DKEBeck88

Occasional Visitor
Oh well.....I was hoping to take a shortcut....on tomato the shebang is in a separate file and I had hoped that it would run if I included it in your script. I'll take another look and see if I can find out where the right location for it would be in the Merlin builds.

Thanks a ton - it was definitely worth a try, and I really appreciate the effort.

I just read in another thread that someone had problems with a script because they used an editor on their computer and then copied it to the router, and they fixed it by creating the script with the built-in vi editor. The editors we used to create the script are different (that poster used Notepad++, I used gedit), but I'll give that a try when I get home just in case.
 

john9527

Part of the Furniture
Actually, the way this works is that the script is loaded to an nvram variable, then read from there and executed.....

So what you want to check is that

nvram get script_usbhotplug

correctly lists the lines in the script.

But....something else going on. I made myself a test script that just creates a file in jffs and it's not getting executed (the code may be there, but compiler defines might not be including it). Still looking for you (I like a challenge) :)
 

armand

Occasional Visitor
The one thing I am not quite able to figure out is setting up my LaserJet 1020 on the USB2 port. This model printer is a bit quirky in that every time it is turned on, a firmware file needs to be loaded on to it.

I have the 1018 (it is very similar to the 1020, even uses the same driver), I just took it out of the mothballs this week because I needed to print something and decided to hook it up to my rt-ac66. I needed to manually set it up according to the instruction on the asus page (ez-printer didn't work) and install the driver on windows. I can turn on/off printer/router and still print.

http://support.asus.com/search.aspx?SLanguage=en&keyword=ASUSWRT lpr

edit: and with google cloudprint I was even able to make it work on android (hp print plugin was unsuccessful though)
 
Last edited:

DKEBeck88

Occasional Visitor
I have the 1018 (it is very similar to the 1020, even uses the same driver), I just took it out of the mothballs this week because I needed to print something and decided to hook it up to my rt-ac66. I needed to manually set it up according to the instruction on the asus page (ez-printer didn't work) and install the driver on windows. I can turn on/off printer/router and still print.

http://support.asus.com/search.aspx?SLanguage=en&keyword=ASUSWRT lpr

edit: and with google cloudprint I was even able to make it work on android (hp print plugin was unsuccessful though)

That is very interesting. It looks like the 1018 also requires its firmware to be loaded each time it is turned on before printing is possible. I'm curious with your setup where the firmware is coming from? I'm guessing your PC, even though the printer isn't connected directly to it? Are you able to tell if that firmware is loaded as soon as you turn on the printer, or not until the first job you send to it?

I use Linux instead of Windows (I purchased this printer when I was still using Windows and never had a problem with it then). Once I got the rt-n16 and discovered the ability to load the firmware directly from it, I was quite happy because it seemed like every time I upgraded my distribution, I had to reimplement the printer installation using some variant of these instructions:
http://foo2zjs.rkkda.com/

The instructions you linked to were roughly what I used to set up the printer on my computer, but until I manually load the firmware, unfortunately it won't print.
 

armand

Occasional Visitor
That is very interesting. It looks like the 1018 also requires its firmware to be loaded each time it is turned on before printing is possible. I'm curious with your setup where the firmware is coming from? I'm guessing your PC, even though the printer isn't connected directly to it? Are you able to tell if that firmware is loaded as soon as you turn on the printer, or not until the first job you send to it?

I use Linux instead of Windows (I purchased this printer when I was still using Windows and never had a problem with it then). Once I got the rt-n16 and discovered the ability to load the firmware directly from it, I was quite happy because it seemed like every time I upgraded my distribution, I had to reimplement the printer installation using some variant of these instructions:
http://foo2zjs.rkkda.com/

The instructions you linked to were roughly what I used to set up the printer on my computer, but until I manually load the firmware, unfortunately it won't print.


I haven't really used linux since win7 was released but iirc there was an official hp driver package for the 1018, maybe you can try to set that up. Back in those days it was connected to my desktop under linux and I was able to print from other computers (linux/windows) via the network

The firmware seems to be loaded from computer after the print command is given...
 
Last edited:

armand

Occasional Visitor
@DKEBeck88, I just tried to get this working on a USB flash of Mint Olivia I had laying around, and it worked without any problems following the guide for windows as much as possible

edit: sorry forgot to turn off printer, now it doesn't work anymore
 
Last edited:

DKEBeck88

Occasional Visitor
@DKEBeck88, I just tried to get this working on a USB flash of Mint Olivia I had laying around, and it worked without any problems following the guide for windows as much as possible

edit: sorry forgot to turn off printer, now it doesn't work anymore

Wow - thank you very much for trying. Much appreciated even if it didn't end up working.

The fact that, using Windows, you can get it to work makes me think that if I actually install the full driver executable from HP on to my wife's laptop (previously I had just used the generic 1020 driver that ships with Windows when setting up her laptop), then similar to your Windows PC, perhaps when she attempts a print job the firmware will be uploaded at that point even through the printer isn't connected directly via USB. That could be a reasonable workaround, as then I could turn the printer off when it is not in use and only I would have to manually upload the firmware when I wanted to print. She could simply turn on the printer, load the paper, and print as before. May be worth a try, as I read that this printer has overheating problems. Not sure if that warning applies to idle or only during active large print jobs though.

Another warning for Linux users of these printers - if you turn on the printer and try to print without first uploading the firmware and then you realize upon not getting your printout that you forgot to upload the firmware, simply uploading the firmware and reprinting doesn't work. I think the first sent print jobs gums up the works and blocks subsequent jobs even after the firmware is uploaded. Restarting the router clears things out, and then uploading the firmware and resending the print job works. I'm sure there is a less drastic way to clear out the print queue on the router, but restarting the router definitely gets the job done.
 

DKEBeck88

Occasional Visitor
I had my first real-world test, and unfortunately things didn't go as smoothly as I had hoped. My wife wanted to print something from her Windows laptop, and unfortunately it didn't print even though I hadn't turned off the printer since I successfully printed a few pages a couple of days ago. So I guess when the printer goes idle it needs to have the firmware reloaded? Anyway, since she had by that point sent a job to the printer which was blocking the queue even after I manually loaded the firmware, I had to turn off the printer, restart the router, turn on the printer, and load the firmware manually. Then she could print normally. I'm pretty sure I don't have to go through all those steps, but I know for a fact that that particular order of steps works and I'm happy to go through them to get the printer back to working. Just bummed that leaving the printer on isn't a good solution.
 

armand

Occasional Visitor
You could try to connect the printer directly to your linux machine, set up up with the hp driver (run hp-setup) and then try to connect it to the router
 

DKEBeck88

Occasional Visitor
You could try to connect the printer directly to your linux machine, set up up with the hp driver (run hp-setup) and then try to connect it to the router

I'm struggling even to get my wife's Windows machine to print normally using the method you just recommended. I hooked the printer up to her machine directly via USB, and once the driver installed, it printed perfectly (with the firmware getting uploaded when the print job is sent). But then once I hook it up to the router and then edit the printer port per the Windows instructions linked to earlier in this thread...no dice unless I have previously manually loaded the firmware. I think my printer and/or router is haunted.

If I can get my wife's Windows printer working OK, I think I'm set. I have a bashrc alias set up on my GNU/Linux machine that condenses the SSH login and firmware upload command to a few keystrokes, and I can certainly remember to do that each time I (infrequently) print. I've had bad luck with hp-setup in the past - it would work once and then not again, or it would work uptil I upgraded my distribution and then I could never get it working again unless I completely reformatted/reinstalled my OS. This is one of the reasons I was so happy to get the printer working with my previous router - no more crossed fingers every time I upgraded my distribution.
 

DKEBeck88

Occasional Visitor
I've been managing with this printer pretty well over the last week or so, as I've been home every time my wife has had to print so I just turn on the printer and load the firmware manually from my computer via SSH:
Code:
ssh [email protected] "cat /jffs/sihp1020.dl > /dev/usb/lp0"

After doing that, I can print from my computer (GNU/Linux, wired) and my wife's laptop (Win7, wireless).

Today I created a .cmd file to put on my wife's computer so she can run the same command from her computer so she can print when I'm not home to load the firmware. It loads up Putty and runs the exact same command. She is asked for the admin password same as when I load it from my own computer. Once she enters the password, the firmware loads on the printer just as when it is run from my own computer (I can hear the printer whir and churn when the firmware is loaded). But no print jobs print successfully when the firmware is loaded from her computer, whether the print job is sent from my computer or her computer. It is as if the firmware was never loaded.

Can anyone think of any reason why it works when I run the command from my computer but not hers? Both are doing the exact same thing (logging in via SSH and loading a file that resides on the router) - I don't see how the computer where the SSH session originates from plays any part in it.
 

armand

Occasional Visitor
My old laptop broke so I had to buy a new one, I had a lot of problems setting up my printer again. I don't know why except that I first was on the 374.43 fork and now on 376.48b3. I finally managed to print something when I selected monopoly mode though, this wasn't necessary on 374.43

(both laptops ran win8.1 64bit)
 

yff0216

New Around Here
[QUOTE =“armand,post:148180,member:28502”]我的旧笔记本电脑破了,所以我不得不买一个新的,我有很多问题再次设置我的打印机我不知道为什么除了我第一次在374.43叉,现在在376.48b3。当我选择垄断模式时,我终于设法打印了一些东西,374.43没有必要

(两台笔记本电脑都运行win8.1 64bit)[/ QUOTE]
你解决了这个问题吗?我有同样的问题
my email :[email protected] thinks
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top