How to retrieve data from lora ra01

I have build 20 lora network by using arduino nano and ra01 to transmit and receive RSS among themselves. I use edited half duplex code from example. My problem is how to retrieve the data from 20 lora to my computer? What is the arduino coding to retrieve the 20 lora data? Please help me. Thank you.

looihaoting:
I have build 20 lora network by using arduino nano and ra01 to transmit and receive RSS among themselves. I use edited half duplex code from example. My problem is how to retrieve the data from 20 lora to my computer? What is the arduino coding to retrieve the 20 lora data? Please help me. Thank you.

You seem to be assuming that the forum knows what an 'ra01' is, what 'receive RSS' means and what 'data' you want to retrieve.

If you really want help with a problem, then spend some time providing a proper description of the project, the problem, provide the code you are using and links to the components you are using.

However, the obvious question is why have you 'build (a) 20 lora network' but you do not apparently know how to read data from the devices you are using ?

/*
  LoRa Duplex communication

  Sends a message every half second, and polls continually
  for new incoming messages. Implements a one-byte addressing scheme,
  with 0xFF as the broadcast address.

  Uses readString() from Stream class to read payload. The Stream class'
  timeout may affect other functuons, like the radio's callback. For an

  created 28 April 2017
  by Tom Igoe
*/
#include <SPI.h>              // include libraries
#include <LoRa.h>
//
//const int csPin = 7;          // LoRa radio chip select
//const int resetPin = 6;       // LoRa radio reset
//const int irqPin = 1;         // change for your board; must be a hardware interrupt pin

String outgoing;              // outgoing message


byte localAddress = 0x1A;     // address of this device

long lastSendTime = 0;        // last send time
int interval = 2000;          // interval between sends

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

  Serial.println("LoRa Duplex");

//  // override the default CS, reset, and IRQ pins (optional)
//  LoRa.setPins(csPin, resetPin, irqPin);// set CS, reset, IRQ pin

  if (!LoRa.begin(433E6)) {             // initialize ratio at 915 MHz
    Serial.println("LoRa init failed. Check your connections.");
    while (true);                       // if failed, do nothing
  }

  Serial.println("LoRa init succeeded.");
}

void loop() {
 if (millis() - lastSendTime > interval) {
    String message = "1A ";   // send a message
    sendMessage(message);
    Serial.println("From " + message);
    lastSendTime = millis();            // timestamp the message
    interval = random(2000) + 9000;    // 2-3 seconds
  }
  

  // parse for a packet, and call onReceive with the result:
  onReceive(LoRa.parsePacket());
}

void sendMessage(String outgoing) {
  LoRa.beginPacket();                   // start packet
  LoRa.print("1A ");            // add sender address
  LoRa.endPacket();                     // finish packet and send it

 
}

void onReceive(int packetSize) {
  if (packetSize) {
    // received a packet
    Serial.print("Received packet '");

    // read packet
    while (LoRa.available()) {
      Serial.print((char)LoRa.read());
    }

    // print RSSI of packet
    Serial.print("' with RSSI ");
    Serial.println(LoRa.packetRssi());
  }
}

This is the code of my LoRa half duplex coding, it is transmitting and receiving to/from another 19 LoRa.
My problem is how to retrieve the data from 20 LoRa wirelessly by not using the cable.

https://store.arduino.cc/usa/arduino-nano
The link above is the arduino nano i use.

The link above shows the LoRa Ra-01 i use.

The RSS is Received Signal Strength, it measure the signal between two LoRa.

I know how to obtain the data by plug them into my computer, but i don't know how to obtain them wirelessly.

The data i want to obtain is the RSS value.

LoRa devices have an RSSI register, there is a link to the devices datasheet on the RA01 link you gave.

The datasheet will tell you which register holds the RSSI value of the last packet and how to calculate it.

Have you checked the Examples folder of the LoRa library you are using for any examples of reading the RSSI ?

Indeed, in the code you have posted you are sending the RSSI to the serial monitor, so its not really clear what your question is ?

And an explanation of the project and why you want to read the RSSI values would be helpful to the forum.

The coding that I show is the half duplex coding for trasmitting and receiving RSS to/from lora. I can obtain the RSS by plug the Arduino nano to my PC and it will be shown on serial monitor. My problem is how to obtain the RSS of the 20 lora without touching the 20 lora. Is there any methods or coding to retrieve it? My project is to localized people in the certain area by measuring the RSS value.

And the coding I'm using is from the library example,I just edit it to make it more easy to use.

looihaoting:
My project is to localized people in the certain area by measuring the RSS value.

Over what size of area and in what environment are these 40 people ?

to localized people in the certain area by measuring the RSS value.

RSSI does not work for localization.

This idea comes up in the forum every few days, and no one has ever reported success. But certainly, do the experiment to learn why it does not work.

looihaoting:
I can obtain the RSS by plug the Arduino nano to my PC and it will be shown on serial monitor. My problem is how to obtain the RSS of the 20 lora without touching the 20 lora.

Not sure I am understanding why there is a problem or exactly what it is you are planning to do.

Just send a message addressed to each of the remote LoRa receivers and have them reply with an acknowledge, you can them read the RSSI (its not RSS) of the acknowledge reply.

srnet:
Just send a message addressed to each of the remote LoRa receivers and have them reply with an acknowledge, you can them read the RSSI (its not RSS) of the acknowledge reply.

You could even have the reply message from the remotes include the RSSI that they saw. That way you would have two pieces of information that may or may not be useful for localization.

Just send a message addressed to each of the remote LoRa receivers and have them reply with an acknowledge, you can them read the RSSI (its not RSS) of the acknowledge reply.

Does it means that I need a extra Arduino nano and Lora to connect to the computer and receive the RSSI from the receiver? Can I know the Arduino code for it? :slight_smile:

This is my general idea

The library you are using will probably have examples on how to send data from one LoRa module to another.

Since each of the 20 (or is it 40) LoRa modules can talk to each other or a central gateway there ought to be no problem getting data back to the central gateway, but its difficult to be sure, you have still not provided much in the way of details on what you are trying to do.

If you want someone to write the code for you, go and ask over in the 'Gigs and Collaborations' forum, but you will need to provide a lot more details on what you are doing.

Personally, and in particular because of the way the LoRa modules fudge the calculation of RSSI (they are below noise devices after all), I dont think your idea will work.

Thank you for helping me and willing to listen to my problem. I'm really appreciate your help. The links you share are very helpful.

This is my general idea

That is certainly not an original idea.

People have been doing those sorts of experiments in idealized environments for over a decade, with little useful success.

The top paper in this list, a research paper from 2008 demonstrates the technique, using the same arrangement of nodes that you propose, outdoors in an obstacle free environment, with carefully positioned antennas all in the same orientation.

However, the technique does not work in the real world, or any place where it would actually be useful, or you would be able to buy cheap devices that use it.