ACK...ok! vs. ACK...nothing with same code ... Seeeduino Stalker

Started by Clemens, February 21, 2015, 02:21:52 PM

Clemens

I have set up two boards with RFM69CW modules. First is an Uno, the second one a Seeeduino Stalker. Shields are slight different because of the operation power of 5V vs. 3.3V. But beside the voltage divider the boards are the same.

Due to some hardwired parts on the Seeeduino I use other SS and IRQ pins (for both boards). I tweak the lib as described under https://lowpowerlab.com/forum/index.php/topic,225.msg5960.html#msg5960 (this post not the thread) for the SS pin (9 instead of 10), and as mentioned here https://lowpowerlab.com/forum/index.php/topic,460.msg5938.html for the IRQ pin (3 instead of 2).

I tried a modified gateway / node sketch (without flash part) and get this:

1) Uno as Gateway, Seeeduino as Node

output Uno (gateway)
Listening at 868 Mhz...
#[1][2] 123 ABCDEF   [RX_RSSI:-26] - ACK sent. Pinging node 2 - ACK...nothing
#[2][2] 123 ABCDEFG   [RX_RSSI:-28] - ACK sent.
#[3][2] 123 ABCDEFGH   [RX_RSSI:-26] - ACK sent.
#[4][2] 123 ABCDEFGHI   [RX_RSSI:-26] - ACK sent. Pinging node 2 - ACK...nothing
#[5][2] 123 ABCDEFGHIJ   [RX_RSSI:-28] - ACK sent.
#[6][2] 123 ABCDEFGHIJK   [RX_RSSI:-29] - ACK sent.


output Seeeduino (node)
Transmitting at 868 Mhz...
 ok!
Sending[1]: 1 ok!
Sending[2]: 12 ok!
Sending[3]: 123 ok!
Sending[4]: 123  ok!
Sending[5]: 123 A ok!
Sending[6]: 123 AB ok!


So the node is sending and the Uno as gateway is also receiving messages. The problem is ACK...nothing

Next I tried it with the same code vice versa:


2) Uno as Node, Seeeduino as Gateway

output Seeeduino (gateway)
Listening at 868 Mhz...
#[1][2] 123 ABCDEFGH   [RX_RSSI:-29] - ACK sent. Pinging node 2 - ACK...ok!
#[2][2] 123 ABCDEFGHI   [RX_RSSI:-31] - ACK sent.
#[3][2] 123 ABCDEFGHIJ   [RX_RSSI:-29] - ACK sent.
#[4][2] 123 ABCDEFGHIJK   [RX_RSSI:-30] - ACK sent. Pinging node 2 - ACK...ok!
#[5][2] 123 ABCDEFGHIJKL   [RX_RSSI:-30] - ACK sent.
#[6][2] 123 ABCDEFGHIJKLM   [RX_RSSI:-30] - ACK sent.
#[7][2] 123 ABCDEFGHIJKLMN   [RX_RSSI:-30] - ACK sent. Pinging node 2 - ACK...ok!
#[8


output Uno (node)
Transmitting at 868 Mhz...
 ok!
Sending[1]: 1 ok!
[1] ACK TEST   [RX_RSSI:-27] - ACK sent
Sending[2]: 12 ok!
Sending[3]: 123 ok!
Sending[4]: 123  ok!
[1] ACK TEST   [RX_RSSI:-28] - ACK sent



So it seams the code is per se ok because it works at least in one constellation.

The Uno is working as node and also as gateway. Seeeduino is ok as gateway but has problems as node. We miss the complete output

[1] ACK TEST   [RX_RSSI:-27] - ACK sent


Now I changed in the gateway sketch the number of retries: et voilĂ ! now it's working also in the setting #1 Uno as Gateway, Seeeduino as Node.

f (radio.sendWithRetry(theNodeID, "ACK TEST", 8, 0))  // 0 = only 1 attempt, no retries
to
f (radio.sendWithRetry(theNodeID, "ACK TEST", 8, 1))  // 0 = only 1 attempt, no retries


What do you think is the problem? Is the Seeeduino with 8 MHz to slow or is ther an other problem. First I thought there is a hardware problem or IRQ problem but with a second retry it works, so I now think it is a timing problem.

How can I solve this problem without always a second retry knowing that the first will never work.

Clemens

Funny 1 ms makes the difference! I changed the delay before radio.sendWithRetry from 3 to 4 and it is working.

delay(4); //need this when sending right after reception .. ?
if (radio.sendWithRetry(theNodeID, "ACK TEST", 8, 0))  // 0 = only 1 attempt, no retries