Re-initialize radio

Is there a way to re-initialize the Lora P2P radio without resetting or re-powering RAK3172 running RUI3 4.0.1.
Or is there a way to see if radio is running properly?

The reason is that sometimes on random power cycles the uC reboots and sets P2P parameters and runs custom Arduino firmware but the radio does not always restart and no longer receives any Radio events.

Thanks

Can you try AT+BOOT and AT+RUN commands to re-initialize?

Hi @pmjackson ,

I believe there is no way for you to re-initialize the LoRa transceiver without resetting the module. There might be few not so elegant workaround on this issue (reset in certain interval, auxiliary device that will just send a heartbeat TX, etc.). But the best solution is to get on the root cause why RX wont suddenly respond to incoming LoRa packets.

Btw, if the device stop responding the LoRa signals, are the parameters still correct (if there is a way to check those without resetting)? Like if the parameters: SF, DR, CR, Freq, etc…are still ok? Maybe you can share the code and we can figure out something on the sequence in the code that can potentially cause it?

Hello @carlrowan,

Using AT commands to get P2P parameters came back as all set as expected, but still no +EVT:RXP2P:
Setup code below:

void setup() {
  //OSCCAL = 242; 
  api.system.sleep.all(3000);
  get_flash();
  setIO();

  udrv_wdt_init(6000);
 
  ct1 = 0;
  ct2 = 0;
  cbuff1 = 0;
  cbuff2 = 0;
  relayTimer1 = 0;
  payTimer = 0;
  freeTimer = 0;
  
  digitalWrite(PWRRly, LOW);
  digitalWrite(PayRly, LOW);
  Serial.begin(115200);
  api.system.atMode.add((char *)"encKey",(char *)"Set Enckey",(char *)"encKey", encKey_handler);
  delay(100);
  startTime = millis();
  Serial.println("P2P Start v1.1.1");
 //uint16_t sf = 10, bw = 0, cr = 0, preamble = 8, txPower = 22;
	result1 =	api.lorawan.nwm.set(0) ;
  result1 =	api.lorawan.pfreq.set(myFreq); //920000123
 	result1 =	api.lorawan.psf.set(sf);
  result1 =	api.lorawan.pbw.set(bw);
  result1 =	api.lorawan.pcr.set(0);
  result1 =	api.lorawan.ppl.set(8);
  result1 =	api.lorawan.ptp.set(22); 

  result1 = api.lorawan.encry.set(1);

  api.lorawan.registerPRecvCallback(recv_cb);
  result1 = api.lorawan.precv(65534);
}//setup

Hello @whydont ,

Thank you for your thoughts.
I am able to re-initialize(or reset the uC & radio) with AT commands. i.e. ATZ , AT+NWM=0 etc
I was needing a way to reset the radio without restarting the firmware that is running.
Also, without external AT commands because the running device will not be connected to a terminal.

Regards

1 Like