Bug 23325

Summary: wvdial and rp3 fails to init some modems
Product: [Retired] Red Hat Linux Reporter: Need Real Name <fherrera>
Component: wvdialAssignee: Harald Hoyer <harald>
Status: CLOSED WONTFIX QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-05-15 10:13:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2001-01-04 16:32:06 UTC
rp3 and wvdial fails when they are trying to initialize some modems. But
wvdialconf works fine. The config program send two times a "query" string
and the first one is ignored, but the second is ok:
ttyS1<*1>: ATQ0 V1 E1 -- ATQ0 V1 E1 -- OK

Some modems ignore the first thing they get sent after the program
starts... (may be some kind of weird delay after the DTR signal gets
raised).

The problem is that wvdial (and rp3) dial initialization only use a try,
and this kind of modems cannot be initialized.
I have wrote a patch and tested it with 3 different modems:Digicom v34, 
56k Bets Buy and US Robotics 56k. All works fine with the patch (without
it, only the US Robotics worked).

It's very simple: If it can be initialize the modem, try two times more :-)
Here is it:
--- wvdialer.cc.orig	Thu Jan  4 16:56:30 2001
+++ wvdialer.cc	Thu Jan  4 17:08:50 2001
@@ -460,10 +460,14 @@
 	               this_str = &options.init9;	break;
     	}
     	if( !! *this_str ) {
-    	    modem->print( "%s\r", *this_str );
-    	    log( "Sending: %s\n", *this_str );
+            int init_tries = 0;
+	    do {
+		init_tries++;
+    	    	modem->print( "%s\r", *this_str );
+    	    	log( "Sending: %s\n", *this_str );
+    	    	received = wait_for_modem( init_responses, 5000, true );
+	    } while (init_tries<=3 && received == -1); 
 
-    	    received = wait_for_modem( init_responses, 5000, true );
     	    switch( received ) {
     	    case -1:
     	    	err( "Modem not responding.\n" );

Comment 1 Need Real Name 2003-02-26 17:56:06 UTC
Hi, I remeber this bug every time I update my redhat system (need to copy the
patched version of wvdial). Am I the only person in the world with this problem?
If true, we can close the bug...

Thanks!

Comment 2 Harald Hoyer 2005-07-08 15:25:57 UTC
is this still an issue?