Main Menu

Moteino wake up

Started by jaime1988, August 27, 2013, 05:46:08 AM

jaime1988

Hi,

I'm working on a project which puts the moteino in sleep mode and wakeups with a 4x4 keypad. I was wondering if it's possible to wake up the moteino with the rfm69w too and how.

Thanks and best regards.
Jaime

Felix

You mean something like wake-on RF?
You would have to keep the RX part of RFM69 on. I haven't tried it but it could work (but I don't have example code). However in RX mode the radio still uses a lot of current compared to sleep mode. So I don't know if it's going to save you a lot of power that way.

RFM69 has a feature which I have not implemented in the library which supposedly allows the radio to periodically wakeup and check for RF activity. Really no idea how good that works. I might give that a try sometime.

Sorry I'm not more resourceful in this direction right now.

Charly86

Felix,
I want to try this thing out one day, and I'm wondering how it works really. May be Felix would have more precision.

If RFM69 set to RX and receive a frame, it will fire a IRQ to wake up the ATMega, on this point it's ok for me, now the other question is :

Regarding the library, I think the RFM69 fire a IRQ when it receive a frame for targeted network since SYNCWORD1 is 0x2D and SYNCWORD2 is network ID. I think this will wake up every node on the same network, is that correct ?

If I want to achieve wake up only to targeted node (or broadcast) I need to use hardware filtering on the node (and setup broadcast address if I need it), is that correct ?

thank you for your clarification.


Felix

By default it will receive a packet only addressed to it.
You can turn node addressing off and receive any packet on the same network (SYNC word 1).
See the datasheet for more details of how this works.

Charly86

Felix,

Thank you for your answer and you support. What I do not understand is that on your library the sync2 value is networkID not the nodeid, and as the node filtering is not activated on RFM69 hardware (because you're doing it on your RFM69 driver code).

/* 0x2f */ { REG_SYNCVALUE1, 0x2D },      //attempt to make this compatible with sync1 byte of RFM12B lib
/* 0x30 */ { REG_SYNCVALUE2, networkID }, //NETWORK ID
..
//* 0x39 */ { REG_NODEADRS, nodeID }, //turned off because we're not using address filtering

So from my point of view, this means that every packed for the targeted network will wake up any node on the same network (RFM69 will fire IRQ), then when nodes will wake up by this IRQ (going out of sleep mode), your driver will provide the frame to the only targeted node (except if promiscuous). So all nodes will wake up from sleep but only the targeted will receive the packet. That is my understanding, but it's really confusing, may be I should do real testing.

But reading datasheet, we can use REG_NODEADRS to avoid Hardware wake up by IRQ if we're not the destination NodeID, but in this case we will loose promiscuous mode but by setting also register Broadcastaddress we can define a broadcast address which will wake up every node on the targeted network when this NodeID address will be used so it could feet my needs.



Felix

Charly,
The packet will only be received if the radio is listening. If it's sleeping it will not "hear" anything.
An yes you are correct, all listening readios will receive the packets but will filter out the packets not addressed to them.