[ale] Configure serial port settings at boot

Lightner, Jeff JLightner at dsservices.com
Mon Dec 8 09:28:55 EST 2014


Back in the 90s when I did lots of printers we used software flow control (XON/XOFF) which only used ports 2,3 & 7 (TX,RX and ground) but some printers still fired on some extra pins even when configured for software flow control.   4 and 5 are CTS and RTS and we usually looped those back to each other.   Also we used to loop back 3 other pins to each other which I don't exactly recall but based on the link below I believe were 6, 8 & 20.
http://www.digi.com/support/kbase/kbaseresultdetl?id=868

We did that by buying RJ45 to DB25 modular connectors and tieing the wires together within that.


-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Alex Carver
Sent: Sunday, December 07, 2014 2:41 AM
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] Configure serial port settings at boot

The printer doesn't have pins for the hardware flow control.  It just has TX, RX and ground.  I had tracked the problem I was originally having down to some control codes being consumed and dropped by the serial driver so they would never make it to the printer.  The printer, when printing raster graphics, is first put into raster mode with an ESC sequence then a second ESC sequence tells it the number of bytes per row in a bitmap.  Each bitmap row is then started with SYN and followed by the n-bytes of row data.  Problem was, for some patterns, the byte looked like a control code and was stripped.  So the whole thing would go out of sync because a row was transmitted with a missing byte (or more).

If data doesn't start with a SYN and no other mode is turned on it assumes literal data and prints the matching ASCII character.  So dropping one byte from the row data throws off all the SYN locations and the printer output is corrupted.  Once I flip the raw mode on the serial port, everything goes through unaltered and the printer is happy.


On 2014-12-06 16:08, Chris Fowler wrote:
> ----- Original Message -----
> 
>> From: "Alex Carver" <agcarver+ale at acarver.net>
>> To: "Atlanta Linux Enthusiasts" <ale at ale.org>
>> Sent: Saturday, December 6, 2014 5:17:56 PM
>> Subject: Re: [ale] Configure serial port settings at boot
> 
>> Ok, thanks to Jim, JD and Chris, rc.local appears to be the way to go 
>> and is relatively easy.
> 
>> I'm not using a script. This is for lpd with a label printer attached 
>> to the serial port so technically the port is always in use. The 
>> problem is that a cooked mode serial port will eat some of the bitmap 
>> data and cause much confusion for the printer when its bitmap 
>> suddenly vanishes. Eight bit raw mode is all the printer needs to 
>> make sure the labels print properly. I can't configure the port 
>> within lpd other than the baud rate so I have to change the mode externally with stty.
> 
> You may want hardware flow control. I've been down this road many times, but it was back in the 90s. 
> 
> 
> 
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at 
> http://mail.ale.org/mailman/listinfo
> 

_______________________________________________
Ale mailing list
Ale at ale.org
http://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo



More information about the Ale mailing list