f



let 1 computer believe that thru USB/serial connector the other one is a HP printer ?

Hello,

I have the following problem:


I have a linux machine with usb ports. Its a factory machine on which
I cannot do anything (nor soft nor hardware changes).


The linux machine containes all the HP printer drivers. So connecting
an external HP printer thru USB is no problem.


Now I want to connect an other computer instead of a printer, so the
printout could be directly integrated into a Dbase.


I can connect both machines thru a usb/serial adaptor.


BUT the print to external printer only works if a external printer is
recognised.
So when connecting thru USB/serial - there is no 'handshaking'? and
thus the printing does not work.


Is there a way to send a message to the linux machine, via the com1
port on the other computer, that this com1 port is actually a HP
printer ?


Kind regards

0
6/2/2007 10:10:54 AM
comp.programming 11491 articles. 2 followers. Post Follow

5 Replies
538 Views

Similar Articles

[PageSpeed] 0

chapeau_melon <tomagneessens@hotmail.com> writes:
> I have a linux machine with usb ports. Its a factory machine on which
> I cannot do anything (nor soft nor hardware changes).
>
>
> The linux machine containes all the HP printer drivers. So connecting
> an external HP printer thru USB is no problem.
>
>
> Now I want to connect an other computer instead of a printer, so the
> printout could be directly integrated into a Dbase.
>
>
> I can connect both machines thru a usb/serial adaptor.
>
> BUT the print to external printer only works if a external printer is
> recognised.
> So when connecting thru USB/serial - there is no 'handshaking'? and
> thus the printing does not work.
>
>
> Is there a way to send a message to the linux machine, via the com1
> port on the other computer, that this com1 port is actually a HP
> printer ?

You will have to install the gadget drivers in the kernel of the other
computer, which allows this linux host to behave like a USB gadget.
You will then be able to implement the software necessary to emulate a
HP printer.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.
0
Pascal
6/2/2007 7:14:19 PM
Tx for your response, but I don't follow :(

How do I do that ?

Take into account that I have not access to linux on the linuxmachine.
The only thing I can do on that machine is to push a button that will
start the printing to an external printer that is to be connected to a
usb port on the linux machine.

I'd like to replace that external printer by a computer. I can connect
that external computer to the linux machine using a usb/serial
adapter.

How do I setup the com1 port on that exteral computer to tell the
linuxmachine it is actually a printer ?

Btw, on the linuxmachine there is a litte logo ; if it recognise an
external printer correctly, it and only than, enables printing to that
external printer !

Tx in advance

0
chapeau_melon
6/3/2007 6:20:58 AM
chapeau_melon <tomagneessens@hotmail.com> writes:

> Tx for your response, but I don't follow :(
>
> How do I do that ?
>
> Take into account that I have not access to linux on the linuxmachine.
> The only thing I can do on that machine is to push a button that will
> start the printing to an external printer that is to be connected to a
> usb port on the linux machine.
>
> I'd like to replace that external printer by a computer. I can connect
> that external computer to the linux machine using a usb/serial
> adapter.
>
> How do I setup the com1 port on that exteral computer to tell the
> linuxmachine it is actually a printer ?

I told you.  You install linux on that external computer, you compile
the gadget drivers in its kernel, and you reprogram the printer
firmware on that computer, to emulate the printer and gather the data.

You don't need to touch the linuxmachine that is doing the printing.


Of course, re-implementing the printer firmware will be very costly.
It would be much easier to have access to the linuxmachine, and to
configure a different printer to send the data to, like a remote spool
on the external computer which woull receive the data "unprinted" and
where you could easily do whatever you want with.  But if you can't
touch this linuxmachine, you have to have a lot of time or money...

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.
0
Pascal
6/3/2007 3:12:04 PM
Pascal Bourguignon <pjb@informatimago.com> writes:

> chapeau_melon <tomagneessens@hotmail.com> writes:
>
>> Tx for your response, but I don't follow :(
>>
>> How do I do that ?
>>
>> Take into account that I have not access to linux on the linuxmachine.
>> The only thing I can do on that machine is to push a button that will
>> start the printing to an external printer that is to be connected to a
>> usb port on the linux machine.
>>
>> I'd like to replace that external printer by a computer. I can connect
>> that external computer to the linux machine using a usb/serial
>> adapter.
>>
>> How do I setup the com1 port on that exteral computer to tell the
>> linuxmachine it is actually a printer ?
>
> I told you.  You install linux on that external computer, you compile
> the gadget drivers in its kernel, and you reprogram the printer
> firmware on that computer, to emulate the printer and gather the data.
>
> You don't need to touch the linuxmachine that is doing the printing.
>
>
> Of course, re-implementing the printer firmware will be very costly.
> It would be much easier to have access to the linuxmachine, and to
> configure a different printer to send the data to, like a remote spool
> on the external computer which woull receive the data "unprinted" and
> where you could easily do whatever you want with.  But if you can't
> touch this linuxmachine, you have to have a lot of time or money...

Well, actually there is a way to do it without reimplementing the
printer firmware, but you need the printer.  You only need to
implement a man-in-the-middle attack on th external computer.  All
communication between the printer driver in the linux machine and the
printer is forwarded unmodified by the external computer, but a copy
of the data is made.  You still have to decode the various level of
protocol and encoding, but it might be simplier than re-implementing
the firware of the printer.

+-------------------+      +----------------------------+    +---------+
| linuxmachine      |      |    external computer       |    | printer |
|     printerdriver-|------|-gadgetdriver-+ +-usbdriver-|----|         |
+-------------------+      |              | |           |    +---------+
                           |       keep a copy here     |
                           +----------------------------+

On the other hand, it might be quite difficult to get back the source
data from the bits sent to a printer.  But if you cannot touch
linuxmachine...

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.
0
Pascal
6/3/2007 3:18:02 PM
chapeau_melon wrote:
> 
> Tx for your response, but I don't follow :(
> 
> How do I do that ?

No idea.  You failed to quote properly.  See below.

-- 
 If you want to post a followup via groups.google.com, ensure 
 you quote enough for the article to make sense. Google is only
 an interface to Usenet; it's not Usenet itself. Don't assume
 your readers can, or ever will, see any previous articles.
More details at: <http://cfaj.freeshell.org/google/>



-- 
Posted via a free Usenet account from http://www.teranews.com

0
CBFalconer
6/4/2007 2:01:04 AM
Reply: