RFM69HCW getting stuck in transmit mode

Started by ard30017, April 24, 2017, 09:50:18 AM

ard30017

I am using a RFM69HCW connected to an Arduino Uno and a logic level translator to send simple messages over the serial port as a test. I have been unable to run the example Node and Gateway sketches successfully. Through the process of debugging I have connected the RFM and logic level translator to a 3.3V power supply rather than powering them from the Arduino, and I am using a simple sketch with only the RFM69.send() function to transmit data (rather than using ACKs and encryption etc.). The problem I am having seems to be occurring when the function setMode is called to switch the RFM69 into transmit mode from standby mode within the function sendFrame(). When this function is called, the current drawn by the RFM69 jumps up and and serial print statements are blocked and will not print out fully in the sender serial port. The receiver node will receive the string sent, but the sender node can no longer perform any actions and the current stays high. the basics of my sending function are presented here:

void loop() {

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

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

      radio.send(TONODEID, sendbuffer, sendlength, false);
      sendlength = 0; // reset the packet
    }
  }
}


Thanks for any help you can offer!

Felix

If your hardware is hooked up correctly and you have done the proper level shifting, then the Node and Gateway will work (mind the IS_RFM69HCW setting!).