[Logo] Anarduino and HopeRF Community Forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics     [Groups] Back to home page 
[Register] Register / 
[Login] Login 
MiniWireless proper use of radio and low power sleep with wake from interrupt  XML
Forum Index » Anarduino
Author Message
obstler



Joined: 04/12/2014 09:48:01
Messages: 8
Offline

I recently received my order of Anarduino MiniWireless with RFM69 modules and I'm trying to setup a battery operated wireless node that basically sleeps until woken up by external interrupt.

While I can get the sample TNode/TGateway sketches from the MiniWireless page working, I'm having troubles with the radio after sleeping -- basically the radio only works before the first sleep. Serial output:



I've tried with two different libs (jeelabs and LowPower), but the result is basically the same. Most of the time the serial debug output keeps working, while the radio never sends after the first sleep. But after many sleep/wake triggers the serial output also starts getting corrupted, outputting garbage characters like and just looping between sleep/wake forever.

Do I have to re-initialize/wake the radio after sleeping? The different samples I've found online seem to to simply call radio.send after waking up. Do I need to delay before/after calling readio.send or sleep?

I've attached the sketch below, maybe someone has some pointers on how to fix this issue, or links to/a working sleep/interrupt sample with the MiniWireless/RFM69 . The sketch is based on the (working) TNode with as few modifications as necessary.

code:


stevech



Joined: 07/07/2014 18:07:27
Messages: 91
Offline

the entry to sleep doesn't command the radio to sleep, right? Its power stays on?
So the sleep mode is just the AVR microprocessor.

If these are true, then you might read the AVR specs and see if the SPI port needs to be reinitialized on wakeup
obstler



Joined: 04/12/2014 09:48:01
Messages: 8
Offline

two updates to the mentioned issues:

the frm69 radio library doesn't need a wakeup call, reading on other forums confirms that send simply needs to be called after sleeping. my sending issue was probably caused by not connecting an antenna to the board -- no idea why it still worked upon intitial powerup and the other sketch without sleeping, but now with an antenna the radio send works fine after waking up.

the corrupted serial debug output seems to be related to (not) flushing the serial buffer before sleeping, calling a Serial.flush() helps, but there's still some output corruption from time to time. I can live with that as is is only used for debugging.

My main issue now is getting the MiniWireless board to sleep with minimal power consumption, see other topic -- currently I'm far away from being able to deploy a battery powered node:

http://forum.anarduino.com/posts/list/39.page

This message was edited 1 time. Last update was at 05/12/2014 09:01:57

Clemens



Joined: 07/01/2015 16:57:02
Messages: 1
Offline

Many thanks for pointing to the Serial.flush(); function. I did a workaround with a classic delay before--in my case--Narcoleptic.delay but flush is much faster.
stevech



Joined: 07/07/2014 18:07:27
Messages: 91
Offline

serial UART line may go to indeterminate voltages in sleep, causing garbled data to be perceived at the receiving end.
Best to use some sort of protocol on the serial line, such as a few special characters after wakeup.

No-antenna - usually OK, no damage to TX. Range limited to 10's of feet. Benchtop OK.
 
Forum Index » Anarduino
Go to:   
Powered by JForum 2.1.9 © JForum Team