Perfectly fine TX, absolutely no RX - out of ideas

Started by acidicmayonnaisepool, February 21, 2022, 11:12:54 AM

acidicmayonnaisepool

Hey everyone!

Ever since my first post here a week or so ago, I've been continuously trying to get comms between two RFM69 Modules working. I want to preface my following description by saying I'm using sample code from this guide over on sparkfun in order to minimize the chance of my own code being the problem. I have also tried the Node and Gateway sketches provided by the LowPowerLab RFM69 library examples but those have the same result and are generally structured very similarly to the one I'm using.

While tinkering around, I've noticed something pretty interesting. I actually have three modules + accompanying uControllers which makes finding out which functions work on which Module somewhat easier. My three module + uC combos are:

Moteino R6 with RFM69HCW 868MHz
Genuine Arduino UNO with RFM69W 868MHz
Arduino MEGA 2560 clone with RFM69W 868MHz

This page states that while the older 69W/HW modules do not work with the Moteino R6 anymore, they can still talk to the newer modules without any issues.

The two older modules have already been in use and are working perfectly fine when configured to talk to each other, despite their very suboptimal wiring and antennae(100+m range on the highest power setting which was more than enough for me, my application only needs them around 20m apart, with a wall or two in between, which worked fine)


Arduino UNO + RFM69W, "sketchy edition"


Now, to "shrinkify" the receiver of my project, I bought a Moteino R6 and soldered a RFM69HCW radio module to it(After reading a post made here a couple of months ago, I have thoroughly checked the solder connections again, and I am very confident they are not the issue). However, when configuring the sketches so the Moteinos and one of my older modules communicate, the Moteino can TX just fine(With a very strong recieved signal too!) However receiving anything from one of the older modules does not work at all. No ACKs, no received data, nothing. This is odd as I mentioned above that the two older modules talk with each other just fine.

I have tried setting various powerLevels and matching the Bitrate of the two modules to no avail. Is there anything else one can adjust to get older/newer modules to talk to each other reliably, or is it supposed to work 100% fine out of the box(I assumed this is the case)

Here is the code I'm uploading to my uCs, with slight variations depending on the module type/node ID.
// RFM69HCW Example Sketch
// Send serial input characters from one RFM69 node to another
// Based on RFM69 library sample code by Felix Rusu
// http://LowPowerLab.com/contact
// Modified for RFM69HCW by Mike Grusin, 4/16

// This sketch will show you the basics of using an
// RFM69HCW radio module. SparkFun's part numbers are:
// 915MHz: https://www.sparkfun.com/products/12775
// 434MHz: https://www.sparkfun.com/products/12823

// See the hook-up guide for wiring instructions:
// https://learn.sparkfun.com/tutorials/rfm69hcw-hookup-guide

// Uses the RFM69 library by Felix Rusu, LowPowerLab.com
// Original library: https://www.github.com/lowpowerlab/rfm69
// SparkFun repository: https://github.com/sparkfun/RFM69HCW_Breakout

// 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):


// Use ACKnowledge when sending messages (or not):
#define ENCRYPT      false // Set to "true" to use encryption
#define ENCRYPTKEY    "TOPSECRETPASSWRD" // Use the same 16-byte key on all nodes

#define USEACK        true// Request ACKs or not

// Packet sent/received indicator LED (optional):


// Create a library object for our RFM69HCW module:
#define IS_RFM69HW_HCW
RFM69 radio;

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");  

  // Set up the indicator LED (optional):


  // Initialize the RFM69HCW:
  // radio.setCS(10);  //uncomment this if using Pro Micro
  radio.initialize(FREQUENCY, MYNODEID, NETWORKID);
 radio.setHighPower(); // Always use this for RFM69HCW
 radio.setPowerLevel(2);
  radio.readAllRegsCompact();
  Serial.println(" ready");   
  // Turn on encryption if desired:
 
  if (ENCRYPT)
    radio.encrypt(ENCRYPTKEY);
}

void loop()
{
  // Set up a "buffer" for characters that we'll send:

  static char sendbuffer[62];
  static int sendlength = 0;

  // SENDING

  // In this section, we'll gather serial characters and
  // send them to the other node if we (1) get a carriage return,
  // or (2) the buffer is full (61 characters).

  // If there is any serial input, add it to the buffer:

  if (Serial.available() > 0)
  {
    char input = Serial.read();

    if (input != '\r') // not a carriage return
    {
      sendbuffer[sendlength] = input;
      sendlength++;
    }

    // If the input is a carriage return, or the buffer is full:

    if ((input == '\r') || (sendlength == 61)) // CR or buffer full
    {
      // Send the packet!


      Serial.print("sending to node ");
      Serial.print(TONODEID, DEC);
      Serial.print(", message [");
      for (byte i = 0; i < sendlength; i++)
        Serial.print(sendbuffer[i]);
      Serial.println("]");

      // There are two ways to send packets. If you want
      // acknowledgements, use sendWithRetry():

      if (USEACK)
      {
        if (radio.sendWithRetry(TONODEID, sendbuffer, sendlength,10,100))
          Serial.println("ACK received!");
        else
          Serial.println("no ACK received");
      }

      // If you don't need acknowledgements, just use send():

      else // don't use ACK
      {
        radio.send(TONODEID, sendbuffer, sendlength);
      }

      sendlength = 0; // reset the packet
    }
  }

  // RECEIVING

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

  if (radio.receiveDone()) // Got one!
  {
    // Print out the information:

    Serial.print("received from node ");
    Serial.print(radio.SENDERID, DEC);
    Serial.print(", message [");

    // The actual message is contained in the DATA array,
    // and is DATALEN bytes in size:

    for (byte i = 0; i < radio.DATALEN; i++)
      Serial.print((char)radio.DATA[i]);

    // RSSI is the "Receive Signal Strength Indicator",
    // smaller numbers mean higher power.

    Serial.print("], RSSI ");
    Serial.println(radio.RSSI);

    // Send an ACK if requested.
    // (You don't need this code if you're not using ACKs.)

    if (radio.ACKRequested())
    {
      radio.sendACK();
      Serial.println("ACK sent");
    }
  }
}



I've thought about just buying a second Moteino+module but I'm unsure if that would help. As I've said, my older modules, while being suboptimally connected, work with each other just fine which makes me very confident the issue is with how I have the Moteino set up. I know problems that boil down to "help it's not working pls fix" are extremely hard to diagnose/fix when you're not the person experiencing them, but I've been screwing around trying different example sketches, settings, rechecking all connections and solder joints for the past few days with no improvements.
If anyone has any ideas/things I could try, I'd be very thankful!

Felix

There's literally dozens of threads identical to this. When I see Arduino UNOs, floating wires, I will always give my standard answer:
Start with 2 boards that are designed for RFM69/RFM95. They are guaranteed to work (at least the Moteinos).
The $20 more you spend will pay you tons of dividends in saved time/confusion and forum discussions as to what might be wrong.

The next step is to attach an antenna *properly*, and configure the code to match the RFM module (in the case of RFM69 pay close attention to frequency and the IS_HW_HCW parameter), that's all. It's like riding a bicycle, once you learn you never forget.

acidicmayonnaisepool

Since shipping was so fast, I thought I'd follow up in this thread instead of creating a new one.

So, I finally "caved" and bought a second Moteino R6(USB this time, as hooking up stuff with FTDI adapters is a hassle). Well, "caved" is probably too harsh of a word. It's good that I bought another one, as I now have a platform free of sketchy air soldering/wiring. Finally practicing what you preach, Felix  ;)

After soldering the included antenna to it and loading both up with the Example Sketches 'Node' and 'Gateway' respectively and adjusting their settings(mainly the frequency and making sure IS_RFM69HW_HCW is defined) I fired them up without any problems.

Unfortunately, communication is still one-sided. With my "old"(non-USB) Moteino R6 acting as the node sending out packets, everything comes through just fine(~-15db @ 50cm)

However no ACKs or Pings from the "new" Moteino R6 USB acting as the Gateway make it back to the Node. Reversing the roles results in absolutely nothing arriving at the "old" Moteino.

I have double triple quadruple checked the solder joints on the old Moteino(to which I soldered a module manually) and  while there's probably more solder on them than is needed, none of them are touching nor do any of them look suboptimal. I'm hesitant to try to do any more soldering on the module, as I've already applied new solder twice now, and don't want to damage it. I've seen a thread of a user not getting any ACKs due to suboptimal soldering however I doubt soldering is a problem here, otherwise if these solder joints are still suboptimal I should probably watch a few more videos on how to solder  :-[

What would be a good next step? Buying another radio module perhaps? I've only had this new Moteino for around an hour or so, so I've not yet screwed around with it too much, so the problem might resolve itself if I figure out a way to get it working. Just thought I'd update this thread if anyone has any ideas.

I can supply pictures of my soldering/setup in general if needed. I'll attach a readout of the registers from both radios, I am unsure if this'll be of any help as I'm thinking more and more its a hardware problem but it can't hurt I guess.

Registers of "new" Moteino R6 USB with RFM69HCW 868MHz

Registers of "old" Moteino R6 with RFM69HCW 868MHz

Felix

Ok, assuming all is good in the hardware end, now the easiest entry point is starting with some official known working examples from the library, that are guaranteed to work. Once that is behind, you know where to focus next. Divide and conquer (isolate) the problem.

acidicmayonnaisepool

In my above post, I was using the "Node" and "Gateway" sketches basically copy-pasted from that repository(with a few changed settings, mainly making sure the frequency is right and high power is being enabled for my module type)

I've seen a few people try "Struct_receive" and "Struct_send", would those be a good place to start?

I'll try a few others that seem suitable for simple 2 way communication and report back tomorrow as I'll probably be busy for the rest of today.

I've attached pictures of the two radios below.

Module of the "old" Moteino R6 that I soldered myself.

Pre-Soldered module on the "new" Moteino R6 USB I just bought.

Does the top one look genuine? Looks somewhat different to me, especially the missing dot on the main IC indicating the frequency. The one I soldered was purchased from a small german electronics retailer(makershop.de, not an ad, bought it from them as they seem to be the only one offering 868MHz HCW radios in germany and I didn't want to wait for shipping from china) Might just be different batches, no idea. If it turns out to not be a software issue after more testing, this will probably be the first thing I'll replace.

Felix

I'd start with Node and Gateway, the Node example is what I use to test load on each genuine Moteino before I ship/distribute them.
https://github.com/LowPowerLab/RFM69/tree/master/Examples

Not sure how much you save by separately buying radios and soldering yourself.
Moteinos are only officially available from Welectron in Germany and so far they all come with radios. So I can't warrant anything you bought from 3rd parties. Beware of chinese Moteino fakes on aliexpress, they are inferior quality. I mark the radios so I know what frequency they are, silver dot is the 868/915, gold is 433.

acidicmayonnaisepool

Ah, thank you for clarifying the dot marking. The decision to purchase them separately was really the result of my own incompetence, as I thought that the radios I had already bought would be compatible with the R6, which they of course aren't(Literally read your post on the website prior to purchasing and still somehow didn't realize I had the wrong kind, lol). This meant I had to buy a separate radio to solder to the Moteino(As to why I didn't just return it, I had already soldered the FTDI header to the Moteino while waiting for my new and compatible radio to arrive, so it was no longer eligible for returns ::))

Sorry for the long and irrelevant tangent there. I'll try a fresh copy of the node/gateway examples from the github repo tomorrow and provide results. I was already using these as I cloned the repo way back when I set up the first set of radios, but I might have changed some of the code, causing it to not work for whatever reason. My library is fully up to date though, 1.5.1.

acidicmayonnaisepool

I've redownloaded the Node and gateway sketches and uploaded them just now.

These are the only changes I've made to the code:

Set the frequency to 868MHz
Disabled ATC
Made sure IS_RFM69HW_HCW is defined
Set requestACK to true in the Node sketch

Here is the result with the new Moteino R6 USB(COM4) acting as the gateway and the old Moteino R6 non-USB(COM13) acting as the Node:


As you can see, Transmitting on the non-USB Moteino works just fine, however nothing is coming back.

Reversing the roles yields this:




Felix

No real reason not to leave ATC enabled.
Antennas attached/soldered? Although at close range even without antennas it would work (although never recommended to run them without antennas).
Next I would consider looking more closely at the RF transceivers, you had some concerns with one you bought being genuine, and you soldered that - ensure good solder joints - it's quite common that an imperfect solder job will cause a bad connection on the DIO0 -> D2 broken connection which would easily explain exactly what you're seeing.

acidicmayonnaisepool

After doing some more testing, my problem seems to be extremely similar to this post. I can't consistently reproduce it but its likely an issue with one of the solder joints/pads, as I'm able to sporadically get packets through when pressing on random edges of the radio. I initially didn't even consider this as all of the joints look fine to me but I guess you can't ever really see what's really going on under all of that solder.
I'll watch out specifically for DIO0 when trying to fix the solder connections as you mentioned.

Would trying to bake the Moteino be a good idea at all? I've seen people baking PCBs to bring them back to life before but other than that, I'm unsure if its really viable here.

Kind of expected this to be a more obscure issue but I guess with how robust the library and hardware seem to be, 99% of failures are probably soldering-related. I'll update here again if I do manage to get it working.

Lesson: Should've just bought a Moteino with the radio attached in the first place ;)

Felix

Quote from: acidicmayonnaisepool on February 24, 2022, 11:26:10 AM
I can't consistently reproduce it but its likely an issue with one of the solder joints/pads, as I'm able to sporadically get packets through when pressing on random edges of the radio. I initially didn't even consider this as all of the joints look fine to me but I guess you can't ever really see what's really going on under all of that solder.
Ok, my bets are set!

Quote from: acidicmayonnaisepool on February 24, 2022, 11:26:10 AM
Would trying to bake the Moteino be a good idea at all? I've seen people baking PCBs to bring them back to life before but other than that, I'm unsure if its really viable here.
No. Just clean up the joints and resolder. Flux is the solder's friend, and yours.

Quote from: acidicmayonnaisepool on February 24, 2022, 11:26:10 AM
Lesson: Should've just bought a Moteino with the radio attached in the first place ;)
Evrika!