How to use LTE function on RAK7243/Pilot gateway pro


(Fomi Tong) #1

There is a image of RAK7243 with LTE function for testing:
https://www.rakwireless.com/en/download/LoRa/LoRa-Gateway-Image#RAK7243(LTE)
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
(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