Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
pppd instead wvdial
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Sun Sep 09, 2012 10:38 am    Post subject: pppd instead wvdial Reply with quote

Hi! I have to connect to internet jumping wvdial.
Now i use wvdial and works with this configuration
Code:

m@marco ~ $ cat /etc/wvdial.conf
[Dialer Defaults]
Baud = 460800
ISDN = false
Init1 = ATZ
#Init1 = AT+CPIN=6541
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2
Init3 = AT+CGDCONT=16,"IP","websfr"
Modem = /dev/ttyUSB0
Modem Type = Analog Modem
username=dummy
password=dummy
Phone = *99#
#Phone = *99***16#

I must no use wvdial and use pppd, i don' t understand the mass of guide on the web.
How to do?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42559
Location: 56N 3W

PostPosted: Sun Sep 09, 2012 11:09 am    Post subject: Reply with quote

ev56o,

wvdial starts pppd when the connection is established.

You need both pppd and some means of settng up the data link so that pppd can work.
There are GUI replacements for wvdial but I'm not aware of any pppd replacements.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Sun Sep 09, 2012 3:58 pm    Post subject: Reply with quote

I don' t want replace pppd.
I seen a lot of guide that shows a connection using pppd and no other programs.
These guides make a configuration for ppp and a command line start the connection.
Back to top
View user's profile Send private message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Wed Sep 12, 2012 11:40 am    Post subject: Reply with quote

Can i have some help please?
Back to top
View user's profile Send private message
xaviermiller
Administrator
Administrator


Joined: 23 Jul 2004
Posts: 7894
Location: ~Brussels - Belgique

PostPosted: Wed Sep 12, 2012 11:44 am    Post subject: Reply with quote

Hello,

what you want is to convert the wvdial.conf to "pure ppp" scripts ?

I don't have the answer too, I would also like to use my 3G key without gas factories like NetworkManager...
_________________
Kind regards,
Xavier Miller
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2663
Location: Slovenia

PostPosted: Wed Sep 12, 2012 12:03 pm    Post subject: Reply with quote

Untested, but should work in theory:

/etc/ppp/peers/websfr
Code:
connect "/usr/sbin/chat -f /etc/ppp/websfr.chat"
/dev/ttyUSB0
460800
crtscts
noipdefault
defaultroute
usepeerdns
noauth
novj
noccp
nobsdcomp

user dummy
password dummy

/etc/ppp/websfr.chat
Code:
TIMEOUT 30
#ECHO   ON
ABORT   'BUSY'
ABORT   'ERROR'
ABORT   'NO ANSWER'
ABORT   'NO CARRIER'
''      ATZ
#OK     AT+CPIN=6541
OK      'ATQ0 V1 E1 S0=0 &C1 &D2'
OK      AT+CGDCONT=1,"IP","websfr"
OK      ATD*99#
CONNECT ""


Then a simple
Code:
pon websfr
to connect, and
Code:
poff websfr
to disconnect.

Last edited by Gusar on Wed Sep 12, 2012 5:46 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42559
Location: 56N 3W

PostPosted: Wed Sep 12, 2012 5:26 pm    Post subject: Reply with quote

Gusar,

Thats cheating. You are just replacing wvdial with chat.
Chat is worth installing just to read the man page :)


XavierMiller,

Theres your hint ... chat or wvdial.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2663
Location: Slovenia

PostPosted: Wed Sep 12, 2012 5:37 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Thats cheating. You are just replacing wvdial with chat.

Well, chat is part of the ppp package, so I don't think it's cheating :). I don't think this is possible with just pppd.
Back to top
View user's profile Send private message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Thu Sep 13, 2012 10:26 am    Post subject: Reply with quote

The gusar solution doesn' t work, i see the daemon pppd and chat work for seconds and dead, there isn' t log.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42559
Location: 56N 3W

PostPosted: Thu Sep 13, 2012 6:32 pm    Post subject: Reply with quote

ev56o,

chat was what we used to use when 28k modems were new. I've probably not used it since.

You can make chat produce a log but its off by default as it records the username and password in clear text.
Its probably timing issues. You may need to add delays into the chat script so it doesn't execute too fast.
Like I say, its a long time since I used chat.

You can use ppp with a one liner and I have been doing it for years, I just didn't know. I use PPPoE
Code:
/usr/sbin/pppd plugin rp-pppoe.so unit 0 user <username> remotename ppp0 linkname ppp0 plugin passwordfd.so defaultroute passwordfd 0 defaultmetric 4007 maxfail 0 persist connect true eth0

Note that my <username> has been removed and pppd receives the passwowd but does not echo it
Code:
ps -Alf
which would be a very bad thing.
The man page suggests the ppp will run chat if you need to, so its possible to just use ppp but it knows how to run chat.

I start ppp from the /etc/conf.d/net file too, so open-rc takes care of the fiddly bits, see /usr/share/doc/openrc-*/net.example.bz2
Even the username and password goes into /etc/conf.d/net too in clear text so make sure its only redable by root.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Sat Sep 15, 2012 1:49 pm    Post subject: Reply with quote

I don' t understand, do i have to use that command line with the configuration of gusar?
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2663
Location: Slovenia

PostPosted: Sat Sep 15, 2012 3:07 pm    Post subject: Reply with quote

ev56o wrote:
I don' t understand, do i have to use that command line with the configuration of gusar?

No, that's just an example of using pppoe, which is a different thing from what you want. What you need to do is figure out which part of my configuration is failing for you.

Or you simply use wvdial. Why exactly can't you simply use that?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42559
Location: 56N 3W

PostPosted: Sat Sep 15, 2012 4:13 pm    Post subject: Reply with quote

Gusar,

Its only pppoe because of the plugin it can be pppo<anything> with the <anything> plugin
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2663
Location: Slovenia

PostPosted: Sat Sep 15, 2012 4:26 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Its only pppoe because of the plugin it can be pppo<anything> with the <anything> plugin

Can it be a "dial-up" connection? Without chat? All examples I found on the net use chat. And I know it works, I've used something very similar to what I posted, except the "modem" was a cellphone connected to the machine via bluetooth, so the device was /dev/rfcomm0 instead of /dev/ttyUSB0
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42559
Location: 56N 3W

PostPosted: Sat Sep 15, 2012 4:49 pm    Post subject: Reply with quote

Gusar,

The pppd man page says that pppd will shell out to chat to get the link up. It can be over serial or mobile phone or whatever. pppd calls chat for itself, given the one liners with all of the information. Its not without chat but its without visible chat.

I suppose I can test with my USB 3G dongle, which currently uses wvdial.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Sat Sep 15, 2012 6:34 pm    Post subject: Reply with quote

I use wvdial with huaveii e220 usb modem with sim card.
Finally we have to find the problem in the configuration posted from gusar, ok. Ho to do? I have non output or similar.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42559
Location: 56N 3W

PostPosted: Sat Sep 15, 2012 7:46 pm    Post subject: Reply with quote

ev56o,
Gusars chat script is
Code:
TIMEOUT 30
#ECHO   ON
ABORT   'BUSY'
ABORT   'ERROR'
ABORT   'NO ANSWER'
ABORT   'NO CARRIER'
''      ATZ
#OK     AT+CPIN=6541
OK      'ATQ0 V1 E1 S0=0 &C1 &D2'
OK      AT+CGDCONT=1,"IP","websfr"
OK      ATD*99#
CONNECT ""
read man chat to find out how it works. To see it in action uncomment the
Code:
#ECHO   ON
line. This will send everything including your clear text username and password to stderr. Thats either the screen or a log file

The line
Code:
''      ATZ
means expect nothing then send ATZ to the modem. Thats the reset to defualt state. Thu can take several seconds to execute, so you must wiat for the OK response from the modem before sending further commands or the modem will miss them.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Mon Sep 17, 2012 9:59 am    Post subject: Reply with quote

Ok, i unconcommented the line ON and wait seconds, but don' t appean anything. With ps -aux i see there isn' t chat, pppd or pon process, i think of a crash. Is this normal? Do i have to wait along after launch pon?
I add an information, after launche pon (with non success) the modem don' t work neither with wvdial, i think in consqeuence of ATZ.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42559
Location: 56N 3W

PostPosted: Mon Sep 17, 2012 6:20 pm    Post subject: Reply with quote

ev56o,

Emerge minicom and talk to the modem yourself, rather like talking to Bomb 20 in Dark Star .
To do this, you send AT commands to the modem. If the modem executes the command, it will respond OK
AT alone does nothing but the modem should respons OK
ATZ is reset.
ATH1 is go off hook
ATH0 is hangup
ATDT<number> is dial <number> using DTMF.
ATDP<number> is the same but with pulse dialing. Most modems ignore the P

You cannot start pppd this way as you can't type fast enough but talking to the modem and getting responses is a good first step.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Mon Sep 17, 2012 6:30 pm    Post subject: Reply with quote

I can' t use minicom because of a situation that requires use only pppd, i understand i can do this. How to do?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42559
Location: 56N 3W

PostPosted: Mon Sep 17, 2012 6:45 pm    Post subject: Reply with quote

ev56o,

minicom will never get your data link up, which is what starts pppd. However, something, sometime has to talk to the modem directly to establish the link.
That something can be anything, minicom, chat, wvdial pppd, you can even assign a tty to the modem.

minicom is good for finding out whats wrong with getting the link up, if anything.
As a test, you can make the modem dial a phone number, your mobile phone, landline or whatever. If the phone rings, the test has passed.

I agree, you can'r use minicom for more than testing.

Your wvidal.conf said
Code:
 Modem = /dev/ttyUSB0
which is a USB serial port. Do you have that device when your modem is connected?
If so, tell minicom to talk to that device.
If not, your kernel is missing something.

I am trying to discover exactly where your problem is before I try to fix it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Tue Sep 18, 2012 3:54 pm    Post subject: Reply with quote

I always have the devices
Code:

m@marco ~ $ ls -la /dev/ttyUSB*
crw-rw---- 1 root uucp 188, 0 Sep 18 17:48 /dev/ttyUSB0
crw-rw---- 1 root uucp 188, 1 Sep 18 17:48 /dev/ttyUSB1

why not?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42559
Location: 56N 3W

PostPosted: Tue Sep 18, 2012 5:50 pm    Post subject: Reply with quote

ev56o,

udev creates and removes /dev entries as devices come and go. When you unplug your USB 3G dongle, the /dev entries will vanish.
That the /dev entries are there indicates your kernel is in good shape too.

How do you know which device of the two devices is your modem?

Did you do the minicom test?

Is your normal user in the uucp group?
If not, only root can use those two devices.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Wed Sep 19, 2012 9:42 am    Post subject: Reply with quote

The device is alwaya plugged, the device /dev/ttyUSB0 is indicate in the wvdial.conf, i use root always and i didn' t the minicom test yet.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42559
Location: 56N 3W

PostPosted: Wed Sep 19, 2012 7:27 pm    Post subject: Reply with quote

ev56o,

I see that /dev/ttyUSB0 is in wvdial.conf. You also said that wvdial does not work.
We don't know why yet, thats what minicom will tell.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum