Stupid me I forgot #!/bin/shOriginally Posted by Oleg
Now it works great!
When I disconnect or power off/on the firmware is loaded in the printer right away!
Great work!
Your post-mount should start with #!/bin/sh and be a chmod +x
Stupid me I forgot #!/bin/shOriginally Posted by Oleg
Now it works great!
When I disconnect or power off/on the firmware is loaded in the printer right away!
Great work!
KEEP FORUMS @ WL500G.INFO UP!!! - DONATE NOW, CLICK HERE!!!
I haven't got anything under /dev/usb, it's totally empty. The printer is connected to the usb, but when I run the command above, it says:./usb_printerid /dev/usb/lp0 | grep -q FWVER || cat sihp1020.dl > /dev/usb/lp0
Error: No such file or directory: can't open '/dev/usb/lp0'
Of course it can't open it because it isn't there. WHY?
If I try with /dev/lp0 it says:
Error: Invalid argument: GET_DEVICE_ID on '/dev/lp0'
maybe because this lp0 stands for the LPT printer, doesn't it?
...after 5 hours of strugling...
I've downloaded a modified version of the "foo2zjs" driver (tar.gz from linuxprinting.org). It contains the same firmware for the HP 1020 that Oleg mentioned (I think you actually copied it from there, didn't you.)
I booted up Suse 9.3 and compiled the foo2zjs package (specially made for HP1020), pushed the printer in the USB port of the machine (that is running Suse), Suse (I think via UDEV) recognized the device on the USB.Then I did a
....Code:cat hp1020.img > /dev/usb/lp0
The printer started to init itself again as if it were switched on. Cool...
then
and voila, the new firmware was on the printer, saying FWVER:200411xxCode:usb_printerid /dev/usb/lp0
Then with the new firmware I could print a test page in SuSe 9.3 using Cups, then pulling the plug and inserting it into the Windows machine, tried to print....worked also flawlessly.
Than (WITHOUT switching the printer off) I put the USB plug into the router. The same symptom remained:
the error messages are the same as before, even with the new firmware.Code:Jan 1 01:00:06 kernel: usb.c: new USB bus registered, assigned bus number 1 Jan 1 01:00:06 kernel: hub.c: USB hub found Jan 1 01:00:06 kernel: hub.c: 2 ports detected Jan 1 01:00:07 kernel: hub.c: new USB device 00:04.0-1, assigned address 2 Jan 1 01:00:07 kernel: usb.c: USB device not accepting new address=2 (error=-145) Jan 1 01:00:07 kernel: hub.c: new USB device 00:04.0-1, assigned address 3 Jan 1 01:00:07 kernel: usb.c: USB device not accepting new address=3 (error=-145) Jan 1 01:00:08 kernel: lp0: using parport0 (polling). Jan 1 01:00:08 kernel: usb.c: registered new driver usblp Jan 1 01:00:08 kernel: printer.c: v0.13: USB Printer Device Class driver Jan 1 01:00:10 kernel: usb.c: registered new driver audio
That can be the reason why the p910nd daemon can't create /dev/usb/lp0, because the router can't even access the printer on the USB port.
So what now??
These errors are hardware problem, so you should fix them first BEFORE playing with software. If you use a hub, replace it or connect directly. If you do not use a hub, try different port on the wl500g deluxe. If it still does not work, replace a cable.Jan 1 01:00:07 kernel: hub.c: new USB device 00:04.0-1, assigned address 2
Jan 1 01:00:07 kernel: usb.c: USB device not accepting new address=2 (error=-145)
Jan 1 01:00:07 kernel: hub.c: new USB device 00:04.0-1, assigned address 3
Jan 1 01:00:07 kernel: usb.c: USB device not accepting new address=3 (error=-145)
Yes, Processed with arm2hpdl, cross-compiled usb_printerid and put online.Originally Posted by pardonfiu
I bought a WL-500G Deluxe just a few hours ago. It recognizes the printer right after connecting...VERY GOOD. All the previous post are working now:
- can upload firmware and check version with usb_printerid, printing works well.
One slight problem is that GJAman's method for changing the firmware right when the printer is switched on, doesn't work for me. When I run /usr/local/sbin/post-mount manually it works like an angel.
It seems that the post-mount script doesn't run when switching on/off the printer (or connecting).
The router recognizes the printer every time I switch it on, it assigns address to it, so it is aware of the printer.
What should I do to automate firmware loading? How can I force the post-mount script to run when switching on the printer?
Right. Post-mount is executed after usb drive is get mounted.Originally Posted by pardonfiu
No way with post mount. Instead you should replace hotplug handler using smg like this:What should I do to automate firmware loading? How can I force the post-mount script to run when switching on the printer?
post-mount:
create a /usr/local/sbin/hotplugCode:# ... load firmware ... usb_printerid bla-bla-bal # replace a hotplug handler echo /usr/local/sbin/hotplug > /proc/sys/kernel/hotplug
P.S. this is just an idea, you've to read about hotplug in linux and finish this. Post it back then.Code:#!/bin/sh # call firmware handler /sbin/hotplug $* ... check for printer plug and load firmware ... if bla-bla-bla; then ... load firmware ... fi
it seems like the kernel doesn't start /sbin/hotplug (or whatever is in /proc/sys/kernel/hotplug).
I've read much about hotplug on http://linux-hotplug.sourceforge.net/ but couldn't get closer to the solution.
Somehow the system recognizes the printer when turning on, because it refreshes /proc/bus/usb/devices...
I'm stucked with this...
Please post messages after power off/on. They should contain something like this:
usb.c: USB disconnect on device 01:02.0-2.1 address 3
printer.c: usblp0: removed
hub.c: new USB device 01:02.0-2.1, assigned address 5
This means, the /sbin/hotplug should be called for new device. Just checked with a small hotplug replacement and it's indeed called.
Code:[root@wl500gx root]$ cat /tmp/hotplug #!/bin/sh echo --------------- >> /tmp/hotplug.log date >> /tmp/hotplug.log echo $* >> /tmp/hotplug.log set >> /tmp/hotplug.log [root@wl500gx root]$ echo /tmp/hotplug > /proc/sys/kernel/hotplug [root@wl500gx root]$Code:--------------- Sat Jan 7 23:15:13 MSK 2006 usb ACTION='remove' DEVFS='/proc/bus/usb' DEVICE='/proc/bus/usb/002/005' HOME='/' IFS=' ' INTERFACE='7/1/2' PATH='/sbin:/bin:/usr/sbin:/usr/bin' PPID='2' PRODUCT='3f0/7104/100' PS1='\w \$ ' PS2='> ' PS4='+ ' PWD='/' TYPE='0/0/0' --------------- Sat Jan 7 23:15:14 MSK 2006 usb ACTION='add' DEVFS='/proc/bus/usb' DEVICE='/proc/bus/usb/002/006' HOME='/' IFS=' ' INTERFACE='7/1/2' PATH='/sbin:/bin:/usr/sbin:/usr/bin' PPID='2' PRODUCT='3f0/7104/100' PS1='\w \$ ' PS2='> ' PS4='+ ' PWD='/' TYPE='0/0/0'
Finally....
here is the hotplug script
/tmp/local/sbin/hotplug
and I added the following to /tmp/local/sbin/post-bootCode:#!/bin/sh echo --------------- >> /tmp/hotplug.log date >> /tmp/hotplug.log echo $* >> /tmp/hotplug.log set >> /tmp/hotplug.log if [ "$ACTION" = "add" ] || [ "$1" = "usb" ] || [ "$DEVFS" = "/proc/bus/usb" ]; then sleep 5 /tmp/harddisk/etc/usb_printerid /dev/usb/lp0 | grep -q FWVER || cat /tmp/harddisk/etc/sihp1020.dl > /dev/usb/lp0 echo "Firmware loaded succesfully!" >> /tmp/hotplug.log else echo "Device removed" >> /tmp/hotplug.log fi /sbin/hotplug $*
It works like a charm!!!!!Code:echo "/tmp/local/sbin/hotplug" >> /proc/sys/kernel/hotplug
I would like to thank all of you, especially you, Oleg!
This router is amazing with your firmware!
Actually your script contains some bugs...
Righ now I am choosing a new wireless router and thinking about WL500g deluxe. There should be HP LaserJet 1200 printer installed to it and I am wondering if is there any problem with this printer? Can anyone confirm that HP LJ 1200 works well?
Yeah, there are some bugs.Originally Posted by Oleg
1. echo "/tmp/local/sbin/hotplug" >> /proc/sys/kernel/hotplug should be in "/tmp/local/sbin/post-mount"
2. "#!/bin/sh" missing
3. The most important, while I power on/off/on the printer, it doesn't work anymore. Some errors as below:
Mar 20 21:41:18 kernel: usb_control/bulk_msg: timeout
Mar 20 21:41:29 kernel: usb_control/bulk_msg: timeout
Mar 20 21:41:29 kernel: printer.c: usblp0: error -145 reading printer status
I suspect there's something stuck in the router. The printer was not removed successfuly. Is there any solution?
Thanks!
Hi,
I've tried to make an ASUS WL-500g to work with a HP LaserJet 1020, but I'm not able to make work reliably.
I've tried to implement some of the ideas discussed here, but it simply doesn't work in a reliable way - the firmware is not loaded to the printer.
I have added 3 scripts:
/tmp/local/sbin/hotplug
/tmp/local/sbin/post-bootCode:#!/bin/sh echo --------------- >> /var/log/hotplug.log date >> /var/log/hotplug.log echo $* >> /var/log/hotplug.log set >> /var/log/hotplug.log if [ "$ACTION" = "add" ] || [ "$1" = "usb" ] || [ "$DEVFS" = "/proc/bus/usb" ]; then sleep 5s /tmp/usb_printerid /dev/usb/lp0 | grep -q FWVER || cat /tmp/sihp1020.dl > /dev/usb/lp0 echo "Firmware loaded succesfully!" >> /var/log/hotplug.log else echo "Device removed" >> /var/log/hotplug.log fi /sbin/hotplug $*
/tmp/local/sbin/post-mountCode:#!/bin/sh sleep 7s cd /tmp wget http://oleg.wl500g.info/hplj/usb_printerid wget http://oleg.wl500g.info/hplj/sihp1020.dl chmod +x usb_printerid
My perception is that post-boot will be executed after the booting is finished. The post-boot script only waits for some seconds in order to make the AP to be online.Code:#!/bin/sh echo "/tmp/local/sbin/hotplug" >> /proc/sys/kernel/hotplug
The post-mount script should be executed after the printer is detected (turned on), but it doesn't execute.
Do some of you have any ideas to solve printing with ASUS WL-500g and HP LaserJet 1020? Can it be done in a different way, e.g. using CUPS (is CUPS able to upload the firmware to the printer since the driver is installed at the client?)?
Any suggestions to help me solve this issues will be appreciated :-)
Best regards,
Rune