Hey guys,
So I have the fallowing two set ups-
Arduino MEGA with Adafruit RFM95 915Mhz LoRa Radio
LoRa INT -> 3
LoRa CS -> 53
LoRa RST -> 2
LoRa SPI pins on the MEGA's 50,51,52, respectively
Adafruit M0 w/ WiFi and RFM95 915Mhz LoRa Radio Wing
A -> RST
B -> CS
D -> IRQ
Adafruit LoRa Radio FeatherWing - RFM95W 900 MHz [RadioFruit] : ID 3231 : $19.95 : Adafruit Industries, Unique & fun DIY electronics and kits - LoRa radio
Computer running Ubuntu, Arduino 1.8.5 with RadioHead 1.62
So my issue is I run the examples from the library, and I set 53 as a output on the MEGA and set the CS as well as reset pins on both. They just don't work, all that gets sent to me over serial is it telling me it was able to set the frequency. Code below
MEGA-
#include <RHReliableDatagram.h>
#include <RH_RF95.h>
#include <SPI.h>
#define CLIENT_ADDRESS 1
#define SERVER_ADDRESS 2
#define RF95_FREQ 915.0
// Singleton instance of the radio driver
RH_RF95 driver(53, 3);
//RH_RF95 rf95(53, 3); // Rocket Scream Mini Ultra Pro with the RFM95W
// Class to manage message delivery and receipt, using the driver declared above
RHReliableDatagram manager(driver, CLIENT_ADDRESS);
// Need this on Arduino Zero with SerialUSB port (eg RocketScream Mini Ultra Pro)
//#define Serial SerialUSB
void setup()
{
// Rocket Scream Mini Ultra Pro with the RFM95W only:
// Ensure serial flash is not interfering with radio communication on SPI bus
pinMode(53, OUTPUT);
pinMode(2, OUTPUT);
digitalWrite(2, HIGH);
Serial.begin(9600);
delay(100);
//while (!Serial) ; // Wait for serial port to be available
digitalWrite(2, LOW);
delay(10);
digitalWrite(2, HIGH);
delay(10);
if (!manager.init())
Serial.println("init failed");
// Defaults after init are 434.0MHz, 13dBm, Bw = 125 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on
// The default transmitter power is 13dBm, using PA_BOOST.
// If you are using RFM95/96/97/98 modules which uses the PA_BOOST transmitter pin, then
// you can set transmitter powers from 5 to 23 dBm:
if (!driver.setFrequency(RF95_FREQ)) {
Serial.println("setFrequency failed");
while (1);
}
Serial.print("Set Freq to: "); Serial.println(RF95_FREQ);
driver.setTxPower(5, false);
}
uint8_t data[] = "Hello World!";
// Dont put this on the stack:
uint8_t buf[RH_RF95_MAX_MESSAGE_LEN];
void loop()
{
Serial.println("Sending to rf95_reliable_datagram_server");
// Send a message to manager_server
if (manager.sendtoWait(data, sizeof(data), SERVER_ADDRESS))
{
// Now wait for a reply from the server
uint8_t len = sizeof(buf);
uint8_t from;
if (manager.recvfromAckTimeout(buf, &len, 2000, &from))
{
Serial.print("got reply from : 0x");
Serial.print(from, HEX);
Serial.print(": ");
Serial.println((char*)buf);
}
else
{
Serial.println("No reply, is rf95_reliable_datagram_server running?");
}
}
else
Serial.println("sendtoWait failed");
delay(500);
}
Feather-
// rf95_reliable_datagram_server.pde
// -*- mode: C++ -*-
// Example sketch showing how to create a simple addressed, reliable messaging server
// with the RHReliableDatagram class, using the RH_RF95 driver to control a RF95 radio.
// It is designed to work with the other example rf95_reliable_datagram_client
// Tested with Anarduino MiniWirelessLoRa, Rocket Scream Mini Ultra Pro with the RFM95W
#include <RHReliableDatagram.h>
#include <RH_RF95.h>
#include <SPI.h>
#define CLIENT_ADDRESS 1
#define SERVER_ADDRESS 2
// Singleton instance of the radio driver
//RH_RF95 driver;
RH_RF95 driver(10, 6); // Rocket Scream Mini Ultra Pro with the RFM95W
// Class to manage message delivery and receipt, using the driver declared above
RHReliableDatagram manager(driver, SERVER_ADDRESS);
// Need this on Arduino Zero with SerialUSB port (eg RocketScream Mini Ultra Pro)
//#define Serial SerialUSB
void setup()
{
// Rocket Scream Mini Ultra Pro with the RFM95W only:
// Ensure serial flash is not interfering with radio communication on SPI bus
pinMode(2, OUTPUT);
digitalWrite(2, HIGH);
Serial.begin(9600);
delay(100);
Serial.println("Feather LoRa RX Test!");
// manual reset
digitalWrite(2, LOW);
delay(10);
digitalWrite(2, HIGH);
delay(10);
while (!Serial) ; // Wait for serial port to be available
if (!manager.init())
Serial.println("init failed");
// Defaults after init are 434.0MHz, 13dBm, Bw = 125 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on
if (!driver.setFrequency(915.0)) {
Serial.println("setFrequency failed");
while (1);
}
Serial.print("Set Freq to: "); Serial.println("915Mhz");
driver.setTxPower(5, false);
}
uint8_t data[] = "And hello back to you";
// Dont put this on the stack:
uint8_t buf[RH_RF95_MAX_MESSAGE_LEN];
void loop()
{
if (manager.available())
{
Serial.println("Manager available");
// Wait for a message addressed to us from the client
uint8_t len = sizeof(buf);
uint8_t from;
if (manager.recvfromAck(buf, &len, &from))
{
Serial.print("got request from : 0x");
Serial.print(from, HEX);
Serial.print(": ");
Serial.println((char*)buf);
// Send a reply back to the originator client
if (!manager.sendtoWait(data, sizeof(data), from))
Serial.println("sendtoWait failed");
}
}
}
It's extremely frustrating and using the rf95_client and rf95_server modified similarly doesn't work either. Is there any error someone sees or anyone else have a solution?
Thanks