RAK3172 not going into sleepmode

Hello @carlrowan ,

I have an RAK3272S breakoutboard with firmware " RAK3172-E_latest_final (4)". Iam trying to use the sleepmode.all function in the software but this is not listening. Also when iam doing a manual command for sleeping it responds directly with “OK”. and then prints data on the serialport. Iam using the following code:

void loop()
{
   if (ConfProgr2Solve != 1)
  {
      
    if(LoraSettings.sleep == 1){
   //   GetSensorData();
    // uplink_routine();
      Serial.println("1.0");
      delay(4000);
      api.system.sleep.all(15000);
    }
   
    else if (((elapsed = millis() - last) > ABP_PERIOD) && LoraSettings.sleep == 0)
    {
    //  uplink_routine();
	    GetSensorData();
      last = millis();
    }
  }
}

this i what i get on my serial monitor when iam doing a manual sleep command. It looks like it works but its not waiting for 15000 ms.
image

Can anyone tell me why i cannot enter sleepmode?

My second question is about the watchdog. I saw earlier that there is still no watchdog release but i was wondering if there is a watchdog release right now? or another option to solve this problem?

Kind regards,
Marnick Bijlsma

Hi @Marnick ,

It looks like you have a custom firmware and the sleep is managed by LoraSettings.sleep flag. It will be hard for us without understanding the flow. However, I suggest you try a bare module first then test sleep both for AT command and CLI. From there, we can see if the module still correspond to sleep commands (meaning it is not hardware related issue) and then we can put effort on investigating the sleep issue you describe.

For the watchdog, there is no plan yet to enable it as this will effect the overall flow of the RUI3 firmware structure. As you know, it has active AT command at the background and these must be considered on watchdog implementation. In addition are different watchdog implementation on different chips supported by RAK so this might not be straight forward quick add-on but surely not impossible to be added in the future.

Hello @carlrowan
I found out that the serial port (
(UART RX1) wakes up the device. every second there is a new packet on the serial port available and this wakes up the device. I tried to use the at+lpm command tho disable the automatic sleep command but its not working. So i just want to use the sleep command with a timer and not with a wake-up call on the serial port. I dont know why the at+lpm isnt working, do you have suggestions how to solve this problem?

Hi @Marnick ,

I tested AT+LPM and it is working fine to me (probably because it is a fresh device without custom FW using the sleep related RUI3 APIs).

The RAK3172 will wakeup on its UART2 lines. As I understand it, there is a constant pulse on the RX line so the module keeps on waking up. Is this correct?

Hello @carlrowan

Yeah there is a pulse on the RX pin (uart1) every 1 or 2 seconds so the device wakes up and is not gonna sleep, but iam using the RUI3 API sleepmode so thats not custom made. When i disable the Rx pin the sleepmode (RUI3 API) is working

Hi @Marnick ,

The RX pin by default is configured to wakeup the module on sleep. Is there a no way to remove those pulses to avoid unintentional wakeups?