Use command of ATR then clean all the data of RAK3172

Hi,

"I am utilizing the RAK Wireless RAK3172-T in our application. When using the ATR , it erases all data. However, we must retain certain parameters such as SN, Devuid and some others What steps should be taken to save these parameters after resetting the device?

Welcome to RAK forum @sanketp ,

If what you need is to reset the device via AT command, what you must use is ATZ not ATR.

@carlrowan Thank you for your prompt response. Could you please advise on how to reset the device to its default values? I have tried using the ATZ command, but it does not reset the values. However, when I use the ATR command, the values become zero. I would appreciate your guidance on this matter.

If your device settings are ZERO (e.g. DevEUI = 0000000000000000), then your device lost it’s factory settings.
This can happen when

  • switching between STM32CubeIDE firmware and RUI3 firmware
  • update from an old RUI3 firmware (older than 3.5.1)
  • Chip erase performed with STM32CubeProgrammer or a Jlink adapter.

In this case you have to set your device credentials again with AT commands. Then use AT+FACTORY to rewrite the factory default settings to flash.

After that ATR will reset the device to the factory settings.

1 Like

@beegee, thank you for your feedback. We exclusively use AT commands for our application, and the module version is AT+VER=RUI_4.0.6_RAK3172-T. Could you please provide guidance on how to perform a factory reset on the device with AT command?

Factory reset is done with ATR
Device restart is done with ATZ

However in your case it seems the factory settings were erased before.

Setup the device with AT command to what you want to be the factory settings

AT+DEVEUI=zzz
AT+APPEUI=zzz
AT+APPKEY=zzz
AT+NWSKEY=zzz

Then use AT+FACTORY to save these settings as factory default.

Then ATR will reset the device to these settings.

@beegee got it. But in my case when connect to the gateway that time data send and received but some time its RAK3172 module hang or not update the status and I am not able to send or received data.

  • I am try with ATR command but not reset the AT+NJS status always showing 1.
  • also restart the module but AT+NJS status always show 1.
  • AT+JOIN=1:0:8:0 to join network but not received any event related joined.
  • when try to send data that time hot the evt show -
*  +EVT:SEND_CONFIRMED_FAILED(4)
* +EVT:LINKCHECK:1:0:0:0:0

The gateway work with other device and also this same device but some time this happened.

So what is the cause if you need any information please let me know.

ATR should not be used frequently. It is used to do a factory reset of the module. You should only use it if the device settings are messed up.

You should use ATZ to restart the module.

AT+NJS will always show 1 after the device joined until you reset or power cycle the device. It does not change if the connection to the gateway or LoRaWAN server is lost. Without additional measures you will not know if the connection is up.

If send confirmed failed and link check is responding with 1:0:0:0:0 then you lost the connection. It does not mean that the device hangs.

An AT+JOIN=1:0:0:8 command will not do anything if the device thinks it is still connected.

Why it lost connection is something I do not know.

How often are you sending data?
How large is your data packet?
What LoRaWAN region do you use?
What datarate did you set on the device?
Is ADR (automatic datarate adjustment) activated on the LoRaWAN server?