How to use LTE function on RAK7243/Pilot gateway pro

(Fomi Tong) #1

There is the latest image for RAK7243 with/without LTE function:
https://www.rakwireless.com/en/download/LoRa/Pilot-Gateway-Pro-RAK7243#Firmware
Just download and uncompress it, then copy the image to a SD card(>2G size) and plus to RAK7243.
Then do as following steps:

  1. Set the gateway for LTE using minicom as follow:
    minicom -D /dev/ttyAMA0 -b 115200

  2. Input “AT” and “Enter”, if you can see “OK”, it indicates the connection between RPi and LTE module is nice.
    image

  3. Then, we need to set the parameters of the network operator.

  4. Input AT+COPS=? to query the information of the network operator, for example:
    image
    (2,"CHN-CT","CT","46011",7),(3,"CHINA MOBILE","CMCC","46000",0),(3,"CHN-UNICOM","UNICOM","46001",2)

    CHN-CT is China Telecom, CHINA MOBILE is China Mobile, and CHN-UNICOM is China Unicom.

  5. Then, set the network operator you want to use, for example, input AT+COPS=1,0,”CHN-CT”,7 to use China Telecom. The result OK indicates it has been set successfully:
    image

  6. These steps is only for the first time you use the gateway to connect LTE or changing to another network operator, otherwise, it will connect to LTE network automatically.

  7. After setting and restart the gateway, it will connect to LTE network automatically. You can query the information using “ifconfig” command. If you see something as follow, it indicates it has connected to LTE successfully.

Configure RAK2013
I'm not able access internet through RAK2013 with RPi
I'm not able access internet through RAK2013 with RPi
(Fomi Tong) #2

If it doesn’t work too, please do as follow:

  1. Power on the device and don’t press the power button, then check the progress using “ps -ef” command, is there a progress named “wait_pi_hat_and_ppp.sh”?

  2. Press the power button, wait 15s, then check the progress, is there a progress pppd?

  3. pppd will dial-up internet automatically, in normal, it will connect successfully in 30~40s. Then you can see ppp0 using “ifconfig” command. But if you can’t see ppp0, it means dial-up fail, just wait for 1~2 mins, pppd will quit automatically.

  4. After pppd quit, you can also dial-up manually by using “sudo pppd call gprs” command.

If dial-up successfully, you can see the following information:

BTW, if you want to modify the APN name, just enter “/home/pi/pi” folder, and “sudo ./ppp-creator.sh APN_NAME ttyAMA0”, APN_NAME is the APN name you want to set.

(lele) #3

hello, I am blocked on 2), I can enter inside minicom but impossible to enter “AT” or the others commands

(lele) #4

install ppp
Reading package lists… Done
Building dependency tree
Reading state information… Done
ppp is already the newest version (2.4.7-1+4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
creating directories
creating script file : /etc/chatscripts/quectel-chat-connect
creating script file : /etc/chatscripts/quectel-chat-disconnect
creating script file : /etc/ppp/peers/gprs

Use “sudo pppd call gprs” command and Surf
[email protected]:~/RAK2245-LoRaGateway-RPi-Raspbian-OS $ cd
[email protected]:~ $ 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)
115200 # (from /etc/ppp/peers/gprs)
lock # (from /etc/ppp/peers/gprs)
connect chat -s -v -f /etc/chatscripts/quectel-chat-connect -T mmsbouygtel.com # (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)
alarm
Failed
Script chat -s -v -f /etc/chatscripts/quectel-chat-connect -T mmsbouygtel.com finished (pid 20563), status = 0x3
Connect script failed

(Fomi Tong) #5

You may need to press the POWER button of RAK2247 to start the LTE module after power on the device. Then you can try to enter “AT”.

If you want the LTE module start automatically instead of pressing POWER button, just do as follow:

  1. /home/pi/pi/pi-hat.sh - add code to pulse gpio18 low for a second to power enable the LTE modem.
  2. nano /etc/chatscripts/quectel-chat-connect - replace \T with the APN name.

BTW, remember to modify the default password of the device/RPi for security.
Good luck!:wink:

(lele) #6

Thank Fomi, it works when I putch the botton, I did this for GPIO18 :
echo 18 > export
echo in > gpio18/direction
echo 1 > gpio18/value
sleep 1
echo 0 > gpio18/value

it is ok ?

thank

(Fomi Tong) #7

#!/bin/sh

cd /sys/class/gpio/
echo 5 > export
echo 6 > export
echo 13 > export
echo 18 > export
echo 19 > export
echo 21 > export
echo 26 > export
echo out > gpio5/direction
echo out > gpio6/direction
echo out > gpio13/direction
echo out > gpio18/direction
echo out > gpio19/direction
echo in > gpio21/direction
echo out > gpio26/direction

echo 0 > gpio5/value
echo 0 > gpio6/value
echo 0 > gpio13/value
echo 0 > gpio19/value
echo 0 > gpio26/value

echo 1 > gpio18/value
sleep 1
echo 0 > gpio18/value
sleep 1
echo 1 > gpio18/value

(lele) #8

now a get this :
[email protected]:~ $ 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)
115200 # (from /etc/ppp/peers/gprs)
lock # (from /etc/ppp/peers/gprs)
connect chat -s -v -f /etc/chatscripts/quectel-chat-connect -T mmsbouygtel # (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: EG95EFBR06A05M4G^M
^M
SubEdition: V01^M
^M
+CSQ: 20,99^M
^M
+COPS: 0^M
^M
+CGREG: 0,2^M
^M
OK
– got it

send (AT+CGDCONT=1,“IP”,“mmsbouygtel”,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 mmsbouygtel finished (pid 907), status = 0x0
Serial connection established.
using channel 4
Using interface ppp0
Connect: ppp0 <–> /dev/ttyAMA0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xe6a28b1e> ]
rcvd [LCP ConfReq id=0x9 <asyncmap 0x0> <magic 0xd126d265> ]
No auth is possible
sent [LCP ConfRej id=0x9 ]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xe6a28b1e> ]
rcvd [LCP ConfReq id=0xa <asyncmap 0x0> <magic 0xd126d265> ]
sent [LCP ConfAck id=0xa <asyncmap 0x0> <magic 0xd126d265> ]
sent [LCP EchoReq id=0x0 magic=0xe6a28b1e]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [LCP DiscReq id=0xb magic=0xd126d265]
rcvd [LCP EchoRep id=0x0 magic=0xd126d265 e6 a2 8b 1e]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
sent [LCP EchoReq id=0x1 magic=0xe6a28b1e]
IPCP: 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 916), status = 0x1
disconnect script failed
Modem hangup

(ZhuQI) #9

1.Can you send the prints of the 4) and 5) steps?
2.Can you send the contents of file “/etc/ppp/peers/gprs”?

(lele) #10

hello, it work fine when a disconnet the wifi and reboot. thank for your help I really appreciate

(Sri) #11

@Fomi

I’m stuck here. Any help would be very helpful.
I’m not even able to give AT commands, the window is stuck after
“minicom -D /dev/ttyAMA0 -b 115200”
command.

(Fomi Tong) #12

Hi, @sri

I think maybe you can use the latest firmware for RAK7243 with LTE:
https://www.rakwireless.com/en/download/LoRa/Pilot-Gateway-Pro-RAK7243#Firmware
Please download the one named “RAK7243_LTE_…” .

In the latest firmware, we’ve added a configuration UI, so you can configure it easily now.
image
image

(Sri) #13

Thanks @Fomi now I can see all the 3 LEDs light up but connect script failed error.

The Cellular Module doesn’t connect to the internet. Any thoughts?

(Fomi Tong) #14

Hi, @sri

Can you execute the following command?
sudo minicom -D /dev/ttyAMA0 -b 115200
and type:
ATI

Then give me the log picture.
Thank you!

(Sri) #15

@Fomi

Please find the result.

51%20PM

Hardly the cmd prompt is interactive if I enter the minicom cmd.

Thank you.

(Sri) #16

Revision info came after I hit another key stroke:

Quectel
BG96
Revision: BG96MAR02A07M1G

When I hit “sudo pppd call gprs”

It fails like this:

(Fomi Tong) #17

Hi, @sri

You can type “at+cops=?” to get a network operator information, for example, i can get the following information in China:
2,“CHN-CT”,“CT”,“46011”,7

I think you can get some information like this too.
If it is, please type “at+cops=1,0,xxx,yyy” to set your network operator. “xxx” is the one you get in the last step, like “CHN-CT”, and “yyy” is the one like “7” according to my example.

When you complete these step correctly, you can set APN name on the UI, then restart the device.

Please try again.

(Sri) #18

Hi, @Fomi
This is the error I get.

(Fomi Tong) #19

Can you try to use another Network operator? For example, IDEA.

(Sri) #20

Sure, let me insert the SIM and let you know. Even if LTE is not connecting it should latch on to EGSM on 900 band.