1

Hi I'm trying to get the RFM69 rf module to work on an arduino uno.

Here is my code:

#include <SPI.h>
// Addresses for this node. CHANGE THESE FOR EACH NODE!
#define NETWORKID     0   // Must be the same for all nodes (0 to 255)
#define MYNODEID      2   // My node ID (0 to 255)
#define TONODEID      1   // Destination node ID (0 to 254, 255 = broadcast)
// RFM69 frequency, uncomment the frequency of your module:
//#define FREQUENCY   RF69_433MHZ
#define FREQUENCY     RF69_915MHZ

// Create a library object for our RFM69HCW module:
RFM69 radio;

void setup()
{
  // Open a serial port so we can send keystrokes to the module:  
  Serial.begin(9600);
  Serial.print("Node ");
  Serial.print(MYNODEID,DEC);
  Serial.println(" ready");  

   if(radio.initialize(FREQUENCY, MYNODEID, NETWORKID))
     Serial.println("Initialized Successful");

  radio.setHighPower(); // Always use this for RFM69HCW
}

void loop()
{
     bool test = radio.sendWithRetry(TONODEID, "Hi", 2);
    Serial.println(test);
} 

which outputs

Node 2 Ready
Initialization Successful
Node 2 Ready
Initialization Successful

which means that the sendWithRetry function is not returning a bool as expected, but I can't figure out why. I am using the code given in the github https://github.com/sparkfun/RFM69HCW_Breakout/blob/master/Libraries/Arduino/RFM69/RFM69.cpp which shows the nitty gritty of the RF69 Module and its arduino code.

I hooked up the hardware according to https://learn.sparkfun.com/tutorials/rfm69hcw-hookup-guide/all and checked all the wiring, so the I concluded that the problem was software based.

Any ideas why this isn't working?

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.