I am coding a sketch for wireless communication with Radio-Head LoRa module.
I modified the example sketch, reliable_server and client, in Aduino IDE that Adafruit recommend.
I use RFM95@900MHz feather.
Wireless communication works well with RFM95@900 and Aduino UNO combination, but "init failed" error occurs with RFM95@900 and Aduino MEGA 2560 combination.
#define Lora.setPins(53, 40, 21)// MEGA
//#define Lora.setPins(10, 9, 2)//UNO
.......
while (!Serial) ; // Wait for serial port to be available
if (!manager.init())
Serial.println("init failed");
else
Serial.println("initialization success");
The working codes both on MEGA and UNO are "rf95_client" and "rf95_server".
"rf95_reliable_datagram_client" and "rf95_reliable_datagram_server" work on UNO, but don't work on MEGA.
The codes are from Aduino's examples.
MEGA and UNO 3.3V have supply pins, so I can supply 3.3V to module. I don't need voltage level conversion from 5V to 3.3V.
#define Lora.setPins(53, 40, 21)// MEGA
//#define Lora.setPins(10, 9, 2)//UNO
.......
while (!Serial) ; // Wait for serial port to be available
if (!manager.init())
Serial.println("init failed");
else
Serial.println("initialization success");