Communication between LoRa SX1262 and Reyax rylr896

Hi guys,
I would like to make two lora modules communicate, i.e. reyax rylr896 and sx1276, but during my tests I can't get any result. So I would like to know if it is possible to make these two modules communicate.

Code for reception with Sx1276

#include <SPI.h>
#include <LoRa.h>  

#define rst 9
#define dio0 4
#define nss 10

String inString = "";    // string to hold incoming charaters
String MyMessage = ""; // Holds the complete message

void setup() {
  
  LoRa.setPins(nss,rst, dio0);
  Serial.begin(9600);
  
  Serial.println("LoRa Receiver");
 ////////////////////////////////////////////////////////////////////
  while (!Serial);
  Serial.println("LoRa Receiver");
  if (!LoRa.begin(868E6)) { 
    Serial.println("Starting LoRa failed!");
    while (1);
  }

  LoRa.setSpreadingFactor(7);
  LoRa.setTxPower(15);
  LoRa.setSignalBandwidth(125000);
  LoRa.setCodingRate4(1);
  LoRa.setPreambleLength(5);
}

void loop() {
  int packetSize = LoRa.parsePacket();
  if (packetSize) { 
    // read packet    
    while (LoRa.available())
    {
      int inChar = LoRa.read();
      inString += (char)inChar;
      MyMessage = inString;       
    }
    inString = "";     
    LoRa.packetRssi();    
    Serial.println(MyMessage);
  }
}

Transmitter code with rylr896

#include <SoftwareSerial.h>

#define RX 3
#define TX 2
SoftwareSerial LoRaSerial(RX, TX); // RX, TX

const int WAIT = 200;

void setup(){
    Serial.begin(115200);

    LoRaSerial.begin(115200);

    LoRaSerial.println("AT+BAND=868500000"); 
    delay(WAIT);
    LoRaSerial.println("AT+PARAMETER=7,7,4,5");
    delay(WAIT);
    LoRaSerial.println("AT+NETWORKID=0");
    delay(WAIT);
    LoRaSerial.println("AT+ADDRESS=0");
}

void loop(){

   LoRaSerial.println("AT+SEND=0,4,TEST");
   delay(500);

}

Thank you.

I moved your topic to an appropriate forum category @blot_1200.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

The title of you post says you are using SX1262 and rylr896.

The test of your post says you are using SX1276 and rylr896.

Which devices are you using ?

Sorry it's a mistake I use sx1276 and rylr896

Your chances of software serial working at 115200 baud are slim, maybe 19200 baud is the maximum for reliable operation ?

Why are you trying to get a rylr896 working with a SX1276 in the first place, unless there is published working code, it might not be easy to get the two different devices to communicate, the rylr896 is not really a LoRa module as such .....

I use 112500 bauds as this is the default baud rate for rylr896.

I want to make a communication between these two modules in order to use the rylr896 as a relay because it has a longer range than the sx1276 but is more expensive.
And I don't have any functional code, just the fact that they use the same chip.

Then you either need to change the rylr896 baud rate to 9600 or use an Arduino that has a spare hardware serial port.

The rylr896 will be using an SX1276 LoRa device, so the range will be the same as a normal SPI SX1276, assuming the same LoRa settings and antennas.

The rylr896 appears to add some stuff or parameters to an outgoing packet, and might also require a specially formatted packet before it receives it.

Relay code for a SPI SX1276 would be really easy to sort out as you can use a common library for both the nodes and the relay, no packet compatibility issues either.

What impact will this change have on my modules?

When I look at the specifications of the rylr896 I have a range between 4.5 and 15Km while for the sx1276 I have 5km in max distance, but I can't check if the information is good for the sx1276 because I didn't find anything in the datasheet.

Yes, the rylr896 adds an address and a NetworId, which doesn't exist on the lora sx1276. Do you think this is what prevents communication between the two?

The rylr896 might start to work.

Datasheets cannot and should not specify distances as its a figure that depends very heavily on environment and antennas.

I have had distances of circa 250km from a SX1276, so does this suggest that the SX1276 I used is massily better than the SX1276 in the rylr896 ?

Its could well do. If you want to spend hours and hours trying to make the SX1276 and rylr896 communicate then please do. Do publishe the working setup on here, others might be interested.

I use the rylr896 just because of its 15km range which was specified but if it is possible to do 250km with the sx1276 then I have no interest in continuing.
Is it possible for you to share the parameters, the type of antenna you used to reach this distance and under what conditions (environment, weather) you carried out the tests?

Concerning the test I only receive a T instead of TEST

image

I just modified the SF on both sides

LoRa.setSpreadingFactor(12);

Read about adventures with LoRa, setting records etc, way back in 2014, here;

https://stuartsprojects.github.io/2015/01/01/Semtech-LoRa-Transceivers-a-KISS-approach-to-Long-Range-Data-Telemetry.html

You should not take their silly advertisements seriously. Radio range depends on the surroundings (terrain, buildings, etc.), the antennas and the radio settings.

Your range is currently zero, because you don't have two of the same modules, using the same settings.

Thanks for the advice and the article

okay, now I understand

But is it possible to calculate with precision or not the rate of atenuation that we will have

Only in the circumstances where there is very clear line of sight between transmitter and receiver, with no objects or ground near the line of sight path.

But why the question ?

because I also use an sx1276 module, but with this module I can't go more than 1.5km, of course I'm doing the tests in an urban area with a lot of traffic, so assuming that my environment has a big impact on my range, it would be nice to know how much it attenuates a signal.

You wont be able to 'calculate' the attenuation in those circumstances.

You can measure it, the receiver will give the RSSI value of received packets.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.