LowPowerLab Forum

Hardware support => Moteino => Topic started by: syrinxtech on December 13, 2015, 08:46:31 AM

Title: LoRa w/ENCJ2860
Post by: syrinxtech on December 13, 2015, 08:46:31 AM
Has anyone tried connecting the Moteino/LoRA to either an ENCJ2860 or Wi5100 Ethernet card?  I have several Moteino's with the RFM69 radios working with both Ethernet cards and no problems.  I usually move the SS/CS pin to 7 and modify the appropriate library.

Today I tried doing the same thing with a Moteino/LoRa and it continually kept restarting in the IDE monitor window.  I tried both the standard Ethernet library and the UIPEthernet libraries with no luck.  I have used both of these libraries with the RFM69 radios.  The problem arises when the code gets to the Ethernet.begin(mac) line of the code.  At that point the monitor screen keeps scrolling as the unit resets.

I have tried changing the SS on the ENCJ2860 chip like I do with the RFM69 radios with no luck.  I have also tried changing both the interrupt and CS of the radio.  Even if I comment out all traces of the LoRa radio in my sketch, as soon as the Ethernet.begin() line is executed everything goes south.

Any tips or pointers would be appreciated.
Title: Re: LoRa w/ENCJ2860
Post by: WhiteHare on December 13, 2015, 10:47:47 AM
Quote from: syrinxtech on December 13, 2015, 08:46:31 AM
Even if I comment out all traces of the LoRa radio in my sketch, as soon as the Ethernet.begin() line is executed everything goes south.


When you were doing that test, did you comment out the #include line for the RH library too?  If not, try commenting out that as well and see if it works then.  If it does, then it's very likely a free memory  issue, as both RH and ethernet library use a lot of free memory.  You can easily confirm or refute that hypothesis with the freeMemory() function call.  What does it report as your available free memory?


int freeMemory() {
  int free_memory;
  if ((int)__brkval == 0) {
    free_memory = ((int)&free_memory) - ((int)&__heap_start);
  } else {
    free_memory = ((int)&free_memory) - ((int)__brkval);
    free_memory += freeListSize();
  }
  return free_memory;
}
Title: Re: LoRa w/ENCJ2860
Post by: syrinxtech on December 14, 2015, 10:01:44 AM
WhiteHare,

Thanks for the tip and the code.  I'm going to be able to re-test tomorrow.  I will certainly let you know how it goes.