ts-7000
[Top] [All Lists]

[ts-7000] Re: Support for USB Printer - Is it really that complicated?

To:
Subject: [ts-7000] Re: Support for USB Printer - Is it really that complicated?
From: "Ed K" <>
Date: Fri, 02 Nov 2007 18:45:14 -0000
Update:

Everyone, FYI: here's what I've ended up doing (for now) just to get by:

I'm using a Belkin F5U002 USB to parallel adapter cable and a
Panasonic KX-P1150 dot-matrix printer.  With the printer.o module
installed (thanks to Kevin) I can simply plug the cable in (as Yan
suggested) and the printer (or more accurately the CABLE) magically
appears as /dev/usb/lp0.  That's the interesting part:  whether or not
the printer is plugged in or on-line, the system thinks there's a
printer at /dev/usb/lp0 as long as the cable is plugged in.

>From my C program I'm simply writing my report output to a file
(pr_out.txt) then using the system "cat" command to send it to the
printer:

     ret = system("cat pr_out.txt > /dev/usb/lp0");

This works like a charm, except for one little thing; if the printer
is turned off my program hangs (the system call never returns) until
the printer is turned on.  After a few seconds a message appears on
the console saying that lp0 is offline.  There MUST be a way for me to
obtain this information from within my program but I just don't know
how.  I've looked at fork() and wait() and several other system calls
but I can't figure out how to use them.  

I can test for the presence of /dev/usb/lp0 before I try to send
anything to the printer but as I said above, that only tells me that
the CABLE is there, not the printer.

If anyone knows how I could get a signal back from this system call
(or some other system call that would work better) I'd very much
appreciate your input.  I'm just SO close to getting this thing done.

We'd still like to pursue the option of using an ink jet in the future
(or at least find out if it is even POSSIBLE).  I've tried to enlist
T.S. to help me with this whole printer issue and offered to pay them
for their time.  They're too busy.  They said they'd have a consultant
contact me but that never happened.  I'm a bit disappointed with their
support at this point.

Thanks to everyone for your help.
Ed






 
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/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU