PDA

Bekijk de volledige versie : Printing on a HP OfficeJet G55



xtin
26-03-2007, 20:03
Hi

Ok, there were others facing the same Problem. How to get a HP Printer to work.

What i did so far:

- i tried the standard method implemented, which seems to work fine from the logs, yet the printer doesnt do a thing.
(logread reads:
Mar 26 19:28:48 printd[724]: Create job 3 file /shares/MYVOLUME1/__var/spool/samba/smbprn.00000003.oatJN8 print queue OfficeJet-G55
Mar 26 19:28:48 printd[724]: Start job 3 file /shares/MYVOLUME1/__var/spool/samba/smbprn.00000003.oatJN8 print queue OfficeJet-G55 pid 1260
Mar 26 19:28:48 printjob[1260]: Startup
Mar 26 19:28:48 printjob[1260]: Print /shares/MYVOLUME1/__var/spool/samba/smbprn.00000003.oatJN8 to /dev/usb/lp0
Mar 26 19:28:49 printjob[1260]: Shutdown
Mar 26 19:28:53 printd[724]: Harvest job 3 file /shares/MYVOLUME1/__var/spool/samba/smbprn.00000003.oatJN8 print queue OfficeJet-G55 pid 1260
Mar 26 19:28:53 printd[724]: Destroy job 3 file /shares/MYVOLUME1/__var/spool/samba/smbprn.00000003.oatJN8 print queue OfficeJet-G55
)
- installed cups with ipkg
- adding the printer ppd file to cups
- installed the printer (now automatically recognized)
- it gets the following address: usb://HP/OfficeJet%20G55?serial=SGA03103Q3VL
- when i try to print the testpage out of cups i get "/opt/lib/cups/filter/foomatic-rip failed"
- some googling tells me, that i should do:
ln -s /opt/bin/gs /bin/gs
ln -s /opt/bin/hpijs /bin/hpijs
(http://www.nslu2-linux.org/wiki/HowTo/HPIJS)
- so there i am stuck, because i cannot write to /bin => there's the question to kfurge wheter /bin/gs and /bin/hpijs could be symlinked to /tmp/gs and /tmp/hpijs in the image, so we can link it via rc.local (altough i'm not sure this would resolve the base problem ... :( )

Then i tried to print directly via console:
lpr -Plp0 somepsfile.ps

Printer wasn't doing a thing.

Next i installed the printer via the ipp adress on my linux machine
I tried all the avaiable drivers (hpijs, gutenprint, ...) but none worked, the printer stays silent. Reading /opt/var/log/cups/error_log after setting loglevel to "debug", didn't made me any smarter.
It looks like the data is actually sent to the printer and the task ends successfully - yet the printer does nothing :(

Conclusion:
I'm out of ideas. Printd and Cups seem to work ok, yet nothing happens - no matter what printing method i use.

Thanks for your help & time!

(The Printer works fine locally via USB on Windows and Gnome)

kfurge
27-03-2007, 02:52
- so there i am stuck, because i cannot write to /bin => there's the question to kfurge wheter /bin/gs and /bin/hpijs could be symlinked to /tmp/gs and /tmp/hpijs in the image, so we can link it via rc.local (altough i'm not sure this would resolve the base problem ... :( )


You can make /bin "writeable" by performing the following steps:

mkdir -p /opt/asus
cd /bin; tar cvf /opt/asus/bin.tar bin
cd /opt/asus; tar xvf bin.tar; rm bin.tar
# Execute and also put this part in rc.local
mount -o bind /opt/asus/bin /bin

At this point you can write freely as root to /bin. One thing, however, is that your router may not be able to cleanly unmount /shares/MYVOLUME1 at powerdown. I've seen some warnings from the reiserfs code on my serial console which makes me nervous. At a minimum, make sure to 'umount -l /bin' and 'sync' a few times before hitting the power button.

I've confirmed a clean shutdown on the console by repeating the steps above for /sbin then removing the /sbin/miscio_input_change symlink and replacing it with the following shell script:

#!/bin/sh

/bin/cp /shares/MYVOLUME1/shutdown.sh /tmp
/bin/cp /bin/busybox /tmp/sh

sync
sync
sync

/tmp/shutdown.sh &

Where /shares/MYVOLUME1/shutdown.sh is:

#!/tmp/sh

/opt/bin/umount -l /sbin
/opt/bin/umount -l /bin
/opt/bin/umount -l /opt

/bin/mkdir -p /tmp/miscio
/bin/ln -s /sbin/rc /tmp/miscio/miscio_input_change

sync
sync
sync

/tmp/miscio/miscio_input_change &

exit 0

At some point, this will be streamlined and much better documented in a how-to, but for now, good luck.

- K.C.

xtin
30-03-2007, 18:48
Thanks for your reply kfurge! I couldn't get it to work though :(
I also realised that i couldn't print with cups on my linux laptop.
But using hpoj it works fine. This brings me to the idea to crosscompile hpoj for the router. I'm downloading the stuff now ... (hope it'll be down till tomorrow... asus dl server are horrible :( )

but before i start:
Has someone done this before? And if so, could you post the binaries?

Are there any good guides on howto crosscompile stuff for the router?

thx :)

xtin

kfurge
31-03-2007, 02:45
Another alternative is to compile directly on your router. IMHO, this works better than cross-compiling. Just install the "optware-devel" meta-package. It installs nearly everything necessary to build a standard autoconf based package.

The only problem I've encountered is most scripts that use /bin/sh usually fail miserably. Replace #!/bin/sh with #!/opt/bin/bash and they'll work flawlessly.

- K.C.

xtin
02-04-2007, 19:02
thx for the hint. I am now trying to do this but it all fails, with a very strange output:

(after ./configure runs ok while checking for the essential stuff it gives up with:

checking for unistd.h... (cached) yes
configure: creating ./config.status
unset: not found
conftest.sh: not found
rm: not found
expr: not found
test: not found
test: not found
test: not found
test: not found
expr: not found
test: not found
/bin/bash: not found
/bin/ksh: not found
/bin/sh5: not found
test: not found
/usr/bin/sh: not found
/usr/bin/bash: not found
/usr/bin/ksh: not found
/usr/bin/sh5: not found
test: not found
sed: not found
sed: not found
echo: not found
echo: not found

)

kfurge
03-04-2007, 02:16
I've had to add the following to my .profile to build various packages:

PATH_SEPARATOR=:
CONFIG_SHELL=/opt/bin/bash
AWK=/opt/bin/gawk
export PATH_SEPARATOR CONFIG_SHELL AWK

See if these help.

- K.C.

xtin
04-04-2007, 12:25
Thanks, it helped indeed.

After some trouble hpoj started compiling after configure running thru, but it breaks when compiling the hpojip-part:



cc -O -Wall -g -I/opt/home/xtin/hpoj-0.91/include -L/opt/home/xtin/hpoj-0.91/lib/hpojip -L/opt/home/xtin/hpoj-0.91/lib/ptal -L/opt/home/xtin/hpoj-0.91/lib/sane -DHPOJIP_INTERNAL -fPIC -c -o xjpg_fix.shared.o xjpg_fix.c
xjpg_fix.c: In function 'jpgFix_getActualTraits':
xjpg_fix.c:512: error: invalid lvalue in assignment
xjpg_fix.c:533: error: invalid lvalue in assignment
xjpg_fix.c:549: error: invalid lvalue in assignment
xjpg_fix.c:560: error: invalid lvalue in assignment
xjpg_fix.c:581: error: invalid lvalue in assignment
xjpg_fix.c:587: error: invalid lvalue in assignment
xjpg_fix.c:595: error: invalid lvalue in assignment
xjpg_fix.c:605: error: invalid lvalue in assignment
xjpg_fix.c:610: error: invalid lvalue in assignment
make: *** [xjpg_fix.shared.o] Error 1


Some googling told me that hpoj is no longer maintained, and that one should move on to hplip, which i did.
Again I got configure running thru and make locking up after a while:


io/hpiod/hpiod.cpp: In function 'void get_lock(const char*)':
io/hpiod/hpiod.cpp:225: internal compiler error: Segmentation fault


Any Ideas how to fix that?

kfurge
05-04-2007, 01:55
Any Ideas how to fix that?

Does it happen repeatably? Sometimes flaky ram does this and re-running make magically gets through.

If you could post the config steps steps you've taken so far, I'll try to reproduce your problem because I'd like to get it running on my router as well. I downloaded the package, but it seemed to have a pretty large number of dependent packages so I haven't pursued it yet.

- K.C.

kfurge
06-04-2007, 02:54
I got it to compile Ok on my box by adding the following to my .profile:

CC=/opt/bin/gcc
LDSHARED='/opt/bin/gcc -shared -L/opt/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link,/opt/lib -lbz2 -lcrypt -ldb-4.2 -lncurses -lreadline -lssl -lz'

And executing the following:

./configure --prefix=/opt --enable-network-build=no --enable-gui-build=no

Dunno if it works or not.

- K.C.

xtin
09-04-2007, 17:42
Thanks for the input. I tried it several times. also tried lower versions, and tried to patch hpoj, but failed miserably in the end.

Therefore my request: Could you tar the directory with the compiled hplip, and attach it to the forum, put online or send it to me by email? (rhostettlerATgmailDOTcom)
So we can untar it into a dir, do "make install" and puff, printing rocks ;)

Thanks

xtin

kfurge
11-04-2007, 02:43
Therefore my request: Could you tar the directory with the compiled hplip, and attach it to the forum, put online or send it to me by email?


For a short while, you can get it here:

http://wl500g.info/files/asus/custom/kfurge/hplip-1.7.3/hplip-1.7.3.tgz

It's about 15Meg. Please let me know when you have it so I can remove it from the server.

- K.C.

P.S. I don't know if it even works. It'll be a few months until I get around to actually trying to get it working on my router.

xtin
12-04-2007, 16:58
Thanks. I dl'd it, trying it now :)