[ale] Configure serial port settings at boot
Alex Carver
agcarver+ale at acarver.net
Sun Dec 7 02:41:15 EST 2014
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
>
More information about the Ale
mailing list