9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] fax
@ 2001-06-03 20:43 rob pike
  2001-06-03 21:25 ` Boyd Roberts
  0 siblings, 1 reply; 5+ messages in thread
From: rob pike @ 2001-06-03 20:43 UTC (permalink / raw)
  To: 9fans

> exit 0?  surely exit 1.

Surely
	exit usage



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] fax
  2001-06-03 20:43 [9fans] fax rob pike
@ 2001-06-03 21:25 ` Boyd Roberts
  0 siblings, 0 replies; 5+ messages in thread
From: Boyd Roberts @ 2001-06-03 21:25 UTC (permalink / raw)
  To: 9fans

> Surely
> exit usage

yup, just me being exits() impaired.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [9fans] FAX
@ 2005-04-03  6:07 lucio
  0 siblings, 0 replies; 5+ messages in thread
From: lucio @ 2005-04-03  6:07 UTC (permalink / raw)
  To: 9fans

I have a ZyXEL U-1496E (Plus) that seems to jam solid when sending
faxes using telco/sendfax, but operates reasonably (I can't check the
receiving end) if I send the same G3 images using mgetty+sendfax under
NetBSD.

It seems to freeze waiting for the OK at the end of the first page,
whereas mgetty+sendfax has no such problem with the first or the
second/last page (that's as much as I felt I needed to try).

Thing is, I can't see a significant difference between the two
operations, other that mgetty shuts down carrier detection in the tty
driver (CLOCAL mode, I think) once it gets going.  From the modem
lights, this shouldn't matter, as the CD indicator remains on while
the failure occurs, while, perhaps very relevant, CTS goes off.

The actual conversation with the modem is slightly different between
the two utilities, but I could not detect a significant deviation.
These are my ZyXEL settings, in telco.c:

	 {	"ZyXEL",	"ATI0",	"1496",	0,
		"AT&K4",	/* error correction */
		"AT&N0",	/* autonegotiate */
		"AT&H3",	/* CTS/RTS flow control */
		"AT&B1",	/* don't change port baud rate */
	 	"AT+FCLASS=2\rAT+FBOR=0\rAT+FCR=1",	// AT+FDIS=1??
		"AT+FCLASS=0",
	 },

I have also taken the liberty to replace a meaningless ATZH0 in
telco.c:/ATZ to the more reasonable ATZ, but this is purely esthetic.
Interestingly, attention() fails, once the modem has been jammed by a
fax sending session and telco seems to hang after two attention()
attempts, but I can't seem to find where in the code this happens.
Don't assign too much value to this, I have not investigated it in any
real detail.

In /sys/src/cmd/fax/fax2send.c:/FDT, I removed the geometry arguments
and sent a bare AT+FDT as is done in mgetty in an attempt to change
the outcome, but it made no difference.  It seems to me that the major
problem lies with hardware control (the CTS line remaining off, so
that it looks like the end-of-page command does not reach the modem at
all).  This is borne out by the fact that the session hangs and does
not recover until I drop the link from the modem front panel (or
whatever would trigger a modem reset, I suppose).

I was under the impression that hardware flow control wasn't
implemented on the async ports, I'm pleased to learn otherwise, but
now I wonder how to deal with it, I suppose.

I will send recent logs from both Plan 9 and Unix if anybody wants to
inspect them.

++L



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] fax
  2001-06-02 21:45 [9fans] fax rob pike
@ 2001-06-03 20:34 ` Boyd Roberts
  0 siblings, 0 replies; 5+ messages in thread
From: Boyd Roberts @ 2001-06-03 20:34 UTC (permalink / raw)
  To: 9fans

From: "rob pike" <rob@plan9.bell-labs.com>
>
> switch($#*){
> case 0 1
> echo usage: $0 telephone-number recipient [files]
> exit 0
> case 2
> stdin=yes
> }

exit 0?  surely exit 1.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [9fans] fax
@ 2001-06-02 21:45 rob pike
  2001-06-03 20:34 ` Boyd Roberts
  0 siblings, 1 reply; 5+ messages in thread
From: rob pike @ 2001-06-02 21:45 UTC (permalink / raw)
  To: 9fans

Presto had already fixed our fax script; here is the complete file
/rc/bin/fax


#!/bin/rc
view=no
stdin=no

switch($1){
case -v
	view=yes
	shift
}

switch($#*){
case 0 1
	echo usage: $0 telephone-number recipient [files]
	exit 0
case 2
	stdin=yes
}

telno=$1
shift

switch($telno){
case [0-9]*
	;
case *
	echo usage: $0 telephone-number recipient [files]
	exit 0
}

switch($telno){
case ???????
	telno='*9,'^$telno
case ??????????
	telno='*9,1'^$telno
case 1??????????
	telno='*9,'^$telno
case 011*
	telno='*9,'^$telno
case +*
	telno=`{echo $telno | sed 's/\+/*9,011/'}
}

recip=$1
shift

script=/tmp/fax.$pid
header=/tmp/faxh.$pid
user=`{cat /dev/user}
tmp=/tmp/fax.g3.$pid
tmpin=/tmp/fax.in.$pid
tmpps=/tmp/fax.ps.$pid
tel=`{grep '\) '$user /lib/tel}
myname=`{echo $tel | sed 's/ \(.*//'}
ext=`{echo $tel | sed 's/.*\) [^ ]* [^ ]* ([^ ]*).*/\1/'}

fn sigint{
	rm -f $tmp.* $script $header $header.* $tmpin $tmpps
	exit interrupt
}

# gather input into a file
switch($stdin){
case yes
	cat > $tmpin
	infiles=$tmpin
case *
	infiles=($*)
}

# convert to g3
g3files=()
a=1
for(i in $infiles){
	switch(`{file $i}){
	case *:*g3* *:*fax*
		g3files=($g3files $i)
	case *:*postscript
		gs -dSAFER '-sDEVICE=dfaxlow' '-sOUTPUTFILE='$tmp'.'$#a'.%03d' -dNOPAUSE -dQUIET $i quit.ps
		g3files=($g3files $tmp.$#a.*)
	case *
		lp -dstdout $i > $tmpps
		gs -dSAFER '-sDEVICE=dfaxlow' '-sOUTPUTFILE='$tmp'.'$#a'.%03d' -dNOPAUSE -dQUIET $tmpps quit.ps
		g3files=($g3files $tmp.$#a.*)
	}
	a=($a $a)
}

pages=`{echo $g3files|wc -w}

echo -n 's/FAXddd/' > $script
echo -n `{date}>> $script
echo />> $script
echo -n s/FAXFFF/>> $script
echo -n $myname >>  $script
echo />> $script
echo -n s/FAXEEE/>> $script
echo -n $user >>  $script
echo />> $script
echo -n s/FAXVVV/>> $script
echo -n $ext >>  $script
echo />> $script
echo -n s/FAXTTT/>> $script
echo -n $recip >>  $script
echo />> $script
echo -n s/FAXfff/>> $script
echo -n $telno >>  $script
echo />> $script
echo -n s/FAXPPP/>> $script
echo -n $pages >>  $script
echo />> $script
sed -f $script /sys/lib/fax/h.ps > $header

gs -dSAFER '-sDEVICE=dfaxlow' '-sOUTPUTFILE='$header'.%03d' -dNOPAUSE -dQUIET $header quit.ps

files=()
for(i in $header.* $g3files){
	files=($files -f $i)
}

switch($view){
case no
	upas/qer $files /mail/faxoutqueue fax $user $telno < /dev/null
	rx dinar /sys/lib/fax/faxgoose
case yes
	page $header.* $g3files
}

#rm -f $tmp.* $script $header $header.* $tmpin $tmpps



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-04-03  6:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-03 20:43 [9fans] fax rob pike
2001-06-03 21:25 ` Boyd Roberts
  -- strict thread matches above, loose matches on Subject: below --
2005-04-03  6:07 [9fans] FAX lucio
2001-06-02 21:45 [9fans] fax rob pike
2001-06-03 20:34 ` Boyd Roberts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).