LoRa SF5 realistic range

I am performing some range test with different SX1262 modules (Heltek, Ai-Thinker, Waveshare) with LoRa SF5 and 500Khz CR4/7 +14dbm (Max in Europe)

After testing 1 Billon 868Mhz small antennas like this which is the max size I am looking for for my project I’m reaching in perfect line of sight about 250m@-105dbm. I can go a few metres further but communication is starting to become unreliable.

I think I'm disappointed, but I have absolutely no reference to compare it to, apart from this one from @srnet where I should (apparently) be reaching 2 km (which seems impossible to me :joy: )

If anyone else is in a similar situation, I’d love to hear about your results, it would really help me gauge whether I’m getting a good performance.

Schematics would be interesting to see. Often insufficient powering make designs fail. Transmitters need pretty some current some current, a few Amps.

1 Like
1 Like

That is a lot of tests, works out to be 273,973 every day for 10 years, how did you manage that. To get a realistic answer post your annotated schematic showing all connections, power, ground, power sources and note any wire over 25cm/10"

2 Likes

At the moment, I am waiting for some reference to see where I am. I do not think it is a circuit issue, as I am using ready-made (and supposedly competent) modules such as the Heltec V3

All power limits are disabled by software, In any case, at 14 dBm it only needs about 80 mA peak.

Something is very wrong with your setup, but you haven't posted enough information to guess what the actual problem might be. Dozens of km range is readily achieved with minimal antennas and clear line of sight.

For informed help, please read and follow the instructions in the "How to get the best out of this forum" post, linked at the head of every forum category.

2 Likes

If everything is correct why does it not work. At this point unless we get the 'secret' information we need we cannot give you a valid answer, just a guess.
G.U.E.S.S.

  1. Gather data <-- you are at this point (schematic & code)!
  2. Understand behavior
  3. Examine signals
  4. Simplify the problem
  5. Solve or guess

Plenty of public info out there.

Your using ;

SF5 and 500Khz CR4/7 +14dbm (Max in Europe)

I assume your on the standard LoRaWAN frequency, 868Mhz, since 14dBm is the max power used for that application.

The SX1262 receiver sensitivity is for SF5, BW500Khz, -111dBm. The sensitivity for the long range LoRaWAN settings of SF12, BW125Khz is -137dBm.

So a sensitivity difference between your settings and those used by LoRaWAN of 26dBm. (20dBm is 10 times further distance and 6dBm is 2 times further distance)

So with your setup if you switched to the LoRaWAN max distance settings you would assume the distance covered would be 0.25x20 = 5km.

5km is of course pathetic short range for LoRaWAN long distance stuff, the record for those settings, good line of sight, is 836km.

Something wrong with your setup maybe ?

@jremington @gilshultz and others users with the same message. Thank you, of course, for participating and apologies in advance if I am not expressing myself clearly but it seems that everyone says “something is wrong”, but no one can give me a single piece of data with my exact configuration: SF5 500KHZ 14dbm. Which is not at all ‘LoRa’ as we know it (hundreds of km)

The fact that I am disappointed with the results does not mean that they should be better results, which is why I look for real references in my own configuration.

Thanks @srnet for the reply, If I am not mistaken, you achieved 150m with -9dbm, which, translated to my configuration (+23db), should be about 2km range, which I will not deny, seems too optimistic to me.

Could you share what kind of hardware, antennas, and libraries you used? I am currently using radiolib, but happy to use whatever to improve (if possible) my results

I am looking for real (not theoretical) references of range tests in SF5/500. I kindly ask you to share that plenty information out there. :smiling_face_with_three_hearts:

Please explain why you think the projected 2km is too optimistic ?

How much experience do you have with LoRa and LoRa range testing in particular ?

I think you have misunderstood my comment. What I mean is that, theoretically, it is always a long way from reality, besides the fact that your tests were at 433, which should (if I am not mistaken) have significantly more range than my test.

About twice the range\distance.

1 Like

While wait for a reference, here is the code in case anyone spots any errors in the configuration.

#include <Arduino.h>
#define HELTEC_POWER_BUTTON
#include <heltec_unofficial.h>

#define FREQUENCY 866.2f
#define BANDWIDTH 500
#define SPREADING_FACTOR 5
#define TRANSMIT_POWER 14
#define CODING_RATE 7                               // CR_4_7
#define SYNC_WORD RADIOLIB_SX126X_SYNC_WORD_PRIVATE // 0x12
#define PREAMBLE_LENGTH 13                          // Semtech recommends min 12 symbols for SF5

#define RX false
#define TX true

bool role = RX;

volatile bool rxFlag = false;
unsigned long counter = 0;

ICACHE_RAM_ATTR void rx()
{
  rxFlag = true;
}

void setup()
{

  heltec_setup();
  both.println("Radio init");
  RADIOLIB_OR_HALT(radio.begin());

  RADIOLIB_OR_HALT(radio.setFrequency(FREQUENCY));
  RADIOLIB_OR_HALT(radio.setBandwidth(BANDWIDTH));
  RADIOLIB_OR_HALT(radio.setSpreadingFactor(SPREADING_FACTOR));
  RADIOLIB_OR_HALT(radio.setOutputPower(TRANSMIT_POWER));
  RADIOLIB_OR_HALT(radio.startReceive(RADIOLIB_SX126X_RX_TIMEOUT_INF));
  RADIOLIB_OR_HALT(radio.setCodingRate(CODING_RATE));
  RADIOLIB_OR_HALT(radio.setCRC(2));
  RADIOLIB_OR_HALT(radio.setCurrentLimit(140));
  RADIOLIB_OR_HALT(radio.setPreambleLength(PREAMBLE_LENGTH));
  RADIOLIB_OR_HALT(radio.setSyncWord(SYNC_WORD));
  RADIOLIB_OR_HALT(radio.autoLDRO());
  RADIOLIB_OR_HALT(radio.setRxBoostedGainMode(RADIOLIB_SX126X_RX_GAIN_BOOSTED, true));

  radio.setDio1Action(rx);
  radio.startReceive(RADIOLIB_SX126X_RX_TIMEOUT_INF);

  role = RX;
  //  role = TX;
}

void loop()
{

  if (role == TX)
  {

    counter++;
    String msg = "Hello World! Packet #" + String(counter);
    Serial.printf("Transmitting packet #%lu\n", counter);
    RADIOLIB_OR_HALT(radio.transmit(msg));
    rxFlag = false;
    delay(2000);
  }
  else if (role == RX)
  {

    if (rxFlag)
    {

      rxFlag = false;
      int numBytes = radio.getPacketLength();
      String str;
      int state = radio.readData(str);

      if (state == RADIOLIB_ERR_NONE)
      {

        Serial.print("Packet RSSI: ");
        Serial.print(radio.getRSSI());
        Serial.print(" dBm, SNR: ");
        Serial.print(radio.getSNR());
        Serial.println(" dB");
        Serial.print("Payload: ");
        Serial.println(str);
        Serial.print("Frequency error: ");
        Serial.print(radio.getFrequencyError());
        Serial.println(" hz ");
      }
      else if (state == RADIOLIB_ERR_CRC_MISMATCH)
      {
        Serial.println(F("CRC error!"));
      }
      else
      {
        Serial.print(F("failed, code "));
        Serial.println(state);
      }
    }
    delay(100);
  }
}

300m (unreliable reception)

Packet RSSI: -109.00 dBm, SNR: 0.25 dB
Payload: Hello World! Packet #745
Frequency error: 372.00 hz

I took a quick glance at your code and these things jump out at me. I do not have the hardware so this is a SWAG.

You call startReceive() before setting all radio parameters
You do this twice:

RX / TX macros are booleans but named like roles
You have:

Need to re-arm RX after a received packet
With SX126x + DIO1, after you read a packet you often must call startReceive() again (depends on library mode, but commonly needed).
Right now you do not restart RX inside the rxFlag handler.

Unused variable int numBytes = radio.getPacketLength();

Move setCodingRate() earlier with the rest, and set CRC before startReceive.

1 Like

Thank you for your help. Unfortunately, none of those things have changed the results.

You are right that I miss the “early” call to startReceive() but if you check at the end of the setup, I call it again when all parameters are already set.

Not sure if merit of RadioLib or SX1262 but there is not need to call startReceive() again after each packet. You can check the offical rx example where there one single call.

All other minor stuff has been correctly fixed :ok_hand: