loraraspi91 / LoRa4Raspi

MIT License
12 stars 9 forks source link

low RSSI value due to bad antenna polarisation. #1

Closed HarshavardhanBalreddy closed 4 years ago

HarshavardhanBalreddy commented 4 years ago

I'm trying to communicate with the Arduino as client and raspberry pi as server, I tried few example programs, all programs are starting and displaying "Sending : HeLoRA World" but neither of the devices are receiving but both seems to be transmitting.(Judging by the output). I would appreciate your help. I'm in the middle of the project which needs to be completed by the end of the month.

loraraspi91 commented 4 years ago

Hello

If the Rfm95 is perfectly initialise and the raspberry sending messages. It should work because the lora module is initialise correctly. Maybe there is an issue on the configuration of LoRa. Did you check the frequency, the SF, etc... they must be strictly similar on both side. If possible could you send me both code so I can check on my side with board (i got arduino as well)

Hope its help you

Le ven. 10 juil. 2020 à 18:43, HARSHAVARDHAN B notifications@github.com a écrit :

I'm trying to communicate with the Arduino as client and raspberry pi as server, I tried few example programs, all programs are starting and displaying "Sending : HeLoRA World" but either of the devices are receiving or transmitting.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/loraraspi91/LoRa4Raspi/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXEAAFUGDIRVDO3MMY4PE3R25ALNANCNFSM4OWYC5AQ .

loraraspi91 commented 4 years ago

For information, all examples I provided as been tested with examples provided by the original library running on arduino pro mini (328p).

Le sam. 11 juil. 2020 à 09:39, laurent Rioux loraraspi91@gmail.com a écrit :

Hello

If the Rfm95 is perfectly initialise and the raspberry sending messages. It should work because the lora module is initialise correctly. Maybe there is an issue on the configuration of LoRa. Did you check the frequency, the SF, etc... they must be strictly similar on both side. If possible could you send me both code so I can check on my side with board (i got arduino as well)

Hope its help you

Le ven. 10 juil. 2020 à 18:43, HARSHAVARDHAN B notifications@github.com a écrit :

I'm trying to communicate with the Arduino as client and raspberry pi as server, I tried few example programs, all programs are starting and displaying "Sending : HeLoRA World" but either of the devices are receiving or transmitting.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/loraraspi91/LoRa4Raspi/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXEAAFUGDIRVDO3MMY4PE3R25ALNANCNFSM4OWYC5AQ .

HarshavardhanBalreddy commented 4 years ago
Screenshot 2020-06-22 at 6 55 34 PM Screenshot 2020-06-22 at 7 10 16 PM

These are pin configurations between Arduino and Lora, Raspberry Pi 4B and Lora.

loraraspi91 commented 4 years ago

Hello

Based on your code. You do not use the same frequency. Arduino=433mhz and raspberry pi = 868mhz. So they cannot communicate.

Le sam. 11 juil. 2020 à 10:03, HARSHAVARDHAN B notifications@github.com a écrit :

Code for sending in Arduino. `#include

include

int counter = 0;

void setup() { Serial.begin(9600); while (!Serial);

Serial.println("LoRa Sender");

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

void loop() { Serial.print("Sending packet: "); Serial.println(counter);

// send packet LoRa.beginPacket(); LoRa.print("hello "); LoRa.print(counter); LoRa.endPacket();

counter++;

delay(5000); }`

Code for receiving in RaspberryPi4B

`#include "LoRa.h"

include

int counter = 0;

void setup() {

printf("LoRa Receiver\n"); LoRa.setPins(8, 22, 4);

if (!LoRa.begin(868E6, 0)) { printf("Starting LoRa failed!\n"); while (1); } printf("Init LoRa Done !!\n"); }

void loop() { // try to parse packet int packetSize = LoRa.parsePacket(); if (packetSize) { // received a packet printf("Received packet '");

// read packet while (LoRa.available()) { printf("%c", (char)LoRa.read()); }

// print RSSI of packet printf("' with RSSI "); printf("%d\n",LoRa.packetRssi());

} }

int main(void) { setup(); while(1) loop(); }`

Note:The "LoRa.setPins((irq pin/nss)8, (RST)22, (DIO0)4);" is changed according to the pin configuration for RaspberryPi4, from the default values you provided in the program.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/loraraspi91/LoRa4Raspi/issues/1#issuecomment-657012030, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXEAAETY6TILA3QBJWDZQLR3AMG5ANCNFSM4OWYC5AQ .

loraraspi91 commented 4 years ago

Hello Based on your code. You do not used the same frequency. Arduino=433Mhz. Raspberry pi = 868 Mhz. Check the lines "LoRa.begin()"... I

Le sam. 11 juil. 2020 à 10:18, laurent Rioux loraraspi91@gmail.com a écrit :

Hello

Based on your code. You do not use the same frequency. Arduino=433mhz and raspberry pi = 868mhz. So they cannot communicate.

Le sam. 11 juil. 2020 à 10:03, HARSHAVARDHAN B notifications@github.com a écrit :

Code for sending in Arduino. `#include

include

int counter = 0;

void setup() { Serial.begin(9600); while (!Serial);

Serial.println("LoRa Sender");

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

void loop() { Serial.print("Sending packet: "); Serial.println(counter);

// send packet LoRa.beginPacket(); LoRa.print("hello "); LoRa.print(counter); LoRa.endPacket();

counter++;

delay(5000); }`

Code for receiving in RaspberryPi4B

`#include "LoRa.h"

include

int counter = 0;

void setup() {

printf("LoRa Receiver\n"); LoRa.setPins(8, 22, 4);

if (!LoRa.begin(868E6, 0)) { printf("Starting LoRa failed!\n"); while (1); } printf("Init LoRa Done !!\n"); }

void loop() { // try to parse packet int packetSize = LoRa.parsePacket(); if (packetSize) { // received a packet printf("Received packet '");

// read packet while (LoRa.available()) { printf("%c", (char)LoRa.read()); }

// print RSSI of packet printf("' with RSSI "); printf("%d\n",LoRa.packetRssi());

} }

int main(void) { setup(); while(1) loop(); }`

Note:The "LoRa.setPins((irq pin/nss)8, (RST)22, (DIO0)4);" is changed according to the pin configuration for RaspberryPi4, from the default values you provided in the program.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/loraraspi91/LoRa4Raspi/issues/1#issuecomment-657012030, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXEAAETY6TILA3QBJWDZQLR3AMG5ANCNFSM4OWYC5AQ .

HarshavardhanBalreddy commented 4 years ago

Yeah I figured that out the frequency bug and solved the issue, but after the program ran and I received few packets then I ran in to this issue Initial Output: ~/loaraspberry/LoRa4Raspi/src $ vim test.cpp ~/loaraspberry/LoRa4Raspi/src $ g++ -Wall -o test test.cpp LoRa.cpp Print.cpp WString.cpp itoa.cpp -lwiringPi ~/loaraspberry/LoRa4Raspi/src $ sudo ./test LoRa Duplex LoRa init succeeded. Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! error: message length does not match length ^C

After this error both the programs stopped sending messages the program stalled with the output. Output in RaspberryPi after the above error. :~/loaraspberry/LoRa4Raspi/src $ sudo ./test LoRa Duplex LoRa init succeeded.

Screenshot 2020-07-11 at 1 50 16 PM
loraraspi91 commented 4 years ago

The duplex program using threads to be able to receive and send data in parallel. Maybe there is a trick on raspi 4. Maybe try first the simple receive program on raspi and just send data on arduino. Just to test.

Le sam. 11 juil. 2020 à 10:23, HARSHAVARDHAN B notifications@github.com a écrit :

Yeah I figured that out the frequency bug and solved the issue, but after the program ran and I received few packets then I ran in to this issue Initial Output: ~/loaraspberry/LoRa4Raspi/src $ vim test.cpp ~/loaraspberry/LoRa4Raspi/src $ g++ -Wall -o test test.cpp LoRa.cpp Print.cpp WString.cpp itoa.cpp -lwiringPi ~/loaraspberry/LoRa4Raspi/src $ sudo ./test LoRa Duplex LoRa init succeeded. Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! Sending HeLoRa World! error: message length does not match length ^C

After this error both the programs stopped sending messages the program stalled with the output. Output in RaspberryPi after the above error. :~/loaraspberry/LoRa4Raspi/src $ sudo ./test LoRa Duplex LoRa init succeeded.

[image: Screenshot 2020-07-11 at 1 50 16 PM] https://user-images.githubusercontent.com/38979688/87219978-a2ed2400-c37d-11ea-86ff-111f18817b25.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/loraraspi91/LoRa4Raspi/issues/1#issuecomment-657014460, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXEAAENJGJBQVCVXPCSRXLR3AOPTANCNFSM4OWYC5AQ .

HarshavardhanBalreddy commented 4 years ago

Yeah I tested the programs, the programs are working fine in both the devices thanks to you, but there's an issue while receiving in RaspberryPi4.

Screenshot 2020-07-11 at 2 07 48 PM Screenshot 2020-07-11 at 2 08 01 PM

These are the outputs I've got, Arduino programs all the three receiving ,sending and duplex are working fine. There's a problem while receiving in RaspberryPI. As you can see the output it's printing an empty string. Even in full duplex mode RaspberryPi is not receiving the acknowledgement while it sends the signal perfectly. Thus kindly look in to receiving issue.

loraraspi91 commented 4 years ago

I will check this. I think the problem is the raspi 4 is running faster. Try to put a white in the reception: while length<=0 and then read data.

Le sam. 11 juil. 2020 à 10:42, HARSHAVARDHAN B notifications@github.com a écrit :

Yeah I tested the programs, the programs are working fine in both the devices thanks to you, but there's an issue while receiving in RaspberryPi4. [image: Screenshot 2020-07-11 at 2 07 48 PM] https://user-images.githubusercontent.com/38979688/87220287-24de4c80-c380-11ea-99fd-e74d9897c596.png [image: Screenshot 2020-07-11 at 2 08 01 PM] https://user-images.githubusercontent.com/38979688/87220288-260f7980-c380-11ea-81c5-415bd34c387c.png

These are the outputs I've got, Arduino programs all the three receiving ,sending and duplex are working fine. There's a problem while receiving in RaspberryPI. As you can see the output it's printing an empty string. Even in full duplex mode RaspberryPi is not receiving the acknowledgement while it sends the signal perfectly. Thus kindly look in to receiving issue.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/loraraspi91/LoRa4Raspi/issues/1#issuecomment-657016831, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXEAAFEPEWKT7PJ5HEFGP3R3AQW3ANCNFSM4OWYC5AQ .

HarshavardhanBalreddy commented 4 years ago

`

include "LoRa.h"

include

int counter = 0;

void setup() {

printf("LoRa Receiver\n"); LoRa.setPins(8, 22, 4);

if (!LoRa.begin(433E6, 0)) { printf("Starting LoRa failed!\n"); while (1); } printf("Init LoRa Done !!\n"); }

void loop() { // try to parse packet int packetSize = LoRa.parsePacket(); if (packetSize) { // received a packet printf("Received packet '");

// read packet
while (LoRa.available()) {
  printf("%c", (char)LoRa.read());
}

// print RSSI of packet
 printf("' with RSSI ");
 printf("%d\n",LoRa.packetRssi());

} }

int main(void) { setup(); while(1) loop(); } `

Where exactly should I include the while loop, can you be more specific.

loraraspi91 commented 4 years ago

Now, I remember, I got the same issue before. It is an issue from the wiringPi library and its mechanism to read pin / interrupt. Ifound a workaround this way. In fact it was strange, the same program was working fine on raspberry pi Zero W and not on raspberry pi 3. the solution was to re_install everything. It is like something turn badly in the wiringpi library when reading pin. the Pin read return 1 but the value was 0, do not know why. So the program thinks there is data received but it is not the case.

Workaround: 1- save your program and source before on another place. 2- re-install everything: So, take a new SD card with a fresh OS (from an image) and re-install all needed libraries (c/c++ developpemen, wiringPi and the source code etc...) . 3- re-compile and test

It should work after that. I even try to remove the WiringPI and re-install but I got the same error. Only, the total frest re-install has been worked.

try your chance by this way.

Le sam. 11 juil. 2020 à 11:15, HARSHAVARDHAN B notifications@github.com a écrit :

`

include "LoRa.h"

include

int counter = 0;

void setup() {

printf("LoRa Receiver\n"); LoRa.setPins(8, 22, 4);

if (!LoRa.begin(433E6, 0)) { printf("Starting LoRa failed!\n"); while (1); } printf("Init LoRa Done !!\n"); }

void loop() { // try to parse packet int packetSize = LoRa.parsePacket(); if (packetSize) { // received a packet printf("Received packet '");

// read packet while (LoRa.available()) { printf("%c", (char)LoRa.read()); }

// print RSSI of packet printf("' with RSSI "); printf("%d\n",LoRa.packetRssi());

} }

int main(void) { setup(); while(1) loop(); } `

Where exactly should I include the while loop, can you be more specific.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/loraraspi91/LoRa4Raspi/issues/1#issuecomment-657021464, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXEAAAMH2BAQDKP37KHQA3R3AUT3ANCNFSM4OWYC5AQ .

loraraspi91 commented 4 years ago

I thought the issue was only on my side due to the development of the library. I think the WiringPI library turns bad when it is used with multi-threading (like duplex program). So currently the solution is to re-install everything and avoid using the duplex program since it is making the WiringPI bad (even simple program do not work after that) I will try to fix it (since you have the problem as well), but my library needs to be compliant with WiringPI since people may use it with the LoRa library. So, a tricky thing ....

Le sam. 11 juil. 2020 à 11:44, HARSHAVARDHAN B notifications@github.com a écrit :

Sure thing, I'll try that and I'll get back to you.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/loraraspi91/LoRa4Raspi/issues/1#issuecomment-657027458, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXEAAFSTYKVMKX7QSZXJ3TR3AX6VANCNFSM4OWYC5AQ .

HarshavardhanBalreddy commented 4 years ago

Yeah I tested the programs, the programs are working fine in both the devices thanks to you, but there's an issue while receiving in RaspberryPi4.

Screenshot 2020-07-11 at 2 07 48 PM Screenshot 2020-07-11 at 2 08 01 PM

These are the outputs I've got, Arduino programs all the three receiving ,sending and duplex are working fine. There's a problem while receiving in RaspberryPI. As you can see the output it's printing an empty string. Even in full duplex mode RaspberryPi is not receiving the acknowledgement while it sends the signal perfectly. Thus kindly look in to receiving issue.

Not only the full duplex function, the receiving function printing an empty message as I explained above, I reinstalled the OS and updated wiring Pi to latest version. Is there any possible way just to receive the data correctly.

I didn't not run the full duplex program, after setting up the entire system, even after that the receiving function didn't work.

loraraspi91 commented 4 years ago

I try again with my raspberry pi 3 and my arduino. And the raspberry pi is receiving (see the picture).

I also check with my Rasperry PI zero and it is also working.

I'm using Wiringpi 2.50, to check type "gpio -v".

I will try to put my raspberry pi in the same situation as you by using duplex (mean same problem) and I will try to solve it.

Le sam. 11 juil. 2020 à 18:58, HARSHAVARDHAN B notifications@github.com a écrit :

Yeah I tested the programs, the programs are working fine in both the devices thanks to you, but there's an issue while receiving in RaspberryPi4. [image: Screenshot 2020-07-11 at 2 07 48 PM] https://user-images.githubusercontent.com/38979688/87220287-24de4c80-c380-11ea-99fd-e74d9897c596.png [image: Screenshot 2020-07-11 at 2 08 01 PM] https://user-images.githubusercontent.com/38979688/87220288-260f7980-c380-11ea-81c5-415bd34c387c.png

These are the outputs I've got, Arduino programs all the three receiving ,sending and duplex are working fine. There's a problem while receiving in RaspberryPI. As you can see the output it's printing an empty string. Even in full duplex mode RaspberryPi is not receiving the acknowledgement while it sends the signal perfectly. Thus kindly look in to receiving issue.

Not only the full duplex function, the receiving function printing an empty message as I explained above, I reinstalled the OS and update wiring Pi to latest version. Is there any possible way just to receive the data correctly.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/loraraspi91/LoRa4Raspi/issues/1#issuecomment-657094727, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXEAAEUFGDEFIIBDTGZCRDR3CKZRANCNFSM4OWYC5AQ .

loraraspi91 commented 4 years ago

The issue is LoRa.available() function is returning false so you do not get any data.

if you try to replace the While loop by a code like this:

// read packet while (LoRa.available()) { printf("%c", (char)LoRa.read()); } replace by :

// read packet for(int i=0; i<7;i++) { printf("%c", (char)LoRa.read()); }

So you could see that you are receiving data.

Le dim. 12 juil. 2020 à 00:07, laurent Rioux loraraspi91@gmail.com a écrit :

I try again with my raspberry pi 3 and my arduino. And the raspberry pi is receiving (see the picture).

I also check with my Rasperry PI zero and it is also working.

I'm using Wiringpi 2.50, to check type "gpio -v".

I will try to put my raspberry pi in the same situation as you by using duplex (mean same problem) and I will try to solve it.

Le sam. 11 juil. 2020 à 18:58, HARSHAVARDHAN B notifications@github.com a écrit :

Yeah I tested the programs, the programs are working fine in both the devices thanks to you, but there's an issue while receiving in RaspberryPi4. [image: Screenshot 2020-07-11 at 2 07 48 PM] https://user-images.githubusercontent.com/38979688/87220287-24de4c80-c380-11ea-99fd-e74d9897c596.png [image: Screenshot 2020-07-11 at 2 08 01 PM] https://user-images.githubusercontent.com/38979688/87220288-260f7980-c380-11ea-81c5-415bd34c387c.png

These are the outputs I've got, Arduino programs all the three receiving ,sending and duplex are working fine. There's a problem while receiving in RaspberryPI. As you can see the output it's printing an empty string. Even in full duplex mode RaspberryPi is not receiving the acknowledgement while it sends the signal perfectly. Thus kindly look in to receiving issue.

Not only the full duplex function, the receiving function printing an empty message as I explained above, I reinstalled the OS and update wiring Pi to latest version. Is there any possible way just to receive the data correctly.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/loraraspi91/LoRa4Raspi/issues/1#issuecomment-657094727, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXEAAEUFGDEFIIBDTGZCRDR3CKZRANCNFSM4OWYC5AQ .

HarshavardhanBalreddy commented 4 years ago
Screenshot 2020-07-12 at 5 32 03 PM

Finally it worked, I found the problem it's because of the fluctuating power from the Arduino.

Yeah I tested the programs, the programs are working fine in both the devices thanks to you, but there's an issue while receiving in RaspberryPi4.

Screenshot 2020-07-11 at 2 07 48 PM Screenshot 2020-07-11 at 2 08 01 PM

These are the outputs I've got, Arduino programs all the three receiving ,sending and duplex are working fine. There's a problem while receiving in RaspberryPI. As you can see the output it's printing an empty string. Even in full duplex mode RaspberryPi is not receiving the acknowledgement while it sends the signal perfectly. Thus kindly look in to receiving issue.

Not only the full duplex function, the receiving function printing an empty message as I explained above, I reinstalled the OS and updated wiring Pi to latest version. Is there any possible way just to receive the data correctly.

I didn't not run the full duplex program, after setting up the entire system, even after that the receiving function didn't work.

You can check the RSSI (Received Signal Strength Indication) value which clearly is out of the minimum range of LORA protocol to receive the data perfectly. Typical LoRa RSSI values are:

RSSI minimum = -120 dBm.

If RSSI=-30dBm: signal is strong. If RSSI=-120dBm: signal is weak.

Thus the Arduino failed to transmit the signal.

https://lora.readthedocs.io/en/latest/

Read the above link for more info.

HarshavardhanBalreddy commented 4 years ago

The only problem that is to be solved is the Full duplex program, hope you'll fix it soon.

loraraspi91 commented 4 years ago

Ok, good. I will try to order a raspberry 4 so I could test it and try to find a solution for this

Le dim. 12 juil. 2020 à 14:12, HARSHAVARDHAN B notifications@github.com a écrit :

The only problem that is to be solved is the Full duplex program, hope you'll fix it soon.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/loraraspi91/LoRa4Raspi/issues/1#issuecomment-657213570, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXEAACYCA3FON6KPCAJELTR3GSCDANCNFSM4OWYC5AQ .

loraraspi91 commented 4 years ago

Did you try the duplex program ? Still not working ? Because I remember the multithreading ans the tricky things were the CAD example.

Le dim. 12 juil. 2020 à 14:31, laurent Rioux loraraspi91@gmail.com a écrit :

Ok, good. I will try to order a raspberry 4 so I could test it and try to find a solution for this

Le dim. 12 juil. 2020 à 14:12, HARSHAVARDHAN B notifications@github.com a écrit :

The only problem that is to be solved is the Full duplex program, hope you'll fix it soon.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/loraraspi91/LoRa4Raspi/issues/1#issuecomment-657213570, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOXEAACYCA3FON6KPCAJELTR3GSCDANCNFSM4OWYC5AQ .

HarshavardhanBalreddy commented 4 years ago

Yeah, I did tried the full duplex program can't transmit the signal from Arduino to pi. Pi to Arduino is working fine.

HarshavardhanBalreddy commented 4 years ago
Screenshot 2020-07-13 at 11 04 24 PM Screenshot 2020-07-13 at 11 03 49 PM

Initially I thought it was an issue due to low power supply while transmitting the signal. But it's not. Anyway it's always better to connect a capacitor for better and reliable power supply if you feel power for transferring signal is not enough due to fluctuations.

Full duplex is working and there's nothing wrong with the devices or the libraries.

Finally after running the same programs various times and running multiple tests, I found that there's nothing wrong with any library or the programs or the power supply. But the problem is the antenna orientation, which I wasn't caring much about but that's the culprit that wasted a lot of time, but I learnt something from the mistake, the antenna orientation is very important, if one antenna is horizontal aligned the receiving antenna should also be aligned in the same way, if one antenna is vertically aligned then the other antenna should also be vertically aligned. If you neglect antenna polarisation, RSSI value will be decreased which further leads to poor connection and loss of data. It's always better to align antennas in a way that they are parallel to each other.

Screenshot 2020-07-12 at 5 32 03 PM

Finally it worked, I found the problem it's because of the fluctuating power from the Arduino.

Yeah I tested the programs, the programs are working fine in both the devices thanks to you, but there's an issue while receiving in RaspberryPi4.

Screenshot 2020-07-11 at 2 07 48 PM Screenshot 2020-07-11 at 2 08 01 PM

These are the outputs I've got, Arduino programs all the three receiving ,sending and duplex are working fine. There's a problem while receiving in RaspberryPI. As you can see the output it's printing an empty string. Even in full duplex mode RaspberryPi is not receiving the acknowledgement while it sends the signal perfectly. Thus kindly look in to receiving issue.

Not only the full duplex function, the receiving function printing an empty message as I explained above, I reinstalled the OS and updated wiring Pi to latest version. Is there any possible way just to receive the data correctly. I didn't not run the full duplex program, after setting up the entire system, even after that the receiving function didn't work.

You can check the RSSI (Received Signal Strength Indication) value which clearly is out of the minimum range of LORA protocol to receive the data perfectly. Typical LoRa RSSI values are:

RSSI minimum = -120 dBm.

If RSSI=-30dBm: signal is strong. If RSSI=-120dBm: signal is weak.

Thus the Arduino failed to transmit the signal.

https://lora.readthedocs.io/en/latest/

Read the above link for more info.

So a vertical antenna (i.e. one with vertical elements) will receive vertically polarised signals best and similarly a horizontal antenna will receive horizontally polarised signals.

As the problem solved, I am closing this issue. And thanks for this library it's really helpful as I can use same code in both Arduino and Raspberry with minimal changes.

HarshavardhanBalreddy commented 4 years ago

Thanks for your time and replying to the issue @loraraspi91 .