RFM12 to RFM69

I am trying to move up from RMF12 to RFM69. I am failing to get the RFM69 module to work.

Using the following sketch:-

#include <JeeLib.h>
#define RF69_COMPAT 0  
#define freq RF12_868MHZ
#define nodeID 22
#define networkGroup 210
typedef struct {
  int A;
  int B;
  int C;
  int D;
}
Payload;
Payload megatx;
void setup()
{
  Serial.begin(115200);
  Serial.println();
  Serial.println("  Initialize RFM69");
  Serial.println();
  rf12_initialize(nodeID, freq, networkGroup);
  Serial.println("Test");
}
void loop() {69
  megatx.A = 1234;
  megatx.B = 5678;
  megatx.C = 9012;
  megatx.D = millis();
    rf12_sendNow(0, &megatx, sizeof megatx);                   
    rf12_sendWait(2);
    Serial.println("");
    Serial.println("  RFM69 sent OK!");
    Serial.print("  Millis  ");
    Serial.println(millis());
  delay(1000);
}

It fails to get to Serial.println("Test"), however if i change to the RMF12 card it runs fine. Any help appreciated.

pb66's picture

Re: RFM12 to RFM69

Have you tried change " #define RF69_COMPAT 0 " to " #define RF69_COMPAT 1 " to run a rfm69 in rfm12 compatibility mode (ie using the rfm12 jeelib)

Paul

 

Robert Wall's picture

Re: RFM12 to RFM69

"Compatibility" is quite a misnomer. It is only the hardware that is compatible - the physical size and the connections.

The effect of the #define is actually to replace a large chunk of code that is only for the RFM12B with an equally large chunk that is only for the RFM69CW.

pb66's picture

Re: RFM12 to RFM69

Agreed it isn't the most accurate descriptor but possibly the most concise method of relaying the concept, As I understood it, the RFM69 is effectively run using the rf12 lib in a way that is compatible with existing rfm12 networks rather than it native format, over at jeelabs work has started on a "RF12_COMPAT" so that rfm12's can be run using the packet format and settings native to the rfm69 instead a form of forward compatibility to open up some of the benefits of using a rfm69, so prepare for further confusion!!!

Paul

Tony Antique's picture

Re: RFM12 to RFM69

Given that I do not know what I am really doing, but I am using an Mega 2560.

Changing " #define RF69_COMPAT 0 " to " #define RF69_COMPAT 1 " made no difference as  did using " #define RF12_COMPAT 0 " or " #define RF12_COMPAT 1 "

However if I move the IRQ pin from Pin 2 to Pin 3 the script runs as far as

rf12_sendNow(0, &megatx, sizeof megatx);

and then stalls. ie not sending.

Any ideas?

Tony

Robert Wall's picture

Re: RFM12 to RFM69

You never mentioned your hardware! That makes a difference - if you don't say, we assume the latest emonTx. Would a guess that you are using the emonTx Shield be correct?

Have you re-introduced the naming conflict with "freq"? You had that problem 15 months ago. Try changing it to "FREQ" or "RF_FREQ".

Tony Antique's picture

Re: RFM12 to RFM69

I am sorry, but I am using a JeeLabs RFM12B board  and am trying to upgrade to their RFM69CW board. The RFM12B board has been working fine fo some months, but I want to increase the range.

Thank you for pointing this out my "freq" error. Unfortunately this does not solve my problem.

Tony.

Robert Wall's picture

Re: RFM12 to RFM69

Paul,

Yes, the message format too is compatible with the JeeLib RFM12B message format, but I had trouble with the RFM69CW and a payload longer than 60 bytes (6 short of the advertised maximum).

Robert Wall's picture

Re: RFM12 to RFM69

Tony, your next step is to carefully compare the spec for the two boards, then check the '69 board (interrupts, pins, etc) against the Arduino board that you're actually using, looking especially hard where the differences are between the two JeeLabs boards (if any). Some Arduino boards have differences where "features" have been added that introduce a conflict. Google should be your friend here.

It isn't a power supply problem? The '69 takes a lot more current to transmit at maximum power.

pb66's picture

Re: RFM12 to RFM69

Which JeeLabs board(s) are you using? from what I read on JeeLabs site the difference between their rfm12 and rfm69 variants of the same boards is just the rfm module itself, much like the RFM2Pi's rfm12 and rfm69 versions. So the same firmware with " #define RF69_COMPAT 0 " changed to " #define RF69_COMPAT 1 " should work if the rfm12 version worked ok. changing the IRQ should not change anything if only the rfm module has changed.

Did you make any other changes? are you certain you have the same sketch you used previously?

Robert - I read that somewhere about the 60byte max on the rfm69 but cannot find it now.

Paul

Robert Wall's picture

Re: RFM12 to RFM69

"Robert - I read that somewhere about the 60byte max on the rfm69 but cannot find it now."

The checksum fails - why I didn't follow up, as it's unlikely anyone will need to send that much data. JeeLabs know about it, and it's in a comment in the 3-phase sketch. That might be where you saw it.

emjay's picture

Re: RFM12 to RFM69

@pb66 is correct - the currently shipping JeeLabs RFM12B and RFM69CW boards use the same PCB layout and components, the only difference is which RF module gets populated.

Both builds of the driver (as selected by the #define RF69_COMPAT value) set the default Tx power to maximum. Not surprisingly, the current required from the 3.3V rail is higher (~45mA) for the 69CW versus the  12B.  Is the add on board 3.3V rail derived by using the PCB mounted LDO, fed with a stiff 5V supply? IIRC, the 2560 3.3V supply is  limited to ~50mA total.

If that checks out, I would look closely at the interrupt world - note that you should have the right pin since the wiring has not changed from the working RFM12B case, but unconventionally, the interrupt sense is now inverted  i.e. attention is requested by a low to high transition on the designated IRQ pin.

 

 

 

 

Tony Antique's picture

Re: RFM12 to RFM69

I can confirm that there is no physical difference between the two boards except for the rf module.

The Arduino boad is supplied from a 600ma 9v supply and the module is picking up the 5v supply. There is no change in voltage on the 5 volt line between either of the boards.

Using the script I first posted works with  #define RF69_COMPAT 0  with the RFM12B board - it still works with the RFM12B if I comment out the line. It stalls if I set RF69_COMPAT 1.  I have moved #define RF69_COMPAT 0 to the first line of the script as mentioned in JeeLib.h

With the RMF69CW it stalls on all versions of the script at ,<  rf12_initialize.. >

Thanks for your help.

Robert Wall's picture

Re: RFM12 to RFM69

It's always possible that you have a bad RFM69CW or board.

Tony Antique's picture

Re: RFM12 to RFM69

I think you may be right, although I brought two and they both behave the same. (Bad batch?)

Thank you for your help.

Tony.

pb66's picture

Re: RFM12 to RFM69

It's funny how differently people see the same thing, although not conclusive either way I would of said the odds of seeing 2 faulty units was pretty slim and be inclined to think the opposite :-)

Speaking of opposites, can you check the orientation of the rfm boards? as the rfm69 "looks" upsidedown compared to the rfm12 when installed correctly as the chip and the crystal occupy opposite sides/ends. If you look at the "Identifying different Radio Modules" guide by Robert, the modules are  all pictured with pin1 top left, the first 2 rfm69 pics show thw xtal on the left of the chip but the remaining 3 rfm12 pics show the xtal on the right of the chip.

Did you buy them as complete boards? 

Paul

Robert Wall's picture

Re: RFM12 to RFM69

Try comparing your sketch against the equivalent emonTx Shield sketch. If there's a difference that can't be explained by hardware differences, that's got to be looked at closer.

Tony Antique's picture

Re: RFM12 to RFM69

Thank you, but the orientation of the boards was my first trauma when assembling the boards.

I am just stumped by the fact that the RFM12M works as expected but the RFM69CW doesn't. Further I cannot see  any difference between the two.

Jeelabs have contacted me so I am hoping they can see something.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.