LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-24-2006, 11:43 AM   #1
Hacker X
Member
 
Registered: Jun 2006
Location: Urbana, Illinois, US
Distribution: Zenwalk, Vector
Posts: 76

Rep: Reputation: 15
ppp chat script failed


Trying to get a dial-up going on Zenwalk 2.6 (slack based). Ran pppsetup, accepted the default init string. Run ppp-go, exits with "Connection script failed", no other info echoed or in /var/log/syslog. Added a verbose option (chat -e -V) to ppp-go, and something echoed the string "^@^@", whatever that means. Man pages don't seem helpful. Is there some magic incantation I'm missing? What's the next step?

Last edited by Hacker X; 06-24-2006 at 11:44 AM.
 
Old 06-24-2006, 10:53 PM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
From http://www.slackware.com/config/ppp.php :

Quote:
In Slackware we have included a program called pppsetup to configure your system to use your dialup account. It shares a look and feel similar to our netconfig program.

[ snip ]

After the program runs, it will create a ppp-go program and a ppp-off program. These are used to start and stop, respectively, the PPP connection. The two programs are located in /usr/sbin and need root priviledges to run.
Is the "program" ppp-go perchance a script? (Try looking at it with a text editor or the program less.) If so, are you familiar with that scripting language? Usually the first line will be something like
Code:
#!/bin/bash
Which in this case indicates it is a bash script.

Also, from the same webpage (link above), there are several scripts in /etc/ppp which might be useful to look at.

I believe the ^@^@ represent two null ascii characters, i.e. characters whose hex value is zero. But I have no idea what they mean.

I hope this can get you started. (I have no idea how much you know about scripts.) Post back with additional questions or info.
 
Old 06-25-2006, 02:18 PM   #3
Hacker X
Member
 
Registered: Jun 2006
Location: Urbana, Illinois, US
Distribution: Zenwalk, Vector
Posts: 76

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by blackhole54
Is the "program" ppp-go perchance a script?

I believe the ^@^@ represent two null ascii characters, i.e. characters whose hex value is zero. But I have no idea what they mean.
Thanks for responding.

Yes, ppp-go is a sh/bash script. I added a -v option that calls chat with more verbosity. Now it's calling "chat -evsV". After a few "abort on ..." lines, the output looks like this:

send (AT&FH0^M)
expect (OK)
^@^@alarm
Failed

So I'm guessing the ^@^@ isn't good

I tried experimenting with the modem speed in /etc/ppp/pppscript, and this output occurred through the whole range, from 9600 to the highest speed mentioned in pppsetup.

I found a web page that says to try "cat /dev/ttySN" to test your modem device, where N is the device number. No output means it's there, I/O error means it's not. I set the modem to ttyS0 in pppscript, and "cat /dev/ttyS0" returns no output with no error, whereas "cat /dev/ttyS[1-4]" returns an error. So I think I have the right device file.

The modem is a Rockwell
RCVDL56ACF/SP
R6761-21
COM ID RSS0250, ISAPNP\RSS 0250

That's what I know about the modem.

This is a fresh install of the OS as of a day or two ago. The installer didn't say anything about a modem driver, so I don't know whether it found the driver itself or just did nothing. Is there a way to check that? Is the driver's presence implied by "cat /dev/ttyS0"? I'll see if dmesg says anything.

btw, is this the best forum to post this question on? Is there another forum that would be good to cross-post it on? The Slack forum? Hardware? Software? Don't want to bug too many people

Thanx for the help.

Last edited by Hacker X; 06-25-2006 at 02:30 PM.
 
Old 06-25-2006, 10:57 PM   #4
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by Hacker X
is this the best forum to post this question on? Is there another forum that would be good to cross-post it on?
I don't know what the best forum is to post this on, but you are not supposed to post the same thing on more than one forum. If moderators become aware that you have done so, they will move or delete posts. You can, however, "tag" your post with relevant tags to attract people's attention to it. Look down at the bottom of your posts to see how to do this. (This rule keeps things simple. For example if somebody else is helping you also, it is useful for me to see those posts to reduce duplication and increase cooperation/synergy.)

Quote:
Originally Posted by Hacker X
I found a web page that says to try "cat /dev/ttySN" to test your modem device, where N is the device number. No output means it's there, I/O error means it's not. I set the modem to ttyS0 in pppscript, and "cat /dev/ttyS0" returns no output with no error, whereas "cat /dev/ttyS[1-4]" returns an error. So I think I have the right device file.
The info about cat sounds right if you run as root. Just be aware that when I have brute forced things using cat on serial lines, I have occasionally hosed things. :-( If you want to try a slightly more sophisticated test to see if you can talk to your modem, see if your system has minicom. Check out the man pages before you try to use it -- you must first run it as root with the -s option to configure it before it can be used by normal users. After configuring, try it as a normal user. If it comes up w/o errors, try giving it an ATZ command. This is the initialization command and it should respond OK. If this works fine, try that AT&FH0 command that seems to have failed in your script. (The ^M at the end just indicates a carriage return.) You can also try dialing your ISP with the command ATDT followed by the telephone number (e.g. ATDT5551212). If you connect succesfully, I would just drop the connection by first hitting three "plus signs" in rapid succession (which tells the modem to stop paying attention to the telephone line and come back to command mode) followed by ATH0 (the last character is a zero), which tells the modem to hang up.

One more thing. You say your modem is on /dev/ttyS0. On older computers, this would usually be a built in serial line on the motherboard. If your modem is external, all is well. If your modem is internal (a quick google on your model didn't help me determine), make sure it isn't conflicting with a built in serial line.

Quote:
Originally Posted by Hacker X
Yes, ppp-go is a sh/bash script.
If all went well with your minicom test, you can modify your ppp-go script so it shows you every line as it executes. Use your favorite text editor to add
Code:
set -x
at the beginning of the script. This might produce a lot of output when you run it, so might might need to pipe the output to less.

Look into "tagging" your post.
Again, post back as needed.
Good luck.

Last edited by blackhole54; 06-25-2006 at 11:02 PM.
 
Old 06-25-2006, 11:32 PM   #5
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Exclamation

If all went well with your minicom test, you can modify your ppp-go script so it shows you every line as it executes. Use your favorite text editor to add
Code:
set -x
at the beginning of the script.

Oops!!! I should have set put "set -x" on the second line ... after the #!/bin/[ba]sh line!
 
Old 06-26-2006, 12:06 AM   #6
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Lightbulb Null Bytes

Sorry for this succession of posts, but I just had an idea what those two null bytes (^@^@) might be. They could be what the script is seeing coming back from the modem in response to AT&FH0 instead of the expected OK. This would suggest a problem communicating with the modem (a conflict between devices?). This would probably best be investigated with minicom, as I suggested above.
 
Old 06-26-2006, 02:14 AM   #7
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
What about /etc/ppp/options what does it contains?
Add "debug" to see if it is pppd the problem (errors go to /var/log/daemon or /var/log/messages). Also, adding "crtscts" and "modem" can help.
 
Old 06-26-2006, 08:45 PM   #8
Hacker X
Member
 
Registered: Jun 2006
Location: Urbana, Illinois, US
Distribution: Zenwalk, Vector
Posts: 76

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by blackhole54
If you want to try a slightly more sophisticated test to see if you can talk to your modem, see if your system has minicom. ... If it comes up w/o errors, try giving it an ATZ command. This is the initialization command and it should respond OK. If this works fine, try that AT&FH0 command that seems to have failed in your script. (The ^M at the end just indicates a carriage return.)
How do you get minicom to take typed input? It doesn't echo anything I type in. All I've been able to do is use the Ctrl-A commands, and it failed when I tried to dial.

Quote:
One more thing. You say your modem is on /dev/ttyS0. On older computers, this would usually be a built in serial line on the motherboard. If your modem is external, all is well. If your modem is internal (a quick google on your model didn't help me determine), make sure it isn't conflicting with a built in serial line.
I'm not sure everything is set up correctly. When the machine was running W98 a couple weeks ago (now overwritten by Linux), it said the modem was on COM2, and the jumpers on the card are set to IRQ 3. It's a separate card plugged into the big long black socket way at the bottom of the motherboard, which is mounted on the side of the case. There are two shorter white sockets above it, and something plugged into the motherboard just above the modem card. This other thing is a very small card with a big black connector on the outside of the case that looks like an oversized phone jack. I don't know what it's for.

Anyway, the minicom man page says the modem is usually on ttyS1, and the setserial man page says ttyS0 should have IRQ 4 and ttyS1 should have IRQ 3. But the Zenwalk installer found a modem on ttyS0, not ttyS1, and setserial -a says "UART: 16550A" for ttyS0, but "UART: unknown" for ttyS1, plus catting ttyS1 returns a device error.

So it almost sounds like the modem is on ttyS1/COM2, but the installer somehow didn't figure that out so it didn't setup the modem correctly(?).

Isn't there some sort of command-line utility to sort all this out? ppp, chat, and minicom all seem to assume the modem is setup already.

Last edited by Hacker X; 06-26-2006 at 08:50 PM.
 
Old 06-26-2006, 09:12 PM   #9
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
Quote:
Originally Posted by Hacker X
How do you get minicom to take typed input? It doesn't echo anything I type in. All I've been able to do is use the Ctrl-A commands, and it failed when I tried to dial.
The command is Ctrl-A E to put it to "echo on"

Quote:
Isn't there some sort of command-line utility to sort all this out? ppp, chat, and minicom all seem to assume the modem is setup already.
There's pppconfig and wvdial. Wvdial search all devices. You may try this one.
 
Old 06-27-2006, 12:32 AM   #10
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by Hacker X
How do you get minicom to take typed input? It doesn't echo anything I type in.
Either you are not actually talking to the modem or (less likely) your modem is not set up to echo characters back. You could turn local echo on as primo suggested. However, when I do that, I get each character echoed twice -- once from the local echo and once from the modem echoing.



Quote:
Originally Posted by Hacker X
I'm not sure everything is set up correctly. When the machine was running W98 a couple weeks ago (now overwritten by Linux), it said the modem was on COM2, and the jumpers on the card are set to IRQ 3. It's a separate card plugged into the big long black socket way at the bottom of the motherboard, which is mounted on the side of the case. There are two shorter white sockets above it, and something plugged into the motherboard just above the modem card. This other thing is a very small card with a big black connector on the outside of the case that looks like an oversized phone jack. I don't know what it's for.
I think you are aware that MS's "com2" corresponds to /dev/ttyS1. It sounds like you are describing (your modem card) an ISA card which I supect is manually jumpered both for its IRQ and for its I/O address. That is how my internal modem is. That other card sounds like it could be an ethernet card.


Quote:
Originally Posted by Hacker X
Isn't there some sort of command-line utility to sort all this out? ppp, chat, and minicom all seem to assume the modem is setup already.
You might be right about us not knowing where the modem is. I would suggest you first look at your logs to see what the kernel finds when it boots. In my /var/log/messages file, I find these lines:

Code:
Jun 18 22:13:26 Vectra kernel: ttyS00 at 0x03f8 (irq = 4) is a 16550A
Jun 18 22:13:26 Vectra kernel: ttyS01 at 0x02f8 (irq = 3) is a 16550A
Jun 18 22:13:26 Vectra kernel: ttyS03 at 0x02e8 (irq = 3) is a 16550A
The first two lines are the built-in serial lines on my motherboard. The last line is my internal modem. (That IRQ conflict is taken care of later by a setserial command in my rc.local file.) I don't know why it lists a leading zero on the devices; the actual devices are /dev/ttyS3, etc.

Your log entries should give you an idea of what your choices are on when you look for your modem.

As far a command line tool, all I know is using cat and echo as follows:
If you are in a graphical environment you can open up two terminal windows and try to talk to the modem manually. (If not in a GUI, you can use two virtual terminals. But a GUI is better, because if things run away -- and they might -- you can kill things by simply closing the windows.) In both windows use su to become root. In one window, listen like you did before using cat,
e.g. cat /dev/ttyS0. In the other window you can send commands, e.g. echo "ATZ" > /dev/ttyS0.

You already know about setserial. In this excercise, the stty command can also be relevant. It controls a bunch of higher level functions of the port, including echoing. Software like pppd and minicom handle these settings for you. When you brute force things like I describe above, you are on your own. When I first tried this back when, I had both the modem and port echoing to each other, and as soon as I sent the first command, it went into a perpetual, viscous cycle! Other times I totally hosed things. Never knew how. But worse case scenario, it was nothing a reboot wouldn't fix.

I hope this helps you get a little further.
 
Old 06-27-2006, 08:40 PM   #11
Hacker X
Member
 
Registered: Jun 2006
Location: Urbana, Illinois, US
Distribution: Zenwalk, Vector
Posts: 76

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by blackhole54
I think you are aware that MS's "com2" corresponds to /dev/ttyS1. It sounds like you are describing (your modem card) an ISA card which I supect is manually jumpered both for its IRQ and for its I/O address. That is how my internal modem is.
Yes, it has a manual jumper.

Quote:
That other card sounds like it could be an ethernet card.
Yes, that sounds right.

Quote:
You might be right about us not knowing where the modem is. I would suggest you first look at your logs to see what the kernel finds when it boots.
This is what /var/log/messages says:

Code:
zenwalk kernel: serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
That's all it says. No other ttySN entries, either for other devices found or for errors or failed attempts.

Quote:
As far a command line tool, all I know is using cat and echo as follows:
If you are in a graphical environment you can open up two terminal windows and try to talk to the modem manually.
In one window, listen like you did before using cat, e.g. cat /dev/ttyS0. In the other window you can send commands, e.g. echo "ATZ" > /dev/ttyS0.
No response. I tried moving the jumper to irq 4, but there was still no response. I only changed the irq, nothing else.
 
Old 06-27-2006, 10:34 PM   #12
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Quote:
Originally Posted by Hacker X
This is what /var/log/messages says:

Code:
zenwalk kernel: serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
That's all it says. No other ttySN entries, either for other devices found or for errors or failed attempts.


No response. I tried moving the jumper to irq 4, but there was still no response. I only changed the irq, nothing else.
OK, we're scraping the bottom of the barrel here. These are desperation questions/suggestions:
  1. Do you know for sure whether this modem worked when the computer had Win98 on it?
  2. How is the I/O address of the card jumpered? My modem has jumper positions labelled COM1 through COM4. Of course, your's may have hex numbers like 03F8 or some other scheme.
  3. Try booting your computer w/o the modem card and see what (if any) serial ports are reported in /var/log/messages.
If you are starting to move jumpers around on the card, I would recommend you make a written note (perhaps picture) of where the jumpers were originally positioned. This is always good practice, so when you've gotten yourself thoroughly confused while trying everything under the sun (yeah, I've been there, done that! ) you can return to your starting point.

(later)

With regard to #2 above, I just searched some Linux hardware compatibility lists. If I found the right thing and read the list right, it looked like both PnP and jumpers were checked. So perhaps the address is PnP, or perhaps can be jumpered either PnP or a manual address? I hope this is not a "winmodem" or "software modem." See what you can figure out from the jumpers, or lack thereof. Also, feel free to google.
 
Old 06-28-2006, 08:17 PM   #13
Hacker X
Member
 
Registered: Jun 2006
Location: Urbana, Illinois, US
Distribution: Zenwalk, Vector
Posts: 76

Original Poster
Rep: Reputation: 15
Progress!

Okay, we're dialing.

Quote:
Originally Posted by blackhole54
3. Try booting your computer w/o the modem card and see what (if any) serial ports are reported in /var/log/messages.
That was a very good idea. Thank you. ttyS0 was still there with the card out, so maybe it's the ethernet card?

I learned from the PCI and ISA wikis that the big black slot is an ISA port. The card has three sets of jumpers, including one for the IO address and one for the IRQ. The third set has three jumpers, but the key lists only two options: PNP and COM. The card was set to PNP and the address and IRQ for COM4/ttys3. I changed them to COM and the settings for COM2/ttyS1.

ttyS1 is now showing a 16550A UART, and pppd is dialing out. This distribution doesn't seem to have isapnp, so maybe the system wasn't able to configure the ISA card.

Quote:
I hope this is not a "winmodem" or "software modem."
No, but there may be a problem with data compression. I've been working with the modem howto, which I found a couple days ago. It says some old Rockwell modems need a special driver for compression, which isn't ported to Linux.
 
Old 06-28-2006, 08:24 PM   #14
Hacker X
Member
 
Registered: Jun 2006
Location: Urbana, Illinois, US
Distribution: Zenwalk, Vector
Posts: 76

Original Poster
Rep: Reputation: 15
Anyway, this is a BIG step forward.

I ran pppsetup, which created /etc/ppp/[options && pppscript] with ttyS1 and all the info for my ISP and userid. Now pppd does this:

Code:
AT&FH0
OK
atdt#######
CONNECT 57600
Connect script failed
So what exactly is the failure? Verbose mode just double-echos every character and says things like "alarm" and "Failed".

Also, this disrtibution doesn't seem to have wvdial either, not even in /sbin or /usr/sbin.

Last edited by Hacker X; 06-28-2006 at 08:26 PM.
 
Old 06-28-2006, 09:44 PM   #15
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
I am glad you can at least now talk to the modem!!! You probably gathered from my last post that I was beginning to fear the worst.

Quote:
Originally Posted by Hacker X
So what exactly is the failure?
I can't read minds any better than you can.

Seriously, you might check /var/log/messages to see if there is anything there. Also, on post #3 you reported ppp-go giving messages like:
Code:
send (AT&FH0^M)
expect (OK)
You can't get it to do that sort of thing anymore? Or is there just no info after CONNECT? You can also try my old suggestion of editing ppp-go (adding set -x) so that it outputs what it is doing when the failure occurs.

Quote:
Originally Posted by Hacker X
Also, this disrtibution doesn't seem to have wvdial either, not even in /sbin or /usr/sbin.
You can try to download and install it. I have never used slackware, so I can't give you any help in that department. wvdial is what I use. It is pretty good about logging info to the system log.

BTW, an ethernet card should not show up as a serial port. I am guessing you have a serial port on your motherboard.
 
  


Reply

Tags
chat, device, modem, ppp, pppd, serial, slackware, zenwalk


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PPP library & pppd, chat return codes ruchika Linux - Networking 1 03-08-2011 02:50 AM
Connect script failed on ppp-go iqbala Linux - Newbie 39 11-15-2007 02:58 PM
unautomate PPP chat script dosnlinux Linux - Newbie 3 08-03-2005 01:24 PM
problems with ppp and chat.... slack---line Linux - Networking 3 05-27-2004 10:10 AM
chat ppp jimjim Linux - Networking 5 09-26-2002 11:05 PM


All times are GMT -5. The time now is 12:58 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration