RFM22 + Arduino

Problem: “RF22 init failed”

Hardware: RFM22 and an Arduino Uno

Software: Arduino IDE 0022

Code: RF22 Library for Arduino (http://www.open.com.au/mikem/arduino/RF22/index.html)

I’ve been using the RF22 library for Arduino to use the RFM22 module with some Arduino Pro Minis. Loads of fun. Now I’d like to include an Uno but I can’t get the radio to initialize. I’ve double and triple checked the wiring and the code. Anyone know if i need to do something special for this to work on an Uno?

// rf22_datagram_client.pde
// -*- mode: C++ -*-
// Example sketch showing how to create a simple addressed messaging client
// with the RF22Datagram class. RF22Datagram class does not provide for reliability.
// It is designed to work with the other example rf22_datagram_server

#include <RF22Datagram.h>
#include <RF22.h>
#include <SPI.h>

#define SERVER_ADDRESS 0
#define CLIENT1_ADDRESS 1

// Singleton instance of the radio
RF22Datagram rf22(CLIENT2_ADDRESS);

void setup() 
{
  Serial.begin(9600);
  if (!rf22.init())
    Serial.println("RF22 init failed");
  // Defaults after init are 434.0MHz, modulation GFSK_Rb2_4Fd36
}

// Dont put this on the stack:
uint8_t buf[RF22_MAX_MESSAGE_LEN];
void loop()
{
  while (1)
  {
    Serial.println("Sending to rf22_datagram_server");
    
    // Send a message to rf22_server
    uint8_t data[] = "Hello World!";
    rf22.sendto(data, sizeof(data), SERVER_ADDRESS);
   
    rf22.waitPacketSent();
    // Now wait for a reply
    if (rf22.waitAvailableTimeout(500))
    { 
      // Should be a message for us now   
      uint8_t len = sizeof(buf);
      uint8_t from;
      uint8_t to;      
      if (rf22.recvfrom(buf, &len, &from, &to))
      {
        Serial.print("got reply from : 0x");
        Serial.print(from, HEX);
        Serial.print(": ");
        Serial.println((char*)buf);
      }
      else
      {
        Serial.println("recv failed");
      }
    }
    else
    {
      Serial.println("No reply, is rf22_datagram_server running?");
    }

  }
}

solved here: viewtopic.php?f=32&t=27960

Hi, I got the same problem. Did you mean you change to FTDI wireless chip? I cannot. I have been working on RFM22B for more than two weeks using the same program. I found that if delay time in reset function is increased to 30 from the orignial 1, initialization will be done. In addition, if the mode frequency is changed to RD=1 and FD=5, sending function will be working. But I still figure out how to receive a message.

Hi,

I have also been testing my RF22 library with Arduino Uno.

It appears that something in the Uno is interfering with MISO pin, preventing the RFM initialisation completing. Miso is held at 0 when I would expect the RFM22 to output data on MISO. I suspect it is the U8A USP interface chip (its the only other thing connected to MISO. And if I power the Uno + RFM22 from a battery instead of USB, it works fine.

This is also perhaps consistent with rubinoae’s experience where reprogramming the U8A fixes this problem.

In the meantime, my advice in the RF22 library main page is unchanged:

RF22 does not work with Arduino Uno, out of the box.

Hey guys,

I have an arduino uno and I need to get an RF22M-B transceiver up and running on it. I’ve read through the previous posts but I’m a bit confused as to what the solution was. Am I correct in saying that if you power the Uno through a battery it works fine? Can I use the power jack then? Also, I’m not sure how rubinoae’s post about reprogramming the bootloader relates to solving the problem with initialising the RFM22. Does the Uno’s bootloader require to be reprogrammed?

Cheers,

IronMikeModem

I re-burned bootloader, tried external power supply and I´m still getting “init failed” on two different modules.

Has anyone solved this?