Require help with multiple RFM69 Transceivers on one Arduino Mega

Hi all,

I'm currently trying to run two RFM69 transceivers on one Arduino Mega. The two transceivers in question are required to receive a message from a transmitter located in the room, and report back the RSSI for comparison.

The problem seems to arise when i attempt to initialise the second transceiver. If i leave this commented out, the first transceiver outputs the RSSI on the serial monitor with no problems. However, when i uncomment the lines initialising 'radio2', the first transceiver is unable to report the RSSI. Neither is the second transceiver.

I'm using the LowPowerLabs RFM69 library and my code is shown below:

// Include the RFM69 and SPI libraries:

#include <RFM69.h>
#include <SPI.h>

// Addresses for this node. CHANGE THESE FOR EACH NODE!

#define NETWORKID     0   // Must be the same for all nodes
#define MYNODEID      2   // My node ID
#define TONODEID      1   // Destination node ID

// RFM69 frequency, uncomment the frequency of your module:

//#define FREQUENCY   RF69_433MHZ
#define FREQUENCY     RF69_868MHZ

// AES encryption (or not):

#define ENCRYPT       false // Set to "true" to use encryption
#define ENCRYPTKEY    "TOPSECRETPASSWRD" // Use the same 16-byte key on all nodes

// Use ACKnowledge when sending messages (or not):

#define USEACK        false // Request ACKs or not

// Pins for Tranceiver selection 
#define SPI_CS              53
#define IRQ_PIN             2
#define IRQ_NUM             0

#define SPI2_CS             49
#define IRQ_PIN2            3
#define IRQ_NUM2            1

// Create a library object for our RFM69HCW module:

RFM69 radio = RFM69(SPI_CS, IRQ_PIN, false, IRQ_NUM);
RFM69 radio2 = RFM69(SPI2_CS, IRQ_PIN2, false, IRQ_NUM2);
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");  

  // Initialize the RFM69HCW:

  radio.initialize(FREQUENCY, MYNODEID, NETWORKID);
  radio.setHighPower(); // Always use this for RFM69HCW
 
//  radio2.initialize(FREQUENCY, MYNODEID, NETWORKID);
//  radio2.setHighPower(); // Always use this for RFM69HCW

}

void loop()
{
 
  // RECEIVING

  // In this section, we'll check with the RFM69HCW to see
  // if it has received any packets:

  if (radio.receiveDone()) // Got one!
  {
    Serial.print("Transceiver 1 RSSI: ");
    Serial.println(radio.RSSI);
    Serial.print("\n");
  }

    if (radio2.receiveDone()) // Got one!
  {
    Serial.print("Transceiver 2 RSSI: ");
    Serial.println(radio2.RSSI);
    Serial.print("\n");
  }
}

Context: I'm constructing a simplistic Watson Watt DF system and need to run both transceivers on a single arduino.

CB316:
Hi all,

I'm currently trying to run two RFM69 transceivers on one Arduino Mega. The two transceivers in question are required to receive a message from a transmitter located in the room, and report back the RSSI for comparison.

The problem seems to arise when i attempt to initialise the second transceiver. If i leave this commented out, the first transceiver outputs the RSSI on the serial monitor with no problems. However, when i uncomment the lines initialising 'radio2', the first transceiver is unable to report the RSSI. Neither is the second transceiver.

I'm using the LowPowerLabs RFM69 library and my code is shown below:

// Include the RFM69 and SPI libraries:

#include <RFM69.h>
#include <SPI.h>

// Addresses for this node. CHANGE THESE FOR EACH NODE!

#define NETWORKID    0  // Must be the same for all nodes
#define MYNODEID      2  // My node ID
#define TONODEID      1  // Destination node ID

// RFM69 frequency, uncomment the frequency of your module:

//#define FREQUENCY  RF69_433MHZ
#define FREQUENCY    RF69_868MHZ

// AES encryption (or not):

#define ENCRYPT      false // Set to "true" to use encryption
#define ENCRYPTKEY    "TOPSECRETPASSWRD" // Use the same 16-byte key on all nodes

// Use ACKnowledge when sending messages (or not):

#define USEACK        false // Request ACKs or not

// Pins for Tranceiver selection
#define SPI_CS              53
#define IRQ_PIN            2
#define IRQ_NUM            0

#define SPI2_CS            49
#define IRQ_PIN2            3
#define IRQ_NUM2            1

// Create a library object for our RFM69HCW module:

RFM69 radio = RFM69(SPI_CS, IRQ_PIN, false, IRQ_NUM);
RFM69 radio2 = RFM69(SPI2_CS, IRQ_PIN2, false, IRQ_NUM2);
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");

// Initialize the RFM69HCW:

radio.initialize(FREQUENCY, MYNODEID, NETWORKID);
  radio.setHighPower(); // Always use this for RFM69HCW

//  radio2.initialize(FREQUENCY, MYNODEID, NETWORKID);
//  radio2.setHighPower(); // Always use this for RFM69HCW

}

void loop()
{

// RECEIVING

// In this section, we'll check with the RFM69HCW to see
  // if it has received any packets:

if (radio.receiveDone()) // Got one!
  {
    Serial.print("Transceiver 1 RSSI: ");
    Serial.println(radio.RSSI);
    Serial.print("\n");
  }

if (radio2.receiveDone()) // Got one!
  {
    Serial.print("Transceiver 2 RSSI: ");
    Serial.println(radio2.RSSI);
    Serial.print("\n");
  }
}




Context: I'm constructing a simplistic Watson Watt DF system and need to run both transceivers on a single arduino.

What are you using for antennas? How far apart are the circuit boards? I suspect the receiver portion in the chip is hearing the oscillator from the other board. Try shielding between the boards with a sheet of aluminum foil, or similar. See if something changes.

Paul