Author Topic: undefined reference to `RFM69::listenModeSendBurst'  (Read 1559 times)

handyguy

  • NewMember
  • *
  • Posts: 27
undefined reference to `RFM69::listenModeSendBurst'
« on: January 03, 2019, 10:28:13 PM »
Trying to build some low-power code between two nodes. Here's the relevant parts of the sketch:

Code: [Select]
#define RF69_LISTENMODE_ENABLE  //comment this line out to compile sketches without the ListenMode (saves ~2k)

#include <RFM69.h>         //get it here: https://github.com/lowpowerlab/RFM69
#include <RFM69_OTA.h>     //get it here: https://github.com/lowpowerlab/RFM69
#include <SPIFlash.h>      //get it here: https://github.com/lowpowerlab/spiflash
#include <SPI.h>           //included with Arduino IDE install (www.arduino.cc)
...
#define IS_RFM69HW_HCW  //uncomment only for RFM69HW/HCW! Leave out if you have RFM69W/CW!
//*****************************************************************************************************************************
//#define ENABLE_ATC    //comment out this line to disable AUTO TRANSMISSION CONTROL

...

#ifdef ENABLE_ATC
  RFM69_ATC radio;
#else
  RFM69 radio;
#endif

#define RECEIVER 3

...
void loop(){
...

  // If button is being pressed, light up the LED
  if (buttonState == LOW)
  {
    if (!flag)
    {
      Serial.println("ButtonPressed!");
      flag=1;
      tone(BUZZER_PIN, BUZZER_FREQ, BUZZER_DURATION);
      Serial.print("Sending wakeup burst...");
      radio.listenModeSendBurst((uint8_t)RECEIVER, (void *)"w", (uint8_t)1);

      bool replied = false;
      long start = millis();
      while (millis() - start < BURST_REPLY_TIMEOUT_MS) {
        if (radio.receiveDone()) {
          Serial.println("Success");
          replied = true;
          break;
        }
      }

...
} // loop()

Unfortunately, when I try to compile (using the Ardiono IDE) I get the following error message:

Code: [Select]
"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\parents\\AppData\\Local\\Temp\\arduino_build_270759/Button.ino.elf" "C:\\Users\\parents\\AppData\\Local\\Temp\\arduino_build_270759\\sketch\\Button.ino.cpp.o" "C:\\Users\\parents\\AppData\\Local\\Temp\\arduino_build_270759\\libraries\\RFM69_LowPowerLab\\RFM69.cpp.o" "C:\\Users\\parents\\AppData\\Local\\Temp\\arduino_build_270759\\libraries\\RFM69_LowPowerLab\\RFM69_ATC.cpp.o" "C:\\Users\\parents\\AppData\\Local\\Temp\\arduino_build_270759\\libraries\\RFM69_LowPowerLab\\RFM69_OTA.cpp.o" "C:\\Users\\parents\\AppData\\Local\\Temp\\arduino_build_270759\\libraries\\SPI\\SPI.cpp.o" "C:\\Users\\parents\\AppData\\Local\\Temp\\arduino_build_270759\\libraries\\SPIFlash_LowPowerLab\\SPIFlash.cpp.o" "C:\\Users\\parents\\AppData\\Local\\Temp\\arduino_build_270759/core\\core.a" "-LC:\\Users\\parents\\AppData\\Local\\Temp\\arduino_build_270759" -lm
C:\Users\parents\AppData\Local\Temp\arduino_build_270759\sketch\Button.ino.cpp.o: In function `loop':

D:\Users\parents\Documents\Development\Arduino\XBoxNotifier\Button/Button.ino:194: undefined reference to `RFM69::listenModeSendBurst(unsigned char, void*, unsigned char)'

collect2.exe: error: ld returned 1 exit status

Using library RFM69_LowPowerLab at version 1.2.0 in folder: D:\Users\parents\Documents\Development\Arduino\libraries\RFM69_LowPowerLab
Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
Using library SPIFlash_LowPowerLab at version 101.1.2 in folder: D:\Users\parents\Documents\Development\Arduino\libraries\SPIFlash_LowPowerLab
exit status 1
Error compiling for board Moteino / MoteinoUSB.

I have tried all sorts of type casting on the parameters in the listenModeSendBurst() call, I've deleted the temp cache directories & recompiled, any anything else I can think of. The RFM69.h & .ccp files have the function calls in there:
Code: [Select]
//=============================================================================
// sendBurst() - send a burst of packets to a sleeping listening node (or all)
//=============================================================================
void RFM69::listenModeSendBurst( uint8_t targetNode, void* buffer, uint8_t size )
{
and
Code: [Select]
    void listenModeSendBurst(uint8_t targetNode, void* buffer, uint8_t size);
I'm not sure how the IDE is picking up a reference to "RFM69::listenModeSendBurst(unsigned char, void*, unsigned char)" or why it's not accepting my call in the sketch. I couldn't find any reference to this on the Forum or through a Google search. I'm 99.99% sure there some small error I've made that explains this, but for the life of me I can't find what it is.

Any suggestions would be greatly appreciated. Thanks in advance.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: undefined reference to `RFM69::listenModeSendBurst'
« Reply #1 on: January 04, 2019, 10:07:31 AM »
Did you uncomment this line in RFM69.h ?

Code: [Select]
//#define RF69_LISTENMODE_ENABLE  //comment this line out to compile sketches without the ListenMode (saves ~2k)

handyguy

  • NewMember
  • *
  • Posts: 27
Re: undefined reference to `RFM69::listenModeSendBurst'
« Reply #2 on: January 04, 2019, 10:18:05 AM »
Felix,

Quite literally 30 seconds before you posted your reply I found this problem as well. Actually, I had included
Code: [Select]
#define RF69_LISTENMODE_ENABLE  //comment this line out to compile sketches without the ListenMode (saves ~2k)
at the top of my sketch before the #include for RFM69.h, thinking that would enable the proper preprocessing of the header and keep me from modifying the library code. That obviously didn't work. Once I uncommented the line in the header file it compiled just fine.

DOH!

Well, that's two hours of my life I'll never get back!  >:( Thanks for the help.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: undefined reference to `RFM69::listenModeSendBurst'
« Reply #3 on: January 04, 2019, 10:26:03 AM »
No problem ;)