Heltec wireless stick lite - deep sleep

Hi,

I’m looking for a method to save the needed states into RTC memory, so that after deep sleep the device will send again sensor data,
Want to create a LoraWAN sensor with deep sleeping mode, but after wakeup the device will not send any message more.
DeviceState (eDeviceState_LoraWan) is 2 (so joined as far as I understand) but something is missing - was “lost” while deep sleep…

Is there a ready procedure for save to / restore from RTC memory - or what I need to save for get it work?

Same question (if different) for Wifi Lora32 (V3) …

Or maybe - somebody have a working example (Arduino-) code for a sleeping sensor?

Thanks for any suggestion!
Michael

Hi,

in the meantime I have tried to use the LoraWAN example code (from Arduino examples).
Here will be used:

void loop()
{
  switch( deviceState )
  {
    case DEVICE_STATE_INIT:
    {
#if(LORAWAN_DEVEUI_AUTO)
      LoRaWAN.generateDeveuiByChipID();
#endif
      LoRaWAN.init(loraWanClass,loraWanRegion);
      break;
    }
    case DEVICE_STATE_JOIN:
    {
      LoRaWAN.join();
      break;
    }
    case DEVICE_STATE_SEND:
    {
      prepareTxFrame( appPort );
      LoRaWAN.send();
      deviceState = DEVICE_STATE_CYCLE;
      break;
    }
    case DEVICE_STATE_CYCLE:
    {
      // Schedule next packet transmission
      txDutyCycleTime = appTxDutyCycle + randr( -APP_TX_DUTYCYCLE_RND, APP_TX_DUTYCYCLE_RND );
      LoRaWAN.cycle(txDutyCycleTime);
      deviceState = DEVICE_STATE_SLEEP;
      break;
    }
    case DEVICE_STATE_SLEEP:
    {
      LoRaWAN.sleep(loraWanClass);
      break;
    }
    default:
    {
      deviceState = DEVICE_STATE_INIT;
      break;
    }
  }
}

I want to use between the send cycles a real deep sleep (low power).
With LoRaWAN.sleep the device take about 900uA - with optimized deep sleep about 22uA.

How can I change this in the procedure?
LORAWAN.sleep seems be ok between all other states, but after finish with sending packet need to use other sleep procedure.

Thanks!
Michael