You are not logged in.

#1 2010-01-26 19:45:31

ash
Member
Registered: 2008-12-17
Posts: 134

Serial printer won't just print when i 'dd' to it ?

In an office i help to set up there is a windows box connected to a genicom 6218 printer thru serial EIA232 port.
There is also an older genicom LA36N dot matrix printer laying around.
The windows box has a legacy application that communicates directly with the printer bypassing all the windows printing system
All connections are made with 3 wire null modem cables - tx rx earth. no advanced control signals

YAY SIMPLE TEXT PRINTERS. LETS PLAY WITH 'EM. So i brought in my linux box

When the LA36N is hooked up to the linux box ttyS0 then dd'ing or cat'ing a text file to /dev/tyS0 prints it okay. as expected.

When doing the same with the 6218 it prints half line of some random gibberish (not the text file contents) and stops. if switched to 'offline' then back to 'online' it prints some more and stops. and 2 - 3 times more like that (untill the buffer in the printer is empty ?). the same happens with 'echo "HI" |cat >/dev/ttyS0' too (the amount of gibberish is still few lines long)

I made a 'null modem Y - splitter' cable (where 2 ports are parallel for the receiving devices and in 1 the tx and rx are crossed for the transmitting device) and connected together

Windows box ====x==== linux box = printer

Then printed a document from the application while dd'ing from ttyS0 to a text file on the linux box.
With both printers the resulting text file is identical when printing the same document. Both printers successfully printed the document

Now i connect the printer just to the linux box without the Y cable and dd the file back to the printer.
Again - the 6218 prints gibberish in pauses and the LA36N prints ok

So the question is : Isn't the data being dd'ed to the printer the exact same as when the windows box printed ? Why does the 6218 treat it differently ? 'How does it know' ?

Maybe it something to do with signals sent back to the computer ? well it's not
I connected the Y cable like this

Windows box = linux box ====x==== printer

Then printed a document & dd'ed again with both printers.
In both cases the resulting file is empty - ie there is nothing sent back from the printer to the host

Offline

#2 2010-02-01 02:15:14

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,334

Re: Serial printer won't just print when i 'dd' to it ?

I am not following everything you did, but your problem may be:
Data size (7 vs 8 bit)
Stop length (1 or 2 bit periods)
Parity (even, odd, mark, space)

If the 6218 is finicky about parity it might trip over whatever parity is being sent by the linux box while being compatible with the windows box.  The LA36 may not care about parity.

I am puzzled by the several lines of gibberish in response to "HI" being sent.   Normally I would a Baud mismatch at that point, but both machines work with (I assume) the same settings on the Windows box.

You may want to try different parity settings on the linux box and see what happens.

<pedantic mode>You refer to the reference signal on the cable as "Earth".  In reality, it is a reference signal that may or may not find its way to "Earth" or "Ground".  It should always be kept isolated from the chassis to minimize ground (earth) loops in order to maximize your signal integrity.  In your description of your cross over cable, you did not explicitly state that you included a signal ground.  If you did only swap pins 2 and 3, then you are depending on chassis grounds between 2 or 3 boxes.  This is a bad idea.  Ensure you tie all signal grounds on your cables (pin 7 on a DB-25 or pin 1 on DB-9)</pedantic mode>


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB