How to send the nrf9160 to sleep mode and wakup up periodically every 6hour ?

Hi, 

I am using the nrf91 Thingy board for our pilot project. 

I am trying to save as much power as possible since we have to depend on a lithium battery for the power. Our idea is for both chips in the nrf91 thingy board to work in combination to solve our specific problem. I am planning to connect to the network every 6 hours, and then exchange data over MQTT between the server and the device. The server will also send the active hours window, so we can schedule the time to wake up. Additionally, I am planning to add a push button to the nrf52840 to wake up the device if there is any need while in sleep mode.

Questions:

  • I just wanted to know how to schedule an alarm on the nrd91 to wake up after 6hr.
  • Is it possible to keep the UART communication (uart1 between nrf91 and nrf52) open and wake up on an event from nrf52?
  • We are facing some disconnection issues with the. aws_iot lib. It is quite unpredictable, sometimes we are able to get a stable connection for almost 40 hours, but sometimes will get AWS_IOT_EVT_DISCONNECTED after 3-4 hours, Is this an expected behaviour? But for now, we have implemented a heartbeat data exchange between the client and server on every 3 minutes and added a reboot logic on the disconnection. The ping interval is 60Sec. Is there any better workaround?

Thanks

Tom Victor

Parents
  • I guess, the first topic is to clarify the term "sleep" and the statement "save as much power as possible".

    Let me split the "sleep" in two topics:

    - modem

    - application mcu

    For the modem, you may either use "CFUN=0/1" (switching off/on) or configure PSM, which would be my preference, if your network provider supports it.

    For that application mcu zephyr does already the most for you. If you use "k_sleep" on the main and no other job is running in some queues, the application mcu is already sleeping. To schedule an alarm, just specify the time in "k_sleep".

    "save as much power as possible"

    I guess, the question is more precise "save as much power as possible using mqtt", otherwise the very first thing to use less power is not to use a TCP based protocol. Reading the stuff with ping and heartbeat, I would even guess, that the question is "save as much power as possible but being always connected". The culprit is then very easy to see: power saving is bound to disable the radio, the mcu and power consuming peripherals. But your application seem to require exactly the opposite. Sending an ping every 60s and a heartbeat every 3 minutes consumes the energy. Sleeping  for 6h is something else. I guess, if you go towards "6h sleep", you will need to drop the connection and reconnect on every wake up. That doesn't come for free, if you use TLS that requires then handshakes, but I don't see an stable alternative using TCP. Otherwise forget about the "6h sleep" and try to optimize the ping and/or heartbeat interval. Maybe using eDRX helps the to reduce the energy for the radio, if the network provider supports that. But the savings are far away from the savings of an 6h sleep.

Reply Children
No Data
Related