/dev/ttyUSB0 and PPP

Rick Stevens rstevens at vitalstream.com
Thu Feb 23 18:11:58 UTC 2006


On Wed, 2006-02-22 at 20:50 -0800, Harold Hallikainen wrote:
> > On Tue, 2006-02-21 at 19:49 -0800, Harold Hallikainen wrote:
> >> > On Sun, 2006-02-19 at 18:15 -0800, Harold Hallikainen wrote:
> >> >> > I'm trying to set up a ppp connection through my cellphone. I'm
> >> using
> >> >> a
> >> >> USB to EIA232 adapter on FC4_64. I can talk to the cellphone (send AT
> >> >> commands, dial, etc.) from GtkTerm using /dev/ttyUSB0 when logged in
> >> as
> >> >> root. As another user, I get permission denied.
> >> >> >
> >> >> > Desktop/SystemSettings/Network lets me define a modem device on
> >> ports
> >> >> such
> >> >> > as  dev/ttyS0, etc., dev/modem, dev/tty|1, dev/input/ttyACM0,
> >> >> dev/ttyM0,
> >> >> etc. But, no /dev/ttyUSB0.
> >> >> >
> >> >> > So... what do I do to set up a ppp connection on my cellphone modem
> >> on
> >> >> /dev/ttyUSB0?
> >> >> >
> >> >>
> >> >>
> >> >> Still working on this... A google search came up with the suggestion
> >> >> that
> >> >> I add
> >> >>
> >> >> ln -s /dev/ttyUSB0 /dev/modem
> >> >>
> >> >> to my /etc/rc.local . I've done that and am still having trouble
> >> getting
> >> >> ppp to dial out. I'm using the network configure menu
> >> >> desktop/SystemSettings/network. At one point, I could see it dial
> >> just
> >> >> the
> >> >> 1 dialing prefix, but not the rest of the number. Currently, it
> >> doesn't
> >> >> try to dial at all. Instead, I get "cannot connect to network device"
> >> >> when
> >> >> I try to activate it.
> >> >>
> >> >> As root, I can talk to the cellphone using gtkterm. As a non-root
> >> user,
> >> >> I
> >> >> get permission denied. Here's a little more info:
> >> >>
> >> >>
> >> >> [root at hhlaptop ~]# ls -l /dev/modem
> >> >> lrwxrwxrwx  1 root root 12 Feb 19 18:00 /dev/modem -> /dev/ttyUSB0
> >> >> [root at hhlaptop ~]# ls -l /dev/ttyUSB0
> >> >> crw-rw----  1 root uucp 188, 0 Feb 19 18:04 /dev/ttyUSB0
> >> >> [root at hhlaptop ~]#
> >> >>
> >> >>
> >> >> So... any ideas?
> >> >
> >> > Well, the first thing is to change the permissions on /dev/ttyUSB0.
> >> > You need to edit the /etc/udev/rules.d/50-udev.rules and change the
> >> >
> >> >     KERNEL=="ttyUSB*", GROUP="uucp", MODE="0660", OPTIONS="last_rule"
> >> >
> >> > line to read "MODE=0666" to permit world read/write operations, then
> >> > unplug the dongle and plug it back in.
> >> >
> >>
> >>
> >> THANKS Rick! After this change, gtkTerm can talk to the cellphone on the
> >> USB as a non-root user. I then tried the internet connection wizard. It
> >> exits with error 8. Here's what shows up in /var/log/messages:
> >>
> >> Feb 21 19:36:59 hhlaptop ifup-ppp: pppd started for home on /dev/modem
> >> at
> >> 19200
> >> Feb 21 19:36:59 hhlaptop kernel: CSLIP: code copyright 1989 Regents of
> >> the
> >> University of California
> >> Feb 21 19:36:59 hhlaptop kernel: PPP generic driver version 2.4.2
> >> Feb 21 19:36:59 hhlaptop pppd[3187]: pppd 2.4.2 started by root, uid 0
> >> Feb 21 19:37:00 hhlaptop wvdial[3203]: WvDial: Internet dialer version
> >> 1.54.0
> >> Feb 21 19:37:00 hhlaptop wvdial[3203]: Initializing modem.
> >> Feb 21 19:37:00 hhlaptop wvdial[3203]: Sending: ATZ
> >> Feb 21 19:37:05 hhlaptop wvdial[3203]: Sending: ATQ0
> >> Feb 21 19:37:05 hhlaptop wvdial[3203]: ATQ0
> >> Feb 21 19:37:05 hhlaptop wvdial[3203]: OK
> >> Feb 21 19:37:05 hhlaptop wvdial[3203]: Re-Sending: ATZ
> >> Feb 21 19:37:05 hhlaptop wvdial[3203]: ATZ
> >> Feb 21 19:37:05 hhlaptop wvdial[3203]: OK
> >> Feb 21 19:37:11 hhlaptop wvdial[3203]: stdin not read/write and $MODEM
> >> not
> >> set
> >> Feb 21 19:37:11 hhlaptop pppd[3187]: Connect script failed
> >> Feb 21 19:37:12 hhlaptop pppd[3187]: Exit.
> >>
> >>
> >> So, it looks like pppd is being passed device/modem, but wvdial is not
> >> able to communicate with it. I'm guessing the OK entries are the
> >> responses
> >> from the cellphone, so it looks like we're talking to it. So, what's the
> >> line at 19:37:11 mean?
> >
> > Have you edited /etc/wvdial.conf?  You have to set the MODEM variable in
> > the "Dialer Defaults" section of that file.  Something like:
> >
> > 	[Dialer Defaults]
> > 	Modem = /dev/ttyS0
> > 	Baud = 57600
> > 	Init = ATZ
> > 	Init2 = AT S11=50
> > 	Phone = 555-4242
> > 	Username = apenwarr
> > 	Password = my-password
> >
> > Full details are in the wvdial(1) and wvdial.conf(5) man pages.
> 
> 
> OK... Further note! The config file created by the gui looked reasonable.
> I changed the modem from /dev/modem to /dev/ttyUSB0 and tried again. I'm
> still getting "error 8" and similar log entries:
> 
> Feb 22 20:44:09 hhlaptop ifup-ppp: pppd started for home on /dev/modem at
> 19200
> Feb 22 20:44:09 hhlaptop kernel: CSLIP: code copyright 1989 Regents of the
> University of California
> Feb 22 20:44:09 hhlaptop kernel: PPP generic driver version 2.4.2
> Feb 22 20:44:09 hhlaptop pppd[3215]: pppd 2.4.2 started by root, uid 0
> Feb 22 20:44:10 hhlaptop wvdial[3231]: WvDial: Internet dialer version 1.54.0
> Feb 22 20:44:10 hhlaptop wvdial[3231]: Initializing modem.
> Feb 22 20:44:10 hhlaptop wvdial[3231]: Sending: ATZ
> Feb 22 20:44:15 hhlaptop wvdial[3231]: Sending: ATQ0
> Feb 22 20:44:15 hhlaptop wvdial[3231]: ATQ0
> Feb 22 20:44:15 hhlaptop wvdial[3231]: OK
> Feb 22 20:44:15 hhlaptop wvdial[3231]: Re-Sending: ATZ
> Feb 22 20:44:15 hhlaptop wvdial[3231]: ATZ
> Feb 22 20:44:15 hhlaptop wvdial[3231]: OK
> Feb 22 20:44:21 hhlaptop wvdial[3231]: stdin not read/write and $MODEM not
> set
> Feb 22 20:44:21 hhlaptop pppd[3215]: Connect script failed
> Feb 22 20:44:22 hhlaptop pppd[3215]: Exit.
> 
> 
> I think the key here is "stdin not read/write and $modem not set." The OK
> lines seem to be my modem (cellphone) responding to the AT commands. I did
> a Google search on the phrase quoted above, and it appears to be a common
> problem. My search has not yet revealed a solution. I'll continue the
> search, but would certainly appreciate any ideas!

Try changing the "Modem = /dev/ttyUSB0" to "MODEM = /dev/ttyUSB0" and
see.  Shell variables are case sensitive.  Since the error message is
bitching about "$MODEM", my guess is that it's looking for "MODEM = "
and not "Modem = ".

And if that fixes it, send a Bugzilla report about it.  That's nasty!
----------------------------------------------------------------------
- Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
- VitalStream, Inc.                       http://www.vitalstream.com -
-                                                                    -
-         We have enough youth, how about a fountain of SMART?       -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list