I just built my first JeeNode (v4) and also hooked up an RFM12B to an arduino and loaded the latest version of the RF12Demo.pde sketch on it (from here http://code.jeelabs.org/viewvc/svn/jeelabs/trunk/libraries/RF12/examples/RF12demo/).
Everything is working fine, I can send data between the 2 nodes, except, the "ack" is not working. If I send a broadcast ("t"), the receiving node is sending back an "ack" My node ids are 5 and 6, if I do this from node 6: "1,2,3,5a", node 5 receives the data fine, but does not send an "ack" back.
If I do this from node 6: "t", node 5 receives the data fine and sends an "ack" back.
I think I tracked down the issue to this line in the RF12Demo sketch:
if ((rf12hdr & ~RF12HDRMASK) == RF12HDRACK &&
(config.nodeId & COLLECT) == 0) {
Serial.println(" -> ack");
If a broadcast is sent from node 6 to node 5 then the rf12hdr looks like this (binary): 00100110 If a data packet is sent using "1,2,3,5a" from node 6 to node 5 then rf12hrd looks like this: 01100101
Note that bit 6 is set now (which is the RF12HDRDST flag).
So the statement "if ((rf12hdr & ~RF12HDRMASK) == RF12HDRACK)" will not return true, even if the bit 5 is set (RF12HDRACK) and no "ack" is being sent.
The result of (rf12hdr & ~RF12HDRMASK) is 01100000 which is not equal to 0100000 (FR12HDRACK).
Am I using the demo sketch wrong? Is an ack only send back for broadcast packets or what is the purpose of the RF12HDRDST flag?
Thanks, Mike
