Space in APN causing issue

Issue: Connect script fails due to space in APN

Setup: RAK2013. rpi4. Bullseye os.

Details:
Hello again. Hoping someone can help.

When running “sudo pppd call gprs” the output is:

pppd options in effect:
debug		# (from /etc/ppp/peers/gprs)
nodetach		# (from /etc/ppp/peers/gprs)
dump		# (from /etc/ppp/peers/gprs)
noauth		# (from /etc/ppp/peers/gprs)
remotename 3gppp		# (from /etc/ppp/peers/gprs)
/dev/ttyAMA0		# (from /etc/ppp/peers/gprs)
115200		# (from /etc/ppp/peers/gprs)
lock		# (from /etc/ppp/peers/gprs)
connect chat -s -v -f /etc/chatscripts/quectel-chat-connect -T Spark NZ		# (from /etc/ppp/peers/gprs)
disconnect chat -s -v -f /etc/chatscripts/quectel-chat-disconnect		# (from /etc/ppp/peers/gprs)
nocrtscts		# (from /etc/ppp/peers/gprs)
modem		# (from /etc/ppp/peers/gprs)
asyncmap 0		# (from /etc/ppp/options)
lcp-echo-failure 4		# (from /etc/ppp/options)
lcp-echo-interval 30		# (from /etc/ppp/options)
hide-password		# (from /etc/ppp/peers/gprs)
novj		# (from /etc/ppp/peers/gprs)
novjccomp		# (from /etc/ppp/peers/gprs)
ipcp-accept-local		# (from /etc/ppp/peers/gprs)
ipcp-accept-remote		# (from /etc/ppp/peers/gprs)
ipparam 3gppp		# (from /etc/ppp/peers/gprs)
noipdefault		# (from /etc/ppp/peers/gprs)
ipcp-max-failure 30		# (from /etc/ppp/peers/gprs)
defaultroute		# (from /etc/ppp/peers/gprs)
usepeerdns		# (from /etc/ppp/peers/gprs)
noipv6		# (from /etc/ppp/options)
noccp		# (from /etc/ppp/peers/gprs)
noipx		# (from /etc/ppp/options)
Usage: chat [-e] [-E] [-v] [-V] [-t timeout] [-r report-file]
     [-T phone-number] [-U phone-number2] {-f chat-file | chat-script}
Script chat -s -v -f /etc/chatscripts/quectel-chat-connect -T Spark NZ finished (pid 8090), status = 0x1
Connect script failed

I think this is due to my APN having a space in it (“Spark NZ”). When i try without a space (“SparkNZ”) the connect script runs but obviously does not connect.

Minicom:
output from “at+cops=?”

+COPS: (1,"Spark NZ","Spark NZ","53005",7)

Output from “at+csq”

+CSQ: 30,99

output from “at+cops=1,0,Spark NZ,7”

+CME ERROR: 30

Thank you for reading and any info would be great.
Cheers,

I have just tried this with a different sim card and APN with no space (“2degrees”) and it worked fine.
Also, to be clear i am required to use the “Spark NZ” sim.
Thank you!

Hello @shirtna

you could try to use the numeric value instead. E.g. something like:

at+cops=1,2,53005,7

Thanks
Felix

Hello @felix

Thank you for your reply.

How would i apply that to the pppd connect script?
Would it just be

sudo /usr/local/rak/lte/ppp-creator.sh '53005' ttyAMA0 921600

Thanks again

Hello @shirtna

no, I don’t think so. I understand the script expects the APN as parameter which is different from the operator name or number.

Check with your provider about the correct APN. Maybe see here.

Thanks
Felix

Hello again @felix.
Thank you for your response and apologies for not replying, I’ve been away.

I have tried all the APNs in that link and none of them seem to work. The only way I can get the rak2013 to connect is by putting in a sim card from 2degrees and setting the APN to “2degrees”. 2degrees APN (internet etc) settings don’t seem to work either.

Cheers.

Hey Felix,

This didn’t work either (in Minicom)

at+cops=1,2,53005,7

This is the output from sudo pppd call gprs

admin@rpimon:~ $ sudo pppd call gprs
pppd options in effect:
debug           # (from /etc/ppp/peers/gprs)
nodetach                # (from /etc/ppp/peers/gprs)
dump            # (from /etc/ppp/peers/gprs)
noauth          # (from /etc/ppp/peers/gprs)
remotename 3gppp                # (from /etc/ppp/peers/gprs)
/dev/ttyAMA0            # (from /etc/ppp/peers/gprs)
921600          # (from /etc/ppp/peers/gprs)
lock            # (from /etc/ppp/peers/gprs)
connect chat -s -v -f /etc/chatscripts/quectel-chat-connect -T internet         # (from /etc/ppp/peers/gprs)
disconnect chat -s -v -f /etc/chatscripts/quectel-chat-disconnect               # (from /etc/ppp/peers/gprs)
nocrtscts               # (from /etc/ppp/peers/gprs)
modem           # (from /etc/ppp/peers/gprs)
asyncmap 0              # (from /etc/ppp/options)
lcp-echo-failure 4              # (from /etc/ppp/options)
lcp-echo-interval 30            # (from /etc/ppp/options)
hide-password           # (from /etc/ppp/peers/gprs)
novj            # (from /etc/ppp/peers/gprs)
novjccomp               # (from /etc/ppp/peers/gprs)
ipcp-accept-local               # (from /etc/ppp/peers/gprs)
ipcp-accept-remote              # (from /etc/ppp/peers/gprs)
ipparam 3gppp           # (from /etc/ppp/peers/gprs)
noipdefault             # (from /etc/ppp/peers/gprs)
ipcp-max-failure 30             # (from /etc/ppp/peers/gprs)
defaultroute            # (from /etc/ppp/peers/gprs)
usepeerdns              # (from /etc/ppp/peers/gprs)
noccp           # (from /etc/ppp/peers/gprs)
noipx           # (from /etc/ppp/options)
abort on (BUSY)
abort on (NO CARRIER)
abort on (NO DIALTONE)
abort on (ERROR)
abort on (NO ANSWER)
timeout set to 30 seconds
send (AT^M)
expect (OK)
^M
OK
 -- got it

send (ATE0^M)
expect (OK)
^M
^M
OK
 -- got it

send (ATI;+CSUB;+CSQ;+COPS?;+CGREG?;&D2^M)
expect (OK)
^M
^M
Quectel^M
EG95^M
Revision: EG95EFBR06A06M4G^M
^M
SubEdition: V02^M
^M
+CSQ: 31,99^M
^M
+COPS: 0^M
^M
+CGREG: 0,3^M
^M
OK
 -- got it

send (AT+CGDCONT=1,"IP","internet",,0,0^M)
expect (OK)
^M
^M
OK
 -- got it

send (ATD*99#^M)
expect (CONNECT)
^M
^M
CONNECT
 -- got it

Script chat -s -v -f /etc/chatscripts/quectel-chat-connect -T internet finished (pid 12248), status = 0x0
Serial connection established.
using channel 2
Using interface ppp0
Connect: ppp0 <--> /dev/ttyAMA0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xc871694d> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x3 <asyncmap 0x0> <auth chap MD5> <magic 0x7418827f> <pcomp> <accomp>]
No auth is possible
sent [LCP ConfRej id=0x3 <auth chap MD5>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xc871694d> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x4 <asyncmap 0x0> <magic 0x7418827f> <pcomp> <accomp>]
sent [LCP ConfAck id=0x4 <asyncmap 0x0> <magic 0x7418827f> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0xc871694d]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::f06f:c45a:880d:b9af>]
rcvd [LCP DiscReq id=0x5 magic=0x7418827f]
rcvd [LCP EchoRep id=0x0 magic=0x7418827f c8 71 69 4d]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::f06f:c45a:880d:b9af>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::f06f:c45a:880d:b9af>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::f06f:c45a:880d:b9af>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::f06f:c45a:880d:b9af>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::f06f:c45a:880d:b9af>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::f06f:c45a:880d:b9af>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::f06f:c45a:880d:b9af>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::f06f:c45a:880d:b9af>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPV6CP ConfReq id=0x1 <addr fe80::f06f:c45a:880d:b9af>]
sent [LCP EchoReq id=0x1 magic=0xc871694d]
IPCP: timeout sending Config-Requests
IPV6CP: timeout sending Config-Requests
sent [LCP TermReq id=0x2 "No network protocols running"]
sent [LCP TermReq id=0x3 "No network protocols running"]
Connection terminated.
abort on (ERROR)
abort on (NO DIALTONE)
unterminated quote (line 4)
Script chat -s -v -f /etc/chatscripts/quectel-chat-disconnect finished (pid 13275), status = 0x1
disconnect script failed
Modem hangup