How to use RAK5010/8212 simply with RUI?

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)
  • 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:


+QIOPEN: 0,0


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




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.

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:
enable task and period is 150s
*at+set_config=cellular: MOBILE:CMCC:CMNET:0
set IP address, port, operator long name, short name,APN name, net service type, 0 means GSM
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:

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 :