RFM12B blocks my Leonardo USB Connection

I can't get my Leonardo to run with RFM12B when I am using the jeelib library [GitHub - jeelabs/jeelib: JeeLib for Arduino IDE: Ports, RF12, and RF69 drivers from JeeLabs]

Even if everything is disconnected and it's just the leonardo board itself the library seems to prevent the USB/Serial Connection from working.

The only thing I can do is force it into this special reset mode where it is reachable for 8 seconds to program another sketch where the Serial connection works, but like i said it's just another sketch just to get the USB/Serial connection back to work, not the one i actually want to have on the leonardo.

I am using the RX/TX examples from the jeelib library. Both work on the Arduino UNO but the Leonardo can't handle it :confused:

Here is the code example for the receiver

//Simple RFM12B wireless demo - Receiver - no ack
//Glyn Hudson openenergymonitor.org GNU GPL V3 12/4/12
//Credit to JCW from Jeelabs.org for RFM12 

#define RF69_COMPAT 0  // Set to 1 if using RFM69CW or 0 is using RFM12B
#include <JeeLib.h>

#define myNodeID 30          //node ID of Rx (range 0-30) 
#define network     210      //network group (can be in the range 1-250).
#define RF_freq RF12_433MHZ     //Freq of RF12B can be RF12_433MHZ, RF12_868MHZ or RF12_915MHZ. Match freq to module

typedef struct { int power1, power2, power3, battery; } PayloadTX;      // create structure - a neat way of packaging data for RF comms
PayloadTX emontx;  

const int emonTx_NodeID=10;            //emonTx node ID

void setup() {
  rf12_initialize(myNodeID,RF_freq,network);   //Initialize RFM12 with settings defined above    
  Serial.begin(9600);
  while (!Serial);
  Serial.println("RF12B demo Receiver - Simple demo"); 
  
 Serial.print("Node: "); 
 Serial.print(myNodeID); 
 Serial.print(" Freq: "); 
 if (RF_freq == RF12_433MHZ) Serial.print("433Mhz");
 if (RF_freq == RF12_868MHZ) Serial.print("868Mhz");
 if (RF_freq == RF12_915MHZ) Serial.print("915Mhz");  
 Serial.print(" Network: "); 
 Serial.println(network);
}

void loop() {
  
 if (rf12_recvDone()){    
  if (rf12_crc == 0 && (rf12_hdr & RF12_HDR_CTL) == 0) {
    
    int node_id = (rf12_hdr & 0x1F);      //extract nodeID from payload
        
    if (node_id == emonTx_NodeID)  {             //check data is coming from node with the corrct ID
        emontx=*(PayloadTX*) rf12_data;            // Extract the data from the payload 
       Serial.print("power1: "); Serial.println(emontx.power1); 
       Serial.print("power2: "); Serial.println(emontx.power2); 
       Serial.print("power3: "); Serial.println(emontx.power3); 
       Serial.print("battery: "); Serial.println(emontx.battery); 
       Serial.println("  "); 
  }
 }
}
}

Since i hate it when people don't post how they solved their problems i will post my solution.

As mentioned the Yellow Communication LED was always on and the USB Connection could not be established.

Which was absolutely irritating because i later figured out that it had nothing to do with eachother.

The LED was on because the library chose the pin of that LED as the Slave Select which would be D10 on an Arduino with the Atmega328. And the USB connection didn't work because the library made the program interrupt dependend. On the Atmega328 boards the interrupt that's used by the library is D2 on the Atmega32U4 boards it's D3.

Also one of my RFM12B modules was broken. I don't know, maybe i connected it to 5V at some point.

I hope i could help a lot of people out because i am certain that i am not the only one with this problem.

Fix:

You can go into the library and change which Pin is used for the Slave Select (SS) of the SPI interface. So far i didn't do that because I am working on something else right now.