Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LORA COMMUNICATION USING NANO #691

Open
Srivardhan06 opened this issue May 18, 2024 · 35 comments
Open

LORA COMMUNICATION USING NANO #691

Srivardhan06 opened this issue May 18, 2024 · 35 comments

Comments

@Srivardhan06
Copy link

I'm working on lora communication using nano i m not receving the data
and some times i'm receving the garabage values like:????????????
can you help me in this issue

thank you

@sercero
Copy link

sercero commented May 19, 2024

Huh?

Please tell more about your setup, what are you using. How did you connect everything?

Which code are you using? The sender and receiver samples?

@Srivardhan06
Copy link
Author

Srivardhan06 commented May 19, 2024

IM USING NANO AND LORA SX1278

SENDER CODE :

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

byte msgCount = 0; // Count of outgoing messages
byte localAddress = 0xBB; // Address of this device
byte destination = 0xFF; // Destination to send to
long lastSendTime = 0; // Last send time
int interval = 3000; // Interval between sends

/*

  • Transmitter side Code

Module SX1278 // Arduino UNO/NANO
Vcc -> 3.3V
MISO -> D12
MOSI -> D11
SLCK -> D13
Nss -> D10
GND -> GND
*/

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

while (!Serial);
Serial.println("LoRa Sender");

if (!LoRa.begin(433E6)) { // or 915E6, the MHz speed of your module
Serial.println("Starting LoRa failed!");
while (1);
}
}

void loop() {
String MyMessage = "Hello World";
LoRa.beginPacket();
LoRa.print(MyMessage);
LoRa.endPacket();
delay(300);
}

RECEIVER CODE :

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

byte data[50];
byte msgCount = 0; // Count of outgoing messages
byte localAddress = 0xFF; // Address of this device
byte destination = 0xBB; // Destination to send to
long lastSendTime = 0; // Last send time
int interval = 300; // Interval between sends

/*
*** Receiver Side Code**

#include <SPI.h>
#include <LoRa.h>
String inString = ""; // string to hold incoming charaters
String MyMessage = ""; // Holds the complete message

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

while (!Serial);
Serial.println("LoRa Receiver");
if (!LoRa.begin(433E6)) { // or 915E6
Serial.println("Starting LoRa failed!");
while (1);
}
}

void loop() {

// try to parse packet
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);

}

@Srivardhan06
Copy link
Author

Srivardhan06 commented May 19, 2024

I'M Connecting the pins from sx`1278 to nano

and i'm providing the external power supply for lora

Module SX1278 // Arduino NANO
Vcc -> 3.3V
MISO -> D12
MOSI -> D11
SLCK -> D13
Nss -> D10
GND -> GND
DI00 -> D2
RST -> RST

SX1278-Pinout

@Srivardhan06
Copy link
Author

Srivardhan06 commented May 19, 2024

I'M using nano for both transmitter and receiver side

OUTPUT

Transmitter side :

LoRa Sender

receiver side :

S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���
S��LN�cn���

@sercero
Copy link

sercero commented May 19, 2024

Tomorrow I'll get those modules 😊

We might have very similar setups...

Can you show a picture of how you connected everything?

Another thing... why don't you print the RSSI of the received packet?
That might help...

@Srivardhan06
Copy link
Author

OK TQ

@Srivardhan06
Copy link
Author

Connection are same as i said before |

Module SX1278 // Arduino NANO
Vcc -> 3.3V
MISO -> D12
MOSI -> D11
SLCK -> D13
Nss -> D10
GND -> GND
DI00 -> D2
RST -> RST

vcc pin is connected to 3.3v nano board
MISO pin is connected to D12 pin

@sercero
Copy link

sercero commented May 19, 2024

I wanted to see how you did the physical connection in part to help and in part to see how to do it myself because that module I think that the holes do not align with a protoboard.

@Srivardhan06
Copy link
Author

ok i will share

@Srivardhan06
Copy link
Author

I have doubt should i use level converters between lora and nano

@Srivardhan06
Copy link
Author

WhatsApp Image 2024-05-20 at 16 54 52_a698d6e4

@sercero
Copy link

sercero commented May 20, 2024

Can you take a closer picture of the connections to the module?

From this far away it seems as if the connections are wrong, for example I can't see where you connected the blue cable (GND).

@Srivardhan06
Copy link
Author

I HAVE GIVEN COMMON GROUND FOR EXTERNAL 3.3 V SUPPLY

@Srivardhan06
Copy link
Author

the ground from nano is given to the GROUND LINE of the bread board and ground from the external 3.3v is connected to the bread board ground line and lora is also connected to same ground line

@sercero
Copy link

sercero commented May 21, 2024

Have you checked continuity between the soldered cables?

I soldered cables to that module yesterday and it is a pain in the a**.

Perhaps there is a short circuit somewhere.

@Srivardhan06
Copy link
Author

Haa the connection are right

I have checked the continuity

@Srivardhan06
Copy link
Author

Can i know that you are able to receive the data from lora using nano

@Srivardhan06
Copy link
Author

If it is working can you share the circuit diagram

@sercero
Copy link

sercero commented May 24, 2024

image

Hello, I was able to make it work.

But I'm using Arduino Pro Mini.

These are the connections:

ARDUINO --------- LoRa Module
GND <- NEGRO ---> GND
VCC <- ROJO ----> 3.3V
10  <- MARRON --> NSS
11  <- AZUL ----> MOSI
12  <- NARANJA -> MISO
13  <- BLANCO --> SCK
9   <- VIOLETA -> RST
2   <- VERDE ---> DIO0

The coil antenna seems to be pretty bad, -80dBm with two modules next to each other.

I get better reception with the modules Ra-02 and a cable as an antenna

@Srivardhan06
Copy link
Author

can you check with Aduino nano

@Srivardhan06
Copy link
Author

image

@Srivardhan06
Copy link
Author

and can you share the outputs and also print rssi value of received packet

@sercero
Copy link

sercero commented May 25, 2024

Hello, I don't have an Arduino nano so that test is not possible for me...

Is it possible that Arduino nano uses 5V?

You should use 3,3V for the LoRa modules, they might work at 5V but long term they might be damaged by that voltage.

The RSSI I'm getting is -64dBm with the modules next to each other.

@sercero
Copy link

sercero commented May 25, 2024

Connection are same as i said before |

Module SX1278 // Arduino NANO Vcc -> 3.3V MISO -> D12 MOSI -> D11 SLCK -> D13 Nss -> D10 GND -> GND DI00 -> D2 RST -> RST

vcc pin is connected to 3.3v nano board MISO pin is connected to D12 pin

I see you connected RST -> RST, shouldn't it go to D9?

@Srivardhan06
Copy link
Author

haa yes rst---> d9

@Srivardhan06
Copy link
Author

i m using logic level converters between lora and nano
but i m getting

LoRa Receiver
Starting LoRa failed!

@Srivardhan06
Copy link
Author

and can you share the code and as well as ouput

@sercero
Copy link

sercero commented May 26, 2024

I took the code from here: https://iotprojectsideas.com/multiple-lora-nodes-communication-with-master-lora-node/

The output won't tell you much.

@Srivardhan06
Copy link
Author

can you give me the voltage at every pins of lora at sender and receiver

@sercero
Copy link

sercero commented May 27, 2024

I think you should better use a module like this:
image

So that you don't have issues with the soldering.

Most likely there is something wrong with the solder.

@Srivardhan06
Copy link
Author

Hoo oky i will once again

@Srivardhan06
Copy link
Author

And also i m receiving the data but there is a small issue that when i m sending 10 packets of data i'm only receiving 7 to 8 packets with -54 Rssi

I think there is a power supply issue with lora

@sercero
Copy link

sercero commented May 27, 2024

How often are you sending the packets?

The LoRa protocol is rather limited in badwitdh

@Srivardhan06
Copy link
Author

Is anything we need to configure for lora

@ErfanM98
Copy link

ErfanM98 commented Aug 18, 2024

Hi @Srivardhan06 I have a similar problem. Did you find any solutions? thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants