RFM69 Radio with Huzzah ESP8266

Hello,

I'm attempting to get the Adafruit RFM69 Radio Feather Wing to work with the Huzzah ESP8266 Feather. I'm trying to compile the receiver example code here:

I made the specified changes for the Huzzah's CS, IRQ, and RST pins and downloaded the RFM69 library. However, the compilation is failing with the message:

Arduino: 1.6.12 (Windows 7), Board: "Adafruit HUZZAH ESP8266, 80 MHz, 115200, 4M (3M SPIFFS)"

D:\GFV's Documents\Computer Stuff\Arduino Projects\libraries\RFM69\RFM69_OTA.cpp:35:21: fatal error: avr/wdt.h: No such file or directory

 #include <avr/wdt.h>

                     ^

compilation terminated.

exit status 1
Error compiling for board Adafruit HUZZAH ESP8266.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

It compiles fine if I set the target board to Adafruit Feather 32u4.

Any help would be appreciated.

Thanks.

Greg

Does the watchdog timer exist for the board you are trying to compile for? The one that is NOT an Arduino?

The ESP8266 definitely gets real upset if you don't yield() enough in tight loops so it can tend to its TCP/IP stack and other duties. I assume that is triggered by a WDT interrupt.

Bottom line, I got the code to compile simply by removing the 'RFM69_OTA.cpp' file from the folder containing the rest of the RFM69 library. No errors and the code now works. To me, that suggests two possibilities:

  • The library was updated AFTER the code in question was lasted tested with the ESP8266 micro-controller.

  • The code was NEVER tested with the ESP8266 micro-controller. I find that hard to believe since it contains comments referencing that processor.

This also raises one other question. Why was Arduino IDE attempting to compile the 'RFM69_OTA.cpp' file at all? Obviously, none of the functions it defines were being used by the sketch in question.

Thanks.

Greg

Why was Arduino IDE attempting to compile the 'RFM69_OTA.cpp' file at all? Obviously, none of the functions it defines were being used by the sketch in question.

It compiles every cpp file in every library folder and in the sketch folder. The linker will then figure out that it needs nothing from the resulting .o file.

So, looking at what the file in question is doing with that included .h file and a few other things, I think the problem can be fixed with some conditional compilation statements that only trigger when the target processor is AVR architecture. I know you can do an #ifdef for a specific board like ARDUINO_AVR_FEATHER32U4 or ARDUINO_AVR_NANO, but how about ANY AVR board?

Thanks.

Greg