Author Topic: RFM69 + Arduino Uno -> Getting duplicate packets [solution]  (Read 3597 times)

xavier

  • Jr. Member
  • **
  • Posts: 65
  • Country: us
RFM69 + Arduino Uno -> Getting duplicate packets [solution]
« on: January 15, 2015, 03:19:38 PM »
Hi there,

I have an RFM69 connected to my Uno (using connection list from several threads from this forum thanks!) and I have the communication working between Node setup on a moteino and the Uno. I'm using the Node and Gateway examples fyi.

My issue: The Uno is getting 3 times the same message (shows up as receiving 3 packets I suppose since the packetCount is incremented at each radio.receiveDone)

Anyone seen something like this before?

I'm thinking:
1- I fried the RFM69 when playing with it and connecting it directly to the 5V (but somehow it kinda works)
2- my soldering skills (or lack thereof) created some bad connections when soldering the cables (but why would it work at all)
3- I did not do setup the voltage dividers on MOSI, SCK and CS correctly (I'm using the 3.7K and 10K resistors fyi as described here https://lowpowerlab.com/forum/index.php?action=dlattach;topic=744.0;attach=349

Miso does not have any voltage dividers and the RFM69 gets power from the 3.3 of the arduino and the rest is connected to the 5V (to get the amps necessary for the radio) - note as well that radio.write does not seem to send anything (ACK is never received by the arduino)

Any suggestions? I ordered another RFM69 from lowpowerlab so I suppose I'll try again in case I fried the board but let me know if anyone  have any thoughts/suggestions...


X
fyi output from serial: (ACK sent is printed but the the moteino never receives it - when using another moteino as gateway everything works fine)
#[1][2] 123 ABCDEFGHIJKLMNOPQRSTUVW [RX_RSSI:-29] - ACK sent. Pinging node 2 - ACK...nothing
#[2][2] 123 ABCDEFGHIJKLMNOPQRSTUVWX [RX_RSSI:-29] - ACK sent.
#[3][2] 123 ABCDEFGHIJKLMNOPQRSTUVWX [RX_RSSI:-30] - ACK sent.
#[4][2] 123 ABCDEFGHIJKLMNOPQRSTUVWX [RX_RSSI:-29] - ACK sent. Pinging node 2 - ACK...nothing
« Last Edit: April 25, 2015, 08:41:05 AM by Felix »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5992
  • Country: us
    • LowPowerLab
Re: RFM69 + Arduino Uno -> Getting duplicate packets
« Reply #1 on: January 15, 2015, 03:41:11 PM »
Basically what probably is happening, the sending node is not getting back the ACKs. Hence it will send, then wait for ACK, resend once and wait for ACK again, resend #2 and wait for ACK, then fail and send the next string, etc.
So you have some kind of problem with the sending side on your UNO.

xavier

  • Jr. Member
  • **
  • Posts: 65
  • Country: us
Re: RFM69 + Arduino Uno -> Getting duplicate packets
« Reply #2 on: January 15, 2015, 04:59:35 PM »
thanks for the reply Felix. You're right about the sending node not getting back the ACK and resending 3 times (sorry I should have looked at the code in sendWithRetry).

What I'm still not clear on is why the ACK is not received - the same code (for the gateway) works just fine on the moteino - so maybe I screwed up something on the MOSI of the RFM69? (I suppose the mosi pin is the one that gets the data that needs to be sent on the radio) -

Connected the wifi CC3000 shield over the Uno and hooked up the RFM69 and now I don't even get past the radio init..oh well time to search some more. (Trying this out w the RF24 seemed easier but I'll try moteino to cc3000 shield later today just in case)

Anyhow, I'll try to change the resistor and see what happens, let me know if you have any other ideas on this.

Thanks again for the help!

X
« Last Edit: January 15, 2015, 06:14:38 PM by xavier »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 5992
  • Country: us
    • LowPowerLab
Re: RFM69 + Arduino Uno -> Getting duplicate packets
« Reply #3 on: January 15, 2015, 07:54:24 PM »
You need to make sure the hardware is connected properly, and that the RFM69 which is 3.3V is properly buffered to the UNO which is 5V.
Also each SPI device has a different CS pin/line.
My library disables interrupts at critical points to avoid cross talk between the RFM69 and other SPI transactions that could happen at the same time, and also it restores the SPI settings after each transaction of its own. In other words it makes sure it does not interfere with other SPI devices.

Gandalph

  • Newbie
  • *
  • Posts: 3
Re: RFM69 + Arduino Uno -> Getting duplicate packets
« Reply #4 on: April 20, 2015, 04:36:47 PM »
sorry to revive this old thread, but I have exactly the same issue and out of ideas...
My setu[p is as follows: Buono R3 with RFM69HW on one side, and Pro Mini on the other, loaded with the Gateway/node example from the library.

Sending is fine from either side, if I flip the gateway sketch to the node and vice versa, sending goes absolutely fine (RSSI ~ -30). Both the buono and the pro mini have enough power on the 3.3vpin to power the needed 130mA for the RFM69HW, both have ~8cm antennae fitted (22 gauge solid copper wire) for send frequency of 868Mhz.

Only thing is, not a single ACK gets received by either the Buono when its acting as the gateway, or by the Pro mini when it acts as the gateway.

Any idea's anyone?

Gandalph

  • Newbie
  • *
  • Posts: 3
Re: RFM69 + Arduino Uno -> Getting duplicate packets
« Reply #5 on: April 25, 2015, 08:21:35 AM »
will answer this one myself, as I figured it out: turns out to be a library problem. I have removed the RFM69 lib I had installed, and re-installed the one from lowpowerlab GIT https://github.com/LowPowerLab/RFM69 into the RFM69 folder under libraries (as per readme) and VOILA! it (finally) works!

cheers

pipegf88

  • Newbie
  • *
  • Posts: 4
Re: RFM69 + Arduino Uno -> Getting duplicate packets [solution]
« Reply #6 on: June 05, 2015, 09:49:05 AM »
Xavier, I had the same problem, its just what they say here, the radio.sendWithRetry() command tries 3 times, waiting for the ack response. Or either you deactivate the ack response or you just go with radio.sendWithRetry(GATEWAYID, sendBuf , sendSize,0); The 0 at the end means no retry, and it will only send it one time.

Hope it works,

Pipe

TomWS

  • Hero Member
  • *****
  • Posts: 1891
Re: RFM69 + Arduino Uno -> Getting duplicate packets [solution]
« Reply #7 on: June 05, 2015, 02:09:45 PM »
Xavier, I had the same problem, its just what they say here, the radio.sendWithRetry() command tries 3 times, waiting for the ack response. Or either you deactivate the ack response or you just go with radio.sendWithRetry(GATEWAYID, sendBuf , sendSize,0); The 0 at the end means no retry, and it will only send it one time.

Hope it works,

Pipe
or you could just use radio.send()...
or fix the problem in which Acks aren't getting though...