Bug 206398

Summary: serial printer test fails errenously
Product: [openSUSE] SUSE Linux 10.1 Reporter: Dennis Lubert <plasmahh>
Component: YaST2Assignee: Michal Zugec <mzugec>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None    
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: suggested patch for Printerlib.ycp.diff

Description Dennis Lubert 2006-09-17 22:16:35 UTC
Hi,

during testing a EPSON TM-T88II printer (sadly its not supported) I discovered that when installing a serial printer (maybe its also with a lpt, but I could not test) there is the string "Hell World" send to the printer. But at least my printer, and I believe lots of others only react when a CRLF sequence is sent to the printer. So the printer does not react, which looks like it failed, but when you "echo -en \r\n > /dev/ttyS0" you get the text yast tried to send. So I suggest that yast does not only send hello world to test, but also appends  CRLF.

greets

Dennis
Comment 1 Johannes Meixner 2006-09-21 06:30:42 UTC
To clarify:
Please report for each of the following tests
which one does not print and which one does print:

echo -en 'Hello' >/dev/ttyS0

echo -en '\rHello\r\f' >/dev/ttyS0

echo -en '\r\nHello\r\n' >/dev/ttyS0

echo -en '\r\nHello\r\n\f' >/dev/ttyS0

By the way:
If your printer can print plain ASCII text and if it is sufficient
for you to print only plain ASCII text, have a look at
http://en.opensuse.org/SDB:Using_Your_Own_Filters_to_Print_with_CUPS
Comment 2 Johannes Meixner 2006-09-21 06:48:40 UTC
Michal,
I detected that /usr/lib/YaST2/bin/test_device kills all processes
which may currently use the device.
This may be annoying if currently a (large) print job is printed
via this device.
I suggest to be more polite and exit with a matching exit code
if the device is currently in use e.g.:
-------------------------------------------------------------------------
cat /dev/null >$2 || exit 3
-------------------------------------------------------------------------
and in case of this exit code show an appropriate message
to the user, e.g. something like
"the device is currently in use, wait a bit and retry later"

By the way:
I don't understand when /usr/lib/YaST2/bin/test_device
exits with exit code 2.
Comment 3 Dennis Lubert 2006-09-21 12:24:45 UTC
Before sending each cmd, I have reset the printer, so as if it was freshly started...

echo -en 'Hello' >/dev/ttyS0
does nothing

echo -en '\rHello\r\f' >/dev/ttyS0
does nothing

echo -en '\r\nHello\r\n' >/dev/ttyS0
feeds one line, prints Hello, then feeds again

echo -en '\r\nHello\r\n\f' >/dev/ttyS0
feeds one line, prints Hello, then feeds again

PS: Plain ascii isn't sufficient. I am currently trying to write a program to control the printer, since a printer driver isn't available.
Comment 4 Johannes Meixner 2006-09-21 12:42:28 UTC
Created attachment 99322 [details]
suggested patch for Printerlib.ycp.diff

Michal,
please change YaST so that it does
  echo -en '\r\nHello\r\n\f' >...
Comment 5 Johannes Meixner 2006-09-21 12:54:33 UTC
Regarding comment #3:

Does
echo -en '\r\nHello\r\n\f' >/dev/ttyS0
not do a formfeed?

Does
echo -en '\r\nHello\r\n\f\n' >/dev/ttyS0
do a formfeed?
Comment 6 Michal Zugec 2006-10-17 08:29:19 UTC
patch submitted, thanks
Johannes: I will implement warning without force killing in comment #2 later