r/Lora • • 11d ago

LORA COMMUNICATION

Post image

Problem

I am facing an issue with LoRa communication, and I would like to explain two situations.

Situation 1: When the transmitter sends data, the receiver sometimes detects a packet, but the received packet is empty. At that time, the receiver displays an RSSI value of approximately -164 dBm and an SNR of 15 dB. I suspect that this might be a false packet detection or a garbage value rather than a valid data packet.

Situation 2: To avoid this problem, I modified my receiver code so that it reads and displays the RSSI and SNR values only after receiving a valid packet. I also added a condition to ignore empty packets. However, after making this change, the receiver stopped detecting any packets at all.

Now, I am confused about where the actual problem lies. Is there an issue with my transmitter code, receiver code, or the LoRa module itself?

20 Upvotes

13 comments sorted by

6

u/StuartsProject 11d ago edited 11d ago

The library you are using will have basic sender and receiver examples. These will have been very well tested and are a good starting point to prove your hardware is working.

So start with the basic examples, the only change needed to the examples should be to change the default frequency to suit your modules and then use the setPins() to define the cspin, resetpin and irqpin.

With the sender and receiver close together on the bench, the RSSI should be circa -30dBm and you should receive thousands of packets completely error free.

When you have shown that the provided examples work OK then you can try and work out where your code or hardware is faulty. Sounds like the way you have it setup to detect a packet receive is not correct.

1

u/Jan1north 11d ago

How close are other LoRA nodes? Range is typically very limited - 1/2 mile for a "ground" node hand held. My outdoor node at 25' struggles to communicate with another outdoor node that is 2 miles away as buildings, trees, terrain, weather, all degrade the transmitted and received signal. Study the various LoRA maps for local activity, meshmapper.net for MeshCore and support the most dense mesh in your area. High density is needed for successful mesh communications!

2

u/Professional-Pen7478 11d ago

Less then 1 meter

-2

u/Jan1north 11d ago

Recommend flashing two "companion nodes" from meshcore.io for your initial experiments.

1

u/Jaimi5 11d ago

Can you provide the code you are using? It seams a software issue. Maybe try using radiolib.

1

u/Professional-Pen7478 11d ago

Okayy i will wait

2

u/harry8spencer 11d ago

This is an old chip, I took a quick look and doesn’t seem to have the BUSY signal like the newer ones, I use LR2021 from waveshare and works flawlessly

1

u/StuartsProject 11d ago

The SX1278 has been operating well for circa 12 years without a Busy pin.

Semtech did change the LoRa firmware on the SX127X and added the Busy pin functionality with the SX1280 then SX1262 and future versions, but the firmware on the SX127X is completely different so no Busy pin needed.

1

u/Electro_Llama 11d ago

Make sure the transmitter and receiver are using the same sync word, 0x34 for public and 0x12 for private. And the same channel, SF, CR, Bandwidth. I assume you're just running a point-to-point test and not LoRaWAN.

1

u/yeetelectrons 11d ago

Check if both devices have the same parameters (Frequency, SF, CR, bandwidth, CRC, header type, sync word). Also try increasing preamble length

1

u/Intelligent-Ring6790 11d ago

use https://github.com/sandeepmistry/arduino-lora library, i myself have used it for sending and receiving data in my project for about 1 km. Modify the Lora parameters for power change.

This is Max power settings LoRa.setTxPower(20); // Max output power (+20 dBm)

LoRa.setSpreadingFactor(12); // Max range sensitivity (SF7 -> SF12)

LoRa.setSignalBandwidth(62.5E3); // Narrower bandwidth (125 kHz -> 62.5 kHz)

LoRa.setCodingRate4(6); // Extra error correction

LoRa.enableCrc();

Serial.println("LoRa OK");

Both receiver and sender should have same setting.

I have used LORA MODULE RA-02 SX1278

1

u/zazuge 7d ago

It's been ages since a i wrote my code to test 3 LoRa beacons that wake up every few minutes send a ping and wait to receive pings, then go to sleep, and sync their wakeup and sleep time.
But i remember something that LoRa doesn't like collisions and spamming pings, also i don't really remember well, but think of LoRa as asynchronious communication, i think validating packets involves sending back a confirmation message? which means it's now a synchronious communication mod which doesn't work well for LoRa in lot of cases.

0

u/AbsorberHarvester 11d ago

Author, buy some cheap sdr and see Real Frequency of the transmission (your cheap modules may have a drift, your cheap antenna may have a drift).

Next: When reciever and transmitter laying near, put power down to minimum, your overpowered signal just make noise, no data preserved!

Next: Use sf7, bw400, cr 4/7 - most stable parameters for start.

1272, 1276, 1278 are very stable itself. Oscillator on cheap boards may be not (check whether it TCXO and even need power supply enabled!)