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 :
https://doc.rakwireless.com/rak5010-wistrio-nb-iot-tracker/device-at-commands

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)