Author Topic: Listen Mode Reliability and Power Consumption Question  (Read 433 times)

overlord

  • Newbie
  • *
  • Posts: 24
  • Country: de
    • View Profile
Listen Mode Reliability and Power Consumption Question
« on: February 20, 2018, 10:40:42 AM »
Hello,

I have a new node type for a smoke detector integration which could be woken up from the GW in the following way:

1. Node with ID 100 is in deep sleep with ListenMode
2. GW gets command via serial to issue a wakup to Node 100, creates a dynamic session ID and send this with listenModeSendBurst(...)
3. Node wakes up stores session ID waits for normal message if no normal message arives after 5 seconds goes back to sleep.
4. GW gets command to send normal message to Node along with the session ID as encrypted normal message
5. Node receives normal message and compares the session ID from step 2-3 with step 4, if they match the message is valid (avoids replay attacks)
6. Nodes does some action and goes back to deep power sleep and ListeMode

Curently my Node is invoked every 10 minutes and sends back the Battery state in step 6. I monitor the data in Grafana on my Pi to make a 3 months test on reliability.
I have the following questions:
1. How much uA additional power will Listen Mode use? This is hard to measure because in Listenmode I have no constant power consumption as in WDT deep sleep only.
(WDT deep sleep is now 4-6 uA with 3V/8Mhz Moteino) I have RFM69HW.

2. How reliable is ListenMode in your experience?
Could I run a Node for 12 months in that way given a reliable Power source? Or it is better to wakeup the Node from time to time also with WDT timeout instead sleep forever and relying ListenMode wakup only?

Best Regards,
René

« Last Edit: February 20, 2018, 10:56:21 AM by overlord »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5220
  • Country: us
    • View Profile
    • LowPowerLab
Re: Listen Mode Reliability and Power Consumption Question
« Reply #1 on: February 21, 2018, 09:52:31 AM »
Curently my Node is invoked every 10 minutes and sends back the Battery state in step 6. I monitor the data in Grafana on my Pi to make a 3 months test on reliability.
I have the following questions:
1. How much uA additional power will Listen Mode use? This is hard to measure because in Listenmode I have no constant power consumption as in WDT deep sleep only.
(WDT deep sleep is now 4-6 uA with 3V/8Mhz Moteino) I have RFM69HW.

2. How reliable is ListenMode in your experience?
Could I run a Node for 12 months in that way given a reliable Power source? Or it is better to wakeup the Node from time to time also with WDT timeout instead sleep forever and relying ListenMode wakup only?

Hi René,

I have not extensively used ListenMode yet myself, but I know people who have.
It is reliable and for a high reliability requirement, you can always implement a WDT reset if the node locks up, this would also prevent any bugs in your code to freeze the node.

How much current is hard to really tell, but you can estimate based on the duty cycle of the RX vs Sleep time. RX is about 15mA just for the radio module, and add the MCU, another 8mA-12mA depending what it does and if it runs at full speed. In sleep you can achieve very low power - 2uA in "forever sleep" or 6-7uA using WDT sleep (periodic wakeup). These numbers are valid for Moteino not other platforms which I am not really familiar with.

I was hoping others who used ListenMode could chime in and add their experience.

overlord

  • Newbie
  • *
  • Posts: 24
  • Country: de
    • View Profile
Re: Listen Mode Reliability and Power Consumption Question
« Reply #2 on: February 26, 2018, 12:13:41 PM »
Hello Felix,

thanks for your reply. My sketch did run for about 2 weeks in a endless loop described in my post, woken up by the GW every 10 minutes.
The node got stuck after that time and could not be woken by the GW anymore.
So now I added as you suggested an extra WDT timeout, if the node was not be woken up by the radio for 10 minutes,  I reset the radio and again activate Listenmode. For that purpose I sleep in 8 sec. WDT loops and if I wake aup I check the radio for received bytes.

How could I detect that I was woken up from the Radio or the WDT Timeout after a LowPower.powerdown(8sec)?

Best Regards,
René
 

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5220
  • Country: us
    • View Profile
    • LowPowerLab
Re: Listen Mode Reliability and Power Consumption Question
« Reply #3 on: February 26, 2018, 02:45:23 PM »
How could I detect that I was woken up from the Radio or the WDT Timeout after a LowPower.powerdown(8sec)?
Set yourself a counter (in EEPROM is a good place) and increase it when you wake from WDT.
Or send a "WDT_RESTART" message when you restart. Something like that.

perky

  • Hero Member
  • *****
  • Posts: 839
  • Country: gb
    • View Profile
Re: Listen Mode Reliability and Power Consumption Question
« Reply #4 on: February 26, 2018, 06:21:46 PM »
How could I detect that I was woken up from the Radio or the WDT Timeout after a LowPower.powerdown(8sec)?

I would set a flag in the watchdog ISR and check it in the main loop just after it wakes up if you just want to determine the wakeup source.

I think though there's some kind of race condition happening, possibly the radio is interrupting fractionally after the decision is made to go to sleep but before the sleep instruction is executed. What you should do before going to sleep is first disable global interrupts, and then check all the sources that could wake it up. If any are active don't go to sleep and just re-enable interrupts. If none are active go to sleep and the instruction just before the sleep instruction will re-enable interrupts. Look carefully at your code to convince yourself that no wake interrupt could slip through the net before sleep is executed.

Mark.
« Last Edit: February 26, 2018, 06:48:49 PM by perky »

overlord

  • Newbie
  • *
  • Posts: 24
  • Country: de
    • View Profile
Re: Listen Mode Reliability and Power Consumption Question
« Reply #5 on: March 11, 2018, 11:25:47 AM »
Hello,

today my node died after 2 weeks in the mode described above. Batteries were at 1,5 Volt from 3.2 volts yesterday.
So something does not really work in Listenmode. After 2 weeks in listenmode the node dies.
How could I reset the RFM69 completely. I think the reset pin of the chip is not connected to one of the IO ports of the AVR?
I would like to issue an HW reset of the RFM69 if Listenmode is stalled.

Best Regards,
René


Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5220
  • Country: us
    • View Profile
    • LowPowerLab
Re: Listen Mode Reliability and Power Consumption Question
« Reply #6 on: March 15, 2018, 12:16:50 PM »
How could I reset the RFM69 completely. I think the reset pin of the chip is not connected to one of the IO ports of the AVR?

@overlord,
Have you tried to simply use the watchdog reset?
Upon reset you can re-initialize the radio which should take care of any lockup.
Also if you need a hardware reset, you will need to jumper the radio RESET pin to one of the AVR pins of your choice.

perky

  • Hero Member
  • *****
  • Posts: 839
  • Country: gb
    • View Profile
Re: Listen Mode Reliability and Power Consumption Question
« Reply #7 on: March 15, 2018, 12:30:25 PM »
Note if you do wire the RESET pin from the radio to an AVR I/O pin make sure you drive it with an open source driver (i.e. only drive high and tri-state otherwise), and poll the pin after pulsing high until it returns back low again so you can be sure the radio has completed it's internal POR cycle. The RFM69 RESET pin is the opposite sense to the RFM12B which is driven by an open drain signal.

Mark.
« Last Edit: March 15, 2018, 12:36:22 PM by perky »