Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cellular lte with pppd
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
hujuice
Apprentice
Apprentice


Joined: 16 Oct 2007
Posts: 277
Location: Rome, Italy

PostPosted: Mon Dec 10, 2018 7:30 pm    Post subject: cellular lte with pppd Reply with quote

I'm traveling for a long period and I would like to use my 413c:81c5 SIM card module. The hardware appears well managed, but I'm unable to connect with pppd.
Generally speaking, I miss an exhaustive explanation of the process and I'm continuously reading tons of howtos, with differences between them.
All what I know about my situation is my "APN" string. Then I'm proceeding by attempt, with no success. (An example configuration follows, with related resulting logs.)

What to do?
Is there a better way than attempts?

Regars,
HUjuice

/etc/conf.d/net:
modules_ppp0="!plug"
link_ppp0="/dev/ttyACM0"
#plugins_ppp0="dhcpc"
username_ppp0='user'
password_ppp0=
pppd_ppp0="
updetach
noauth
defaultroute
usepeerdns
lock
921600
modem crtscts
debug
"
chat_ppp0="
ABORT BUSY
ABORT ERROR
ABORT 'NO ANSWER'
ABORT 'NO CARRIER'
ABORT 'NO DIALTONE'
ABORT 'Invalid Login'
ABORT 'Login incorrect'
TIMEOUT 5
'' ATZ
OK AT AT+CGDCONT=1,\"IP\",\"cytamobile\"
OK 'ATDT\T'
TIMEOUT 60
CONNECT ''
TIMEOUT 5
~-- ''
"


resulting log:
Dec 10 21:08:26 lap pppd[20641]: Plugin passwordfd.so loaded.
Dec 10 21:08:26 lap pppd[20641]: pppd 2.4.7 started by sergio, uid 0
Dec 10 21:08:27 lap chat[20643]: abort on (BUSY)
Dec 10 21:08:27 lap chat[20643]: abort on (ERROR)
Dec 10 21:08:27 lap chat[20643]: abort on (NO ANSWER)
Dec 10 21:08:27 lap chat[20643]: abort on (NO CARRIER)
Dec 10 21:08:27 lap chat[20643]: abort on (NO DIALTONE)
Dec 10 21:08:27 lap chat[20643]: abort on (Invalid Login)
Dec 10 21:08:27 lap chat[20643]: abort on (Login incorrect)
Dec 10 21:08:27 lap chat[20643]: timeout set to 5 seconds
Dec 10 21:08:27 lap chat[20643]: send (ATZ^M)
Dec 10 21:08:27 lap chat[20643]: expect (OK)
Dec 10 21:08:27 lap chat[20643]: ATZ^M^M
Dec 10 21:08:27 lap chat[20643]: OK
Dec 10 21:08:27 lap chat[20643]:  -- got it
Dec 10 21:08:27 lap chat[20643]: send (AT^M)
Dec 10 21:08:27 lap chat[20643]: expect (AT+CGDCONT=1,IP,cytamobile)
Dec 10 21:08:27 lap chat[20643]: ^M
Dec 10 21:08:27 lap chat[20643]: AT^M^M
Dec 10 21:08:27 lap chat[20643]: OK^M
Dec 10 21:08:32 lap chat[20643]: alarm
Dec 10 21:08:32 lap chat[20643]: Failed
Dec 10 21:08:32 lap pppd[20641]: Script /usr/sbin/chat -e -E -v ABORT BUSY ABORT ERROR ABORT 'NO ANSWER' ABORT 'NO CARRIER' ABORT 'NO DIALTONE' ABORT 'Invalid Login' ABORT 'Login incorrect' TIMEOUT 5 '' ATZ OK AT AT+CGDCONT=1,"IP","cytamobile" OK 'ATDT\T' TIMEOUT 60 CONNECT '' TIMEOUT 5 ~-- '' finished (pid 20643), status = 0x3
Dec 10 21:08:32 lap pppd[20641]: Connect script failed

_________________
Who hasn't a spine, should have a method.
Chi non ha carattere, deve pur avere un metodo.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Dec 10, 2018 8:07 pm    Post subject: Reply with quote

hujuice,

There is wvdial. It does much the same thing as a chat script.

My /etc/wvdial.conf is
Code:
[Dialer defaults]
Modem = /dev/ttyUSB0
Baud = 115200
Phone = *99#
Username = *
Password = *

#Init4 = AT+CMEE=2
New PPPD = yes
#Auto DNS = 1

Stupid Mode = 1
FlowControl=Hardware(CRTSCTS)
That gets me connected to Vodafone in the UK with a dongle on /dev/ttyUSB0.

I don't remember the FlowControl bit.

Code:
OK AT AT+CGDCONT=1,\"IP\",\"cytamobile\"
looks odd.
The chat scrip is normally 2 columns of <Expect from Remote> <String to send>
So
Code:
'' ATZ
say expect nothing then send ATZ. That's the Hayes command for ATtention and Z means reset.
When the modem has reset, it sends OK. The next line is
Code:
OK AT AT+CGDCONT=1,\"IP\",\"cytamobile\"

Expect the OK, then send ATtention, with no command. The modem will respond OK. However, its been told to expect AT+CGDCONT=1,\"IP\",\"cytamobile\".
At that point it fails. I suspect that the line should read
Code:
OK AT+CGDCONT=1,\"IP\",\"cytamobile\"


Here it is in your log
Code:
Dec 10 21:08:27 lap chat[20643]: ATZ^M^M
Dec 10 21:08:27 lap chat[20643]: OK
Dec 10 21:08:27 lap chat[20643]:  -- got it
Dec 10 21:08:27 lap chat[20643]: send (AT^M)
Dec 10 21:08:27 lap chat[20643]: expect (AT+CGDCONT=1,IP,cytamobile)


The Hays command set has been extended by everyone over the years, so anything you find on the web may or may not be useful with your device.

You can get the connection up by hand with a tool like minicom. Its a serial console emulator.
Set it up to talk to your modem.
Type AT and the modem will respond OK.
Type ATZ and the modem will reset then respond OK and so on.

Google hints that AT+CGDCONT is a valid Hays command, so you should be sending it, not expecting it.

I remember real 110 baud baseband modems with acoustic couplers, so I've lived with serial comms.
_________________
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
hujuice
Apprentice
Apprentice


Joined: 16 Oct 2007
Posts: 277
Location: Rome, Italy

PostPosted: Tue Dec 11, 2018 10:01 am    Post subject: Reply with quote

Thank you for your suggestions, NeddySeagoon.
Your consideration about the row where I placed my APN string really makes sense:
NeddySeagoon wrote:
At that point it fails. I suspect that the line should read
Code:
OK AT+CGDCONT=1,\"IP\",\"cytamobile\"


Now the connection goes further, but fails whit a laconic 'Connect script failed' after the chat.
So, I changed the chat with a more complex one, mostly taken from the arch wiki (https://wiki.archlinux.org/index.php/3G_and_GPRS_modems_with_pppd), with the same result.
Code:
Dec 11 11:58:04 lap pppd[15484]: Script /usr/sbin/chat -e -E -v ABORT 'BUSY' ABORT 'NO CARRIER' ABORT 'VOICE' ABORT 'NO DIALTONE' ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT 'DELAYED' REPORT CONNECT TIMEOUT 5 '' 'ATQ0' 'OK-AT-OK' 'ATZ' TIMEOUT 3 'OK' AT 'OK\d-AT-OK' 'ATI' 'OK' 'ATZ' 'OK' 'ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0' 'OK' AT\^SYSCFG=2,2,3fffffff,0,1 'OK-AT-OK' AT+CGDCONT=1,"IP","cytamobile" 'OK' 'ATDT*99***1#' TIMEOUT 30 CONNECT '' finished (pid 15507), status = 0x3
Dec 11 11:58:04 lap pppd[15484]: Connect script failed


Also, your suggestion to use minicom to investigate step by step is useful.
I have no time now to try deeply, but I'll post my further results here.

Thank you again,
HUjuice
_________________
Who hasn't a spine, should have a method.
Chi non ha carattere, deve pur avere un metodo.
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