Get "Init Failed" on some Moteinos, but not all

Started by Stivinski, September 23, 2022, 08:02:26 PM

Stivinski

Hello,

I'm relatively fresh to microcontrollers, so please excuse any newbie speak.

I have four Moteinos, all of them the RFM95 USB version.  I've been setting them up to transmit using the RadioHead library.  When testing, I get the "init failed" message in the serial monitor, but only on two of the Moteinos.  The other two are chatting with each other like old friends using the exact same code.

From what I've read, this could mean something to do with pin-mapping if it was a Moteino Mega, but mine are all identical.  They all have "RF96" on that chip on the back, they all have the "865-915 MHz" box dotted, and they were all purchased simultaneously. 

Obviously, the simplest explanation is that they're broken, but they seem to work just fine otherwise.  Other sketches seem to work as expected, just not the radio driver.  I want to see if it's something fixable rather than just throwing in the towel on $60 worth of hardware.  I'm posting my code below, just the portion that the two troublemakers can't get past.  I'm sure you've all seen it 1000 times.

#include <RadioHead.h>
#include <RH_RF95.h>
#include <SPI.h>
#include <LowPower.h>

RH_RF95 rf95;

void setup() {
  
  while (!Serial) ;
  if (!rf95.init())
  {
    Serial.println("Initialization Failed");
  }
  else
  {
    Serial.println("Initialization Succeeded");
  }

}

void loop() {
  

}


Thanks.

Felix

An init fail would likely mean there's something wrong with the board, perhaps the MCU cannot communicate to the radio module. Antennas should be installed, although at close range it will work without antennas (but it's not recommended to use/transmit for a long time without an antenna).

Is there any visible sign of physical damage to the ones that fail the init?
The radio module components are very small, and it may not be obvious if there's a problem, I would visually compare a working one to one that isn't working to see if there's anything different.
I would also check the solder joints on the radio, although if they came with the radios installed, that should not be a problem.
All the boards that go out are tested, in the case of LoRa/RFM95 they are loaded with a sender sketch to ensure the radio works and it can transmit.