How to use RAK5010/8212 simply with RUI?

Hi,
I am nero, responsible for cellular part of RUI. Recently, we have received many issues about RAK5010 after version 3.0. So there is a need to help our friends to simply config the boards, and then focus to their own application. OK, here we go!

1.When you get your board, how to config it?

RAK8212 just support BLE.
RAK5010 support three ways: BLE,USB,UART.

  • BLE: For saving power, ble will advertise in 60s after power on. So if want to config via ble, connect it in 60s.

  • UART: This way is better than ble. Below shows how to connect it.

  • USB: The best way. But remember, your com serial tool must support flow control: DTR.

2.What command to send?

We supply with rak AT command, look at :

3.How to join your net quickly?

BG96 on 5010 or 8212 support 2G GSM/ 4G NB/ 4G CAT M1. So it highly depends on your operator. The order of at is like below:

  • at+set_config=cellular:(AT+COPS=?)
    search net. It will tell you what operator info about your sim card. For exampe, if return like below, it means you can use net service of Ooredoo or vodafone, decided your sim card. These infomation is very important. You must use long name, short name of operator later:
    +COPS: (2,“Ooredoo”,“Ooredoo”,“42701”,0),(3,“vodafone”,“VF-QA”,“42702”,0),(0,1,2,3,4),(0,1,2)
    OK
  • at+set_config=cellular:(AT+COPS=1,0,“Ooredoo”,0)
    Then try to register to net, here use the long name Ooredoo.
  • at+set_config=cellular:(AT+QIACT=1)
    active apn, it is important
  • at+set_config=cellular:(AT+COPS?)
    query register successfully or not
  • at+set_config=cellular:(AT+CSQ)
    query quality of net, if return A(between 0 and 31), 99, join ok!

It’s just a 2G example. If want to use 4G NB, you should change to 4G search as below. Then try to register to your net like 2G:

  • at+set_config=cellular:(AT+QCFG=“iotopmode”,1,1)
  • at+set_config=cellular:(AT+QCFG=“nwscanmode”,3,1)
  • at+set_config=cellular:(AT+QCFG=“BAND”,0,10,10)
  • at+set_config=cellular:(AT+QENG=“SERVINGCELL”)
  • at+set_config=cellular:(AT+COPS=?)

4.How to send data to server?

After step 3, it has join net successful. If you have a server, you can creat a TCP or UDP server and fill in your IP address and port in at command as follow:
[12:42:23.345]OUT→◇at+set_config=cellular:(AT+QIOPEN=1,0,“TCP”,“118.31.121.60”,12001,0,1)

[12:42:23.398]IN←◆
AT+QIOPEN=1,0,“TCP”,“118.31.121.60”,12001,0,1
OK
[12:42:28.417]IN←◆

+QIOPEN: 0,0

[12:42:33.888]OUT→◇at+set_config=cellular:(AT+QISEND=0,6)

[12:42:35.911]IN←◆AT+QISEND=0,8 (here return length longer than send command because of \r\n ,ignore it)

[12:42:37.137]OUT→◇at+set_config=cellular:(123456)

[12:42:37.148]IN←◆123456
SEND OK
[12:42:40.616]OUT→◇at+set_config=cellular:(AT+QICLOSE=0)

[12:42:50.634]IN←◆
AT+QICLOSE=0
OK

If you are here, congratulations! You have finish your first link on RAK5010/8212. In order to help user easily test their board. We supply some test server, please contact @Fomi if need. We will update V3.0.0.8 later which fix some bug about TCP command with BG96, Please note.

Notes:
1.USB could be used for power on 5010, but the voltage of USB should be stable. Otherwise, it will lead to restart again and again. If use USB, do not connect non-rechargeable battery. It is dangerous.
2.If want to learn more details, connect to jlink and watch RTT.
3.We supply a task which can send sensors data to server periodly, config as below:
*at+set_config=cellular:send_interval:1,150000
enable task and period is 150s
*at+set_config=cellular:118.31.121.60:12112:CHINA MOBILE:CMCC:CMNET:0
set IP address, port, operator long name, short name,APN name, net service type, 0 means GSM
*at+set_config=device:restart
restart and effect
Please notice, this task is based on 2G GSM, and the information must be set correctly. Otherwise no effect. Besides, if device is in sleep, you can use USB(just usb is on) to turn off it via:
*at+set_config=cellular:send_interval:0,0
*at+set_config=device:restart

Add CAT M1 Search net command:

  • at+set_config=cellular:(at+qcfg=“band”)
  • at+set_config=cellular:(at+qcfg=“iotopmode”)
  • at+set_config=cellular:(at+cgdcont?)
  • at+set_config=cellular:(at+qcfg=“nwsanmode”)
  • at+set_config=cellular:(scan)

how to change it back to 2G ? can’t find any 4G NB network.

Please refer to this in chapter 4 Status Control Commands :

If search the net costs at least 40s. User should set net type first. For example,

at+qcfg=“nwscanmode”,1 //set to GSM

Then at+set_config=cellular:(AT+COPS=?) will costs nearly 12s.

Hi Nero:

I follow all this instructions but in the final command to start sending data automatically it gaves me an error.

How can I send data automatically ?
Is there a command to send the actual sensores data to TCP port?

Regards,

at+version
Firmware Version: RUI v3.0.0.9
OK

at+set_config=cellular:(AT+COPS=?)

+COPS: (2,“ENTEL”,“ENTEL”,“73001”,0),(1,“CLARO CHL”,“ClaroCHL”,“73003”,0),(3,“Movistar”,“Movistar”,“73002”,0),(0,1,2,3,4),(0,1,2)

OKat+set_config=cellular:(AT+COPS=1,0,“ENTEL”,0)

AT+COPS=?
+COPS: (2,“ENTEL”,“ENTEL”,“73001”,0),(1,“CLARO CHL”,“ClaroCHL”,“73003”,0),(3,“Movistar”,“Movistar”,“73002”,0),(0,1,2,3,4),(0,1,2)

OKat+set_config=cellular:(AT+QICSGP=1,1,“imovil.entelpcs.cl”,“entelpcs”,“entelpcs”,1)

AT+QICSGP=1,1,“imovil.entelpcs.cl”,“entelpcs”,“entelpcs”,1
OKat+set_config=cellular:(AT+QIACT=1)

AT+QIACT=1
ERROR
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿat+set_config=cellular:(AT+COPS?)
AT+COPS?
+COPS: 0,0,“ENTEL entel”,0

OKat+set_config=cellular:(AT+CSQ)

AT+CSQ
+CSQ: 23,99

OKat+set_config=cellular:(AT+QIOPEN=1,0,“TCP”,"...*",10560,0,1)

AT+QIOPEN=1,0,“TCP”,"...*",10560,0,1
OK
at+set_config=cellular:send_interval:1,120000
at+set_config=cellular:send_interval:1,120000
ERROR:RUI_AT_PARAMETER_INVALID 2

Hi @ahugo ,

Can you try this as your last command
at+set_config=cellular:send_interval:1:120000

Hi Carl.

It gives me an error too.

at+set_config=cellular:send_interval:1:120000
at+set_config=cellular:send_interval:1:120000
ERROR:RUI_AT_PARAMETER_INVALID 2

HI @ahugo ,

I saw that your AT+QIACT=1 didn’t succeed. That is probably caused by trying to connect to entelpcs but it is not part of the available network. Is ENTEL and entelpcs the same?

I believe without a successful AT+QIACT=1, your connetion wont be established.

Also, for sanity check. You can you try your sim card first on a smart phone to see if it can connect to the internet?

Hi Carl.

Yes I tested the SIM previouly in another device and works ok.

I use the command:

AT+QICSGP=1,1,“imovil.entelpcs.cl”,“entelpcs”,“entelpcs”,1
OKat+set_config=cellular:(AT+QIACT=1)

to set the APN, user and password for this SIM from ENTEL

And then it gaves me this error when I try to connect.

AT+QIACT=1
ERROR

I will try with abother SIM ( I thied with 3 until now) but I’m still havingo problems with the interval setup. I does not recognice:
at+set_config=cellular:send_interval:1,120000
neither
at+set_config=cellular:send_interval:1:120000

Regards,

QICSGP seems ok.

Are you sure on that GPRS is still active on your area? It could also be possible that the SIM works on smartphone because it connected via 3G or 4G.

After you perform AT+QIACT, suddenly, AT+COPS? is failing too.

Is the battery connected when you setup? Also, you sure it is ok? Like not dropping in voltage?