Dear Wayne,
I copy my documentation for the Arduino Mega which I put in the header of my sketch (which means I did not think through all details again for this post, just wanted to help quickly) at the end of this post. It will help if you use an Arduino Mega. It might also help if you use an Arduino Nano.
During my experiments I also made the following note to myself (did not validate all details though):
" // final conclusion:
// ==============
// the Arduino Nano was not stable. Probably because it was low on SRAM.
// However, for the Arduino Nano test I did not use the SPI patched RFM69 Library -> could improve stability
// and I did not try to use an ethernet library with a smaller footprint -> could improve stability, too"
Currently I use these libraries:
#include <RFM69.h>
#include <SPI.h>
#include <Ethernet.h>
I hope this points to the right direction.
I currently use the Computourist RFM69 MQTT gateway sketch (get it here: https://github.com/computourist/RFM69-MQTT-client). But it is on my agenda to change all my code to MySensors. I just did not have time to do it. Anyway, long story short, if you send me a PM with an email address I could send you my sketch if you are interested. The code is not well structured currently, however, therefore I do not what to share it publicly.
Sincerely
Karl-Heinz
KH: quick and dirty documentation (end of 2017):
/* Connect Arduino Mega:
* EthernetShield Labels = Mega Labels
* 5V = 5V
* GND = GND
* IRQ = D2 = 2
* RST = = 4
* SCL = D13 = 52
* CS = 8
* Miso = D12 = 50
* Mosi = D11 = 51
*/
/*This sketch only works under the following conditions:*/
/*============================================*/
/*1) An Arduino Mega must be used due to memory problems of Uno/Nano (SRAM)
and it has to be an EthernetShield with W5100 chip, but it should be the newer
version of the EthernetShield, because older versions have the SPI
interface permanently blocked by the EthernetShield. Only after a
hardware modification at the SENS pin of the W5100 chip the blocking is no longer the case.
2) the RFM69 Library of LowPowerLabs does not yet (end of 2017) contain all
necessary adaptations, so that SPI conflicts between the Ethernet card
and the RFM69 module can be solved.
There is a patched version for this purpose:
https://github.com/rrobinet/RFM69_Libary
3) The original Ethernet Library of the Arduino IDE does not consider the Arduino IDE's
own current SPI library and must also be patched.
Copy from the Internet:
"[Changes to the Ethernet Library](http://harizanov.com/2012/04/rfm12b-and-arduino-ethernet-with-wiznet5100-chip/)
I edited the Arduino Ethernet library file W5100.h so that it doesn’t
allow RFM12b to interrupt while the SPI bus is busy handling Wiznet5100.
I added a cli(); and sei(); as follows in the W5100 library."
für Arduino Mega...
[Reference](https://lowpowerlab.com/forum/moteino/moteino-w5100-ethernet-spi-support-spi_has_transaction/60/):
In my case using an ATMEGA2560 changing the W5100.h library from:
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
inline static void initSS() { DDRB |= _BV(4); };
inline static void setSS() { PORTB &= ~_BV(4); };
inline static void resetSS() { PORTB |= _BV(4); };
To
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
inline static void initSS() { DDRB |= _BV(4); };
inline static void setSS() { cli ();PORTB &= ~_BV(4); };
inline static void resetSS() { PORTB |= _BV(4); sei();};"*/```