RFM69HCW Featherwing and RP2040 Freezes after sending

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
OrlandoR4
 
Posts: 3
Joined: Thu Nov 24, 2022 5:40 pm

RFM69HCW Featherwing and RP2040 Freezes after sending

Post by OrlandoR4 »

Hi everyone, I'm trying to use the RP2040 Feather and the RFM69HCW 433MHz Featherwing. I'm getting this weird behavior where the radio sends a message but then it gets stuck on the send() function, sometimes it never gets out of it, and sometimes it takes anywhere between instantly and a few seconds to move on to the "No reply" message.

I tried both the feather and the rf69 examples, which both have identical code but here is one of the sketches I tried.

I attached an image of my setup, I verified the connections are good.

The RadioHead fork by Adafruit has an unsolved issue which sounds similar to mine:
https://github.com/adafruit/RadioHead/issues/70

Code: Select all

#include <SPI.h>
#include <RH_RF69.h>

// Singleton instance of the radio driver
RH_RF69 rf69(10, 6);
//RH_RF69 rf69(15, 16); // For RF69 on PJRC breakout board with Teensy 3.1
//RH_RF69 rf69(4, 2); // For MoteinoMEGA https://lowpowerlab.com/shop/moteinomega
//RH_RF69 rf69(8, 7); // Adafruit Feather 32u4

void setup() 
{
  Serial.begin(115200);
  while (!Serial);

  // manual reset
  pinMode(11, OUTPUT);
  digitalWrite(11, HIGH);
  delay(10);
  digitalWrite(11, LOW);
  delay(10);

  if (!rf69.init())
    Serial.println("init failed");
  // Defaults after init are 434.0MHz, modulation GFSK_Rb250Fd250, +13dbM (for low power module)
  // No encryption
  if (!rf69.setFrequency(433.0))
    Serial.println("setFrequency failed");

  // If you are using a high power RF69 eg RFM69HW, you *must* set a Tx power with the
  // ishighpowermodule flag set like this:
  rf69.setTxPower(14, true);

  // The encryption key has to be the same as the one in the server
  uint8_t key[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
                    0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
  rf69.setEncryptionKey(key);
}


void loop()
{
  Serial.println("Sending to rf69_server");
  // Send a message to rf69_server
  uint8_t data[] = "Hello World!";
  rf69.send(data, sizeof(data));
  
  rf69.waitPacketSent();
  // Now wait for a reply
  uint8_t buf[RH_RF69_MAX_MESSAGE_LEN];
  uint8_t len = sizeof(buf);

  if (rf69.waitAvailableTimeout(500))
  { 
    // Should be a reply message for us now   
    if (rf69.recv(buf, &len))
    {
      Serial.print("got reply: ");
      Serial.println((char*)buf);
    }
    else
    {
      Serial.println("recv failed");
    }
  }
  else
  {
    Serial.println("No reply, is rf69_server running?");
  }
  delay(400);
}
IMG_4227.jpg
IMG_4227.jpg (67.51 KiB) Viewed 125 times

User avatar
lynx2112
 
Posts: 18
Joined: Fri Oct 25, 2013 10:34 pm

Re: RFM69HCW Featherwing and RP2040 Freezes after sending

Post by lynx2112 »

Im having a similar issue. I am using the RP2040 RFM95 version. It will freeze on send or it will freeze on waitPacketSend()

This gets worse as I add additional logic like reading from a sensor. It will freeze after sending a few packets or freeze instantly.

If i add i2c it freezes 100% of the time, even before i've added additional code for the i2c breakouts.

I did add a 10k voltage divider to the VBAT to monitor the battery voltage as described in the documentation. This appears to work and I am getting values. This doesn't appear to be the cause of the issue.

I am using the example TX code with the additional VBAT monitor.

Please let me know your thoughts?

PS the i2c's i'm trying to hook up to this are BMP390(TempPressure) and BNO085(9DOF)

Another thought, could it be the radiohead library? should I try a different library, or switch to CircuitPython? I thought arduino would be better since it's compiled.

User avatar
lynx2112
 
Posts: 18
Joined: Fri Oct 25, 2013 10:34 pm

Re: RFM69HCW Featherwing and RP2040 Freezes after sending

Post by lynx2112 »

I swapped with circuit python and all of my issues went away. There must be something with the Radiohead library.

User avatar
OrlandoR4
 
Posts: 3
Joined: Thu Nov 24, 2022 5:40 pm

Re: RFM69HCW Featherwing and RP2040 Freezes after sending

Post by OrlandoR4 »

Huh, that's very interesting. I'd like to see Adafruit try to replicate this issue on their end.

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”