Ed wrote:
> All I need to finish the project is to
> be able to send simple ASCII text from my program to a USB printer (HP
> D1420).
[snip]
> Install HPIJS printer driver. I can find out how to do this under
> Debian but how can I do this under TS-Linux with 8MB of on-board flash?
[snip]
> Do I have to rebuild the kernel to include printer support?
You will need the printer.o kernel module. On the TS-7250 board I use it was
not included. I cross-compiled the kernel used on the board so I could get the
needed module and copied only the module back to the board.
If you can cross-compile programs for the board it isn't that difficult to
rebuild the kernel with the missing module. If your board uses the 2.4.26-ts11
Linux kernel I could send you the printer.o module.
> Do I have to convert text files to PostScript, have a .ppd file
> present, and use foomatic-rip, etc. just to print simple ASCII text.
You might not need *all* of it but a lot of it. Unless you dig up a dot-matrix
printer I think you will find that just about any printer available today will
need you to do more than fire ASCII text at it in order to get a printed page.
If you only have 8MB of Flash, you may be hard pressed to squeeze in all of
the needed printing support items.
To make the application I am working on print to a USB printer, I went the
Ghostscript route. Ghostscript forms an integral part of your standard Linux
printing sub-system. It has the drivers for a lot of printers built-in. You
can use it to get output from a printer without needing a lot of other stuff
if you don't other printing support such as spooling.
My application generates Postscript code which is passed to Ghostscript.
Ghostscript then processes the Postscript file and sends the appropriate
information straight to the printer. I told the client which printers they
could use based on which ones were available and compatible with drivers in
Ghostscript.
BTW, I am using the new version of Ghostscript which is a recent merge of two
main Ghostscript implementations. The result being the printer drivers from
each implementation can now be found in one package.
To keep things flexible and easier for the client to make minor changes to the
app in the future I built Ghostscript with all drivers included. The gs binary
and one font file weigh in at just over 8Meg. I could make the gs binary
smaller by excluding drivers for printers I not likely to see (such as all the
dot-matrix printers).
You also need to factor in large memory requirements. On a TS-7250 with 32M
each of Flash and SRAM, it is just about enough SRAM to print an 8.5x11 page
at 300x300 dpi, in black and white only. Peak memory usage during printing
leaves about 6M to 8M of the 32M free. The gs application uses about 8M of RAM
about 10M of RAM when processing the Postscript file to be sent to the
printer. If you want to print at higher resolutions, or with colour, you would
need to increase memory requirements accordingly.
The last part of the printing process was the implementation of a state
machine in my application to deal with printing. It tracks the printer state
and the state of the printing process. It handles the printer being turned on
and off, whether the printing process appears to have stalled (ie. out of
ink/toner, or paper), and also provides a way for a page to be reprinted. In
theory I could even support a simple form of spooling by using a linked list
of file names that are to be printed.
Your other choice to keep things to a minimum is to generate Postscript and
send it to a Postscript printer. You could also look at sending the file to
print to another machine. It all depends on your situation, and what you can
handle in terms of costs.
--
Cheers!
Kevin.
http://www.ve3syb.ca/ |"What are we going to do today, Borg?"
Owner of Elecraft K2 #2172 |"Same thing we always do, Pinkutus:
| Try to assimilate the world!"
#include <disclaimer/favourite> | -Pinkutus & the Borg
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|