Page 1 of 2 12 LastLast
Results 1 to 15 of 18

Thread: Printing in shell

  1. #1

    Printing in shell

    Hi!

    I have an USB Printer connected and i can print via the windows PC!

    But is there any possibility to print in the shell? For example simple text files. Normaly i print via lpr but, there is no lpr on the router!

  2. #2
    Join Date
    Apr 2006
    Location
    Heesch, Netherlands
    Posts
    118
    what about
    Code:
    echo "test" >> /dev/usb/lp0
    Solar inverter monitoring with Asus wl500gx http://solar.reinieren.net (dutch)

  3. #3
    Well i tried echo "HELLO" > /dev/usb/lp0
    And if the printer is in standby mode, he wake up from it, but no printing at all..

    I will try >> maybe, this is the problem...

    And compiling lpr for the printer results in errors...

  4. #4
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    Are you sure that you printer is capable of direct text printing? May be you need to use ghostscript driver to format your text in the way the printer would like to see it?

  5. #5
    This is way i installed ghostscript!

    But when i try to run pdf2ps or ps -sDEVICE=/dev/usb/lp0 file.ps this error is coming:

    AFPL Ghostscript 8.50: ./src/interp.c(295): Fatal error -20 in gs_interp_init!

    Dunno what this means..

  6. #6
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    OK, it seems that your printer supports ps. May be first try to take or create in windows some simple ps (probably level 1) file and do something like this:
    cp file.ps /dev/usb/lp0 or cat file.ps /dev/usb/lp0
    Because, at the moment the question is: is it problem of ghostscript or printer output.

  7. #7
    No, it is a problem of ghostscript!

    I am not possible to CONVERT PDF to PS! This has nothing to do with the printer..
    And i still got the same error!

    I installed FreeType and imagemagick (because i found a thread with ghostscript and error), but the error is still there..

    Is pdf2ps (you have to install ghostscript) working at your router?

  8. #8
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    Is pdf2ps (you have to install ghostscript) working at your router?
    No. The same error.

  9. #9
    Join Date
    Apr 2006
    Location
    Heesch, Netherlands
    Posts
    118
    I have a HP deskjet 840c, copy text to /dev/usb/lp0 works for me here.
    Solar inverter monitoring with Asus wl500gx http://solar.reinieren.net (dutch)

  10. #10
    And how is the cmd?

    cp textfile /dev/usb/lp0 ?

  11. #11
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    Well, OK, I also did test.
    I have HP DJ 6122
    Both
    echo 'HELLO WORLD!!!' > /dev/usb/lp0
    and
    cat test.txt >> /dev/usb/lp0
    are working, but!!!

    When you send such command it wakes up from stand by (as you wrote), and do nothing. Actually it is waiting for end-of-page character (as far as I remember it should be ASCII code 0x0c). In my case after 10 seconds it parks the head and after another 10 seconds Manual-form-feed button on the printer is starting to flash. When I push it I get result.

    Alternatively you may send next line and so on. When you fill all teh printer memory, or reach the end of the page you will get an output (I believe).

    I'm not very good in shell to say how to do it in a nice way. However, I created a file which contains only a single EOP symbol (0x0c), then did cat eop.txt > /dev/usb/lp0 and get out what I sent to printer before!
    Last edited by al37919; 19-10-2007 at 08:19.

  12. #12
    Mhm..

    I have the brother hl 2030 laser printer..
    Wehn i send this

    echo -e "HELLO\n" > /dev/usb/lp0 it wont work!

    \r or \n\r also didnt work for me!

    I am very angry about the ghostscript.. Why is there a package which dont work?!


    Edit: You just wrote 0x0c in the file or who did you write it into the file?

  13. #13
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    Edit: You just wrote 0x0c in the file or who did you write it into the file?
    cat > eop.txt
    then press Alt 012 (on the keypad) (this works from Windows)
    then press Ctrl-D twice

    After that you have file which contains the char you need.

    Finally, brother hl 2030 is a GDI printer which does not support neither PS nor PCL nor any common page description language. Almost certainly it has no support for direct text printing.
    Last edited by al37919; 19-10-2007 at 08:43.

  14. #14
    O noes

    What is about this printer? http://www.samsung.com/us/consumer/d...cd=CLP-300/XAA

  15. #15
    Join Date
    Feb 2007
    Location
    Moscow, Russia
    Posts
    3,805
    IMHO the same situation.

    In principle for brother they provide source code of the CUPS driver, but it means that you have to compile it on/for the router...

Page 1 of 2 12 LastLast

Similar Threads

  1. Screen (shell auslesen)
    By magnat in forum German Discussion - Deutsch (DE)
    Replies: 6
    Last Post: 30-05-2007, 19:21
  2. Printing slow on HP Laserjet 6M
    By frankbatzen in forum WL-500g Q&A
    Replies: 0
    Last Post: 14-04-2006, 08:23
  3. WL500gx HP 895cxi printing prob
    By klandex in forum WL-500g Q&A
    Replies: 1
    Last Post: 31-03-2006, 14:00
  4. FW 1.9.2.7-4 Printing problems
    By sLoDkI in forum WL-500g Q&A
    Replies: 3
    Last Post: 05-02-2006, 00:04
  5. Error Printing (repeated) for LaserJet 6L
    By laughton in forum WL-500g Q&A
    Replies: 1
    Last Post: 29-01-2006, 08:11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •