Author Topic: RFM69HW - Arduino Uno  (Read 373 times)

MaxSch95

  • Newbie
  • *
  • Posts: 4
RFM69HW - Arduino Uno
« on: April 26, 2020, 06:32:35 AM »
Hello!

i tried to test to moduls of RFM69HW (433MHz) by connecting each to an Arduino Uno. For the connection i used the Hook-Up Guide of SparkFun.
https://learn.sparkfun.com/tutorials/rfm69hcw-hookup-guide/all

I also used the Example-Code from this site and adjust it. I put my modified Code here:

- https://pastebin.com/qf1cDtBd

I just use the standard libraries of github.

- https://github.com/LowPowerLab/RFM69

(especially RFM69.cpp, RFM69.h, RFM69registers.h)

For testing i connected each Uno to the PC and opened for each a Serial Monitor. For example i put a message "Hello World" in on Serial Monitor. This message was sent by one module  to the other. In the Serial Monitor of the receiving Modul in this case appeared the received message and an ACK was sent back (see picture "Test with ACK (1)"). So each module had send one time - one the message and one the ACK. But after this i cannot send with any modul (see picture "Test with ACK (2)").

To check the problem i decided to go deeper into the RFM69.cpp library. On different spots i read out some registers to look what happen there. So i recognized that both moduls are not able to come back from the mode RF69_MODE_TX to RF69_MODE_STANDBY (see line 335 - in function sendframe). For example, REG_OPMODE keeps the value 0x0C after sending. But i think REG_OPMODE  should have the value 0x04 in Standby-Mode.

Besides, REG_IRQFLAGS1 in the function sendframe has during the first run of sending the value 0x80. But in the second run of sending this register has the value 0x08. So there is a problem in the while-loop in line 308.

In my opinion is the problem in the mode RF69_MODE_TX.  As you see in the pictures a modul can send a ACK after receiving but is not able to send again. So from RF69_MODE_RX there is no problem to come back to RF69_MODE_STANDBY.
I dont know how to fix this problem and i am really frustrated. Could you help me or have some advices? If you need more details, let me know.

I would be really glad about an answer from you!

Have a nice weekend and stay healthy!


Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6279
  • Country: us
    • LowPowerLab
Re: RFM69HW - Arduino Uno
« Reply #1 on: April 26, 2020, 06:40:10 PM »
Hi Max,

I can guarantee that the RFM69 Examples Node+Gateway work. You have to get a few things right:

- correct connections - SPI + power + interrupt pin
- solid wiring, not flimsy long breadboard mess of wires, dont expect anything to work in that case
- correct settings in the sketches - i have added lots of comments there, so it should be a no brainer what to do
- voltage level translation if you have a 5V board

MaxSch95

  • Newbie
  • *
  • Posts: 4
Re: RFM69HW - Arduino Uno
« Reply #2 on: April 27, 2020, 01:34:35 PM »
Hey Felix,

thanks for your fast answer! In your recommended examples, i didnt find any active sending methods. There are just sending methods
in the receiving part. I directly connected the RFM to the Arduino Uno. So i am able to connect the RFM to the 3,3V pin of the UNO. I posted my code here and i am really sure of adjusting the settings right.
( https://pastebin.com/qf1cDtBd )
My problem is that the modul gets stuck after one sending routine. I just need a code which is able to send again and again (like an infinite loop).
 
I would really appreciate your answer. I dont know how to fix it. You are my last chance ;)

PS: I tried it with 2 RFM69HW Moduls with 433MHZ an
      with on RFM69HW Modul with 868MHZ and everytime the same error - i can just send one time....:(
« Last Edit: April 27, 2020, 02:55:29 PM by MaxSch95 »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6279
  • Country: us
    • LowPowerLab
Re: RFM69HW - Arduino Uno
« Reply #3 on: April 28, 2020, 12:09:17 PM »
I could repeat this again and again, its the same thing every time, i cant remotely do this for you.

Just load the Node and Gateway sketches, read the comments in the sketches,  adjust the settings, match things like frequency & network ID.
Pay attention to the IS_RFM69HW_HCW setting to match your hardware, have SOLID and correct wiring, antennas connected, all common sense.
Good luck.

MaxSch95

  • Newbie
  • *
  • Posts: 4
Re: RFM69HW - Arduino Uno
« Reply #4 on: April 28, 2020, 04:09:35 PM »
Thanks for your answer. Taking your recommendations into account i checked everything. The connection should be fine, because i can read out registers and one sending routine is working correctly (see my pictures). But the problem is not solved. I tried it with 3 different moduls.
After >>setMode(RF69_MODE_TX);<< in the function >>RFM69::sendframe<< the module cannot return to RF69_MODE_STANDBY. The setMode-function dont set the right values to
REG_OPMODE and REG_IRQFLAGS1.
After my researches REG_OPMODE have to get the address 0x04 and REG_IRQFLAGS1 have to get the address 0x80 after >>setMode(RF69_MODE_STANDBY);<<.  But after >>setMode(RF69_MODE_TX);<< REG_OPMODE has the address 0x0C and REG_IRQFLAGS1 has sometimes the address 0x08 or 0x28.
Would you please check my code which i postet before and look at my pictures? I dont know what to do. I follow your advices but didnt make any progress. I really need to solve this problem and i am willing to compensate you for your efforts!!!
« Last Edit: April 29, 2020, 02:49:11 PM by MaxSch95 »

MaxSch95

  • Newbie
  • *
  • Posts: 4
Re: RFM69HW - Arduino Uno
« Reply #5 on: May 03, 2020, 05:58:31 AM »
PLEEEASE, I REALLY NEED HELP!

I checked for every mode the registers REG_OPMODE, REG_IRQFLAGS1 & REG_IRQFLAGS2. I can set RX from STANDBY and back to STANDBY.
Also this is possible for SYNTH-mode. BUT: everytime when i try to set TX all the registers are disordered and i cannot set them back to any desired value.
Because of this uncontrolable registers i cannot set back to any other mode.
I tried a lot and dont know what to do. Here is an example of a code from the sendframe function: https://pastebin.com/53wR4Jmd
And I put a picture of the results presented by serial monitor as attachment.

WHAT COULD I DO? Do i forget something for setting TX-mode rightly? Or do i forget some really important things for the exit from TX?

PLEASE...i dont have any idea.... :(

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6279
  • Country: us
    • LowPowerLab
Re: RFM69HW - Arduino Uno
« Reply #6 on: May 03, 2020, 08:50:57 PM »
Why don't you start with a known working board? Like Moteino, there are many different variants with different capabilities, but they all take the RFM69 and RFM95 radios.
Historically people coming to this forum with the "How to make Arduino+RFMxx work" question have always had a lot of trouble. And based on my own experience I tend to believe a lot of this trouble comes from poor wiring inherent to breadboard and air wires. The 5v-3.3v signal buffering is another conundrum that is not very straightforward especially for beginners.

So I created Moteino to solve all these problems. And I put together examples that work with all Moteinos.