0

RFM69HCW init fail
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

RFM69HCW init fail

by uwesan on Tue Oct 10, 2017 3:32 pm

I bought two of the RFM69 breakout boards, and can't get them to initialize on my Arduino Uno. Following the tutorial, I get an Error during compiling:

/home/uwe/sketchbook/libraries/RadioHead/RHHardwareSPI.cpp:109:4: error: #error "Only using transactions in this fork!"
#error "Only using transactions in this fork!"


To "fix" this, I downloaded an older Version of the Radiohead library. Now I get an "init fail" error with both of the boards. The modules are working on my Raspberry Pi Zero (perhaps, I only have one, so I can't send a message while listening and vice versa :)

Perhaps it is a stupid beginner's mistake?

Code: Select all | TOGGLE FULL SIZE
#include <SPI.h>
#include <RH_RF69.h>

// Singleton instance of the radio driver
RH_RF69 rf69;

void setup()
{
  Serial.begin(9600);
  while (!Serial)
    ;
  if (!rf69.init())
    Serial.println("init failed");

  if (!rf69.setFrequency(868.0))
    Serial.println("setFrequency failed");
  rf69.setTxPower(14, true);
}

uwesan
 
Posts: 4
Joined: Tue Oct 10, 2017 3:17 pm

Re: RFM69HCW init fail

by Arudinne on Tue Oct 10, 2017 3:48 pm

What pins did you use? Can you post a picture of the wiring?

Have you tried any of the examples here: https://learn.adafruit.com/adafruit-rfm ... fm69-radio ?

Arudinne
 
Posts: 130
Joined: Sun Mar 19, 2017 9:36 pm

Re: RFM69HCW init fail

by uwesan on Tue Oct 10, 2017 4:18 pm

I tried to use the Pins shown in the tutorial:

IMG_20171010_220838.jpg
Wiring
IMG_20171010_220838.jpg (737.06 KiB) Viewed 74 times


And while posting this Image, I found the error: CS has to be on Pin D10 with my Radiohead Version..

Sorry for the inconvenience, I'm still at the very beginning :)

uwesan
 
Posts: 4
Joined: Tue Oct 10, 2017 3:17 pm

Re: RFM69HCW init fail

by uwesan on Wed Oct 11, 2017 12:26 pm

Hey Again,

I didn't try further yesterday, but now I recognized, that the function rfm69.init() hangs.. All code before that line is executed, but nothing afterwards.. Is it again so easy? :)

Code: Select all | TOGGLE FULL SIZE
#include <SPI.h>
#include <RH_RF69.h>

RH_RF69 rf69;

#define RFM69_RST     2
#define RFM69_CS      11
#define RFM69_IRQ     3
#define RFM69_IRQN    RFM69_IRQ

void setup()
{
  Serial.begin(9600);
  while (!Serial)
    ;
     
  Serial.println("Begin Sketch.");
 
  pinMode(RFM69_RST, OUTPUT);
  digitalWrite(RFM69_RST, HIGH);
  delay(10);
  digitalWrite(RFM69_RST, LOW);
  delay(10);
 
  Serial.println("Reset done.");
 
  if (!rf69.init())
    Serial.println("init failed");

  Serial.println("End Init");

  if (!rf69.setFrequency(868.0))
    Serial.println("setFrequency failed");

  Serial.println("Frequency set.");

  rf69.setModemConfig(RH_RF69::FSK_Rb9_6Fd19_2);
  rf69.setPreambleLength(3);
  uint8_t syncwords[] = { 0x2d, 0xd4 };
  Serial.println("Config set.");
//  rf69.setSyncWords(syncwords, sizeof(syncwords));
}

uwesan
 
Posts: 4
Joined: Tue Oct 10, 2017 3:17 pm

Re: RFM69HCW init fail

by uwesan on Thu Oct 12, 2017 1:37 pm

Hey, update: I know where it hangs, but not why.. :/

spiRead(RH_RF69_REG_27_IRQFLAGS1) always stays 0, so the while-loop never ends. Has somebody an idea?

Following code is from RH_RF69.cpp of the RadioHead library..

Code: Select all | TOGGLE FULL SIZE
void RH_RF69::setOpMode(uint8_t mode)
{
    Serial.println("Hello, here is setOpMode.");
    uint8_t opmode = spiRead(RH_RF69_REG_01_OPMODE);
    Serial.print("setOpmode read opmode="); Serial.println(opmode);
    opmode &= ~RH_RF69_OPMODE_MODE;
    opmode |= (mode & RH_RF69_OPMODE_MODE);

    Serial.print("Setting opMode to "); Serial.println(opmode);

    spiWrite(RH_RF69_REG_01_OPMODE, opmode);
    Serial.println("setOpMode: spiWrite done.");

    // Wait for mode to change -- or hang...
    while (!(spiRead(RH_RF69_REG_27_IRQFLAGS1) & RH_RF69_IRQFLAGS1_MODEREADY)){
        Serial.print("Waiting for change, "); Serial.print(spiRead(RH_RF69_REG_27_IRQFLAGS1));
        Serial.print(", "); Serial.println(RH_RF69_IRQFLAGS1_MODEREADY);
        delay(500);
   }
   ;
}

uwesan
 
Posts: 4
Joined: Tue Oct 10, 2017 3:17 pm

Please be positive and constructive with your questions and comments.