EDIT: Problem solved. Go to Reply #5 for solution....even with the radio completely removed from the board.
Basically, I have a project using a moteino and the RFM69 library. It is not my first project with this hardware or library. The only difference is that the first project I was using arduino 1.0.6, and now I'm using arduino 1.6.11. I say that just in case there is a known difference between the arduino SPI libraries that would cause this.
In my project, I try to initialize the radio like so:
debugOn = true; //this can be turned on via serial port, turning on now for duration of development
pinMode(ON_BOARD_LED, OUTPUT);
digitalWrite(ON_BOARD_LED, HIGH);
if(debugOn){
Serial.println("\nInit Radio ... ");
}
if(initRadio() == true){
if(debugOn){
Serial.println("OK");
}
delay(300); //delay so that the LED is on long enough to be noticeable
}
else{
if(debugOn){
Serial.println("BAD");
}
delay(100);
for(int i = 0; i < 5; i++){
digitalWrite(ON_BOARD_LED, LOW);
delay(100);
digitalWrite(ON_BOARD_LED, HIGH);
delay(100);
}
}
digitalWrite(ON_BOARD_LED, LOW);
And initRadio() looks like this:
boolean initRadio(void)
{
boolean retVal = false;
if(radio.initialize(RF69_915MHZ,PROBEID,NETWORKID)){
retVal = true;
}
#ifdef IS_RFM69HW
radio.setHighPower(); //only for RFM69HW!
#endif
radio.encrypt(ENCRYPTKEY);
radio.promiscuous(false);
radio.setPowerLevel(1);//14);
delay(20);
return retVal;
}
I wanted to get a visual indicator of whether or not the radio initialized properly. On the other projects I would just turn on the LED and enter an infinite loop, but in this case I am running off a coin cell battery and don't want to kill it, so I just want to blink 5x and go to sleep (later in the code, not shown above). This visual indicator is paired with the serial debug statements.
No matter what I do, including COMPLETELY REMOVING the radio from the moteino, the radio.initialize() function always returns true, the LED never blinks 5x, and the debug statement is always "OK."
Has anyone else had this issue?