Lora radio problem

Hello forum, can I connect two Grove - LoRa Radio 433 MHz to my Arduino Uno R3 directly through RX and TX ports present in the board, if I don’t have the UART interface? I want to communicate two LoRa Radios successfully. Kindly someone assist me. It’s very urgent. I am using currently using Arduino Uno R3. Actually, I don’t currently have any UART interface devices like Seeeduino lotus or Grove Base Shield V2.0. So I am trying to use the Grove - LoRa Radio 433 MHz by connecting it to the RX (0) and TX (1) ports available on my board (as you know that one RX and one TX port is available in an Arduino Uno Board). But I’m not able to perform successful client test.
This is my question. How to perform successful client-server test and use the the LoRa radio, without any UART interface, by connecting it directly to the Arduino UNO board?
I am facing problems and for clearing my confusions, I need a detailed procedure and guidance. I've attached the error I'm getting displayed on the serial monitor.


Kindly assist me as soon as possible

Kindly assist me as soon as possible

Dont hijack threads, its confusing for everyone, your question does not appear to have anything to do with forests.

Report your own post to the moderators to be raised a seperate post.

When posting for help, remember the forums are populated with volunteers who need as much help as possible to deal with your question, so provide links to the actual devices you are using, again it avoids confusion.

Split from an unrelated thread

@AbHacKbArrEr
Do not hijack threads with your own question and also don't use "Report to moderator" telling the mods how urgent your query is

How to perform successful client-server test and use the the LoRa radio, without any UART interface, by connecting it directly to the Arduino UNO board?

Use one of the software serial libraries, like AltSoftSerial or NeoSWserial.

AbHacKbArrEr:
Hello forum, can I connect two Grove - LoRa Radio 433 MHz to my Arduino Uno R3 directly through RX and TX ports present in the board, if I don’t have the UART interface?

The documentation that Grove publish for their board suggests that no, you dont need a specific UART interface, so their Wiki is worth a read.

Oh… the communication got established. Now I am able to connect the two LoRa radio modules with each other.

But now I'm again stuck in a problem.
I want to send the readings/measurements of a Grove Vibration Sensor (SW-420) fitted on one of my Arduinos, using (or through) the LoRa Radio - 433 MHz Transmitter (fitted on the same Arduino), to the LoRa Radio - 433 MHz Receiver, that is fitted on the second (separate) Arduino. And I want to see the vibration measurements on the serial monitor of the second arduino (to which the the LoRa receiver is connected).
I have made the LoRa sender and receiver sketches for vibration sensor, and I’m attaching them with this message. The good thing is that I have successfully established communication between the two radios, along with vibration sensor and when the vibration sensor (on the first arduino, with transmitter) is getting any jerk or vibration, the led (on the second Arduino, with receiver) is lighting up. I am able to get the measurements of vibrations on the serial monitor of radio transmitter. But I need them on the serial monitor of the receiver radio also (then only a transmission is said to be taking place), which I'm not getting.

It took me 3.2 hours to prepare these two sketches. Kindly someone guide me, I’ll provide with every required information. Please detect my fault, for which the vibration measurement from the first arduino is not going to the second arduino.
Here are my sketches :

[b]LoRa_Sender (Vibration Sensor)[/b]
#include <SoftwareSerial.h>
#include <RH_RF95.h>
int EP = 2;


// Singleton instance of the radio driver
SoftwareSerial ss(5, 6);
RH_RF95 rf95(ss);


void setup() {
  pinMode(EP, INPUT); //set EP input for measurment
  Serial.begin(115200); //init serial 9600
  Serial.println("----------------------Vibration demo------------------------");

  if (!rf95.init())
    {
        Serial.println("init failed");
        while(1);
    }

  rf95.setFrequency(434.0);
}

void loop() {
  long measurement = TP_init();
  delay(10);
  Serial.print("measurment = ");
  Serial.println(measurement);
    if (measurement > 50) {
      delay(200);
      // Send a message to rf95_server
    uint8_t data[] = "measurement";
    rf95.send(data, sizeof(data));
   delay(6000);
   
    rf95.waitPacketSent();
  }
  // Now wait for a reply
    uint8_t buf[RH_RF95_MAX_MESSAGE_LEN];
    uint8_t len = sizeof(buf);

    if(rf95.waitAvailableTimeout(3000))
    {
        // Should be a reply message for us now   
        if(rf95.recv(buf, &len))
        {
            Serial.print("got reply: ");
            Serial.println((char*)buf);
        }
        else
        {
          digitalWrite(ss, LOW);
        }
}
}

long TP_init() {
  delay(10);
  long measurement = pulseIn (EP, HIGH); //waits for the pin to get HIGH and returns measurement
  return measurement;
}
[b]LoRa_Receiver (Vibration Sensor)[/b]
#include <SoftwareSerial.h>
#include <RH_RF95.h>


// Singleton instance of the radio driver
SoftwareSerial ss(5, 6);
RH_RF95 rf95(ss);

int ledPin = LED_BUILTIN;


void setup() 
{
  pinMode(ledPin, OUTPUT);
  Serial.begin(115200); //init serial 115200
  Serial.println("-----------------------Pole - Urban Area - GHY_1---------------"); 
    
    if(!rf95.init())
    {
        Serial.println("init failed");
        while(1);
    } 
    
    rf95.setFrequency(434.0);
}

void loop() 
{
  long measurement = TP_init();
  delay(10);
  Serial.print("measurment = ");
  Serial.println(measurement);
  if(rf95.available()) 
  {
    delay(200);
    // Should be a message for us now   
    uint8_t buf[RH_RF95_MAX_MESSAGE_LEN];
    uint8_t len = sizeof(buf);
    if(rf95.recv(buf, &len)) 
    {
      Serial.print("GOT VIBRATION: ");
        Serial.println((char*)buf);
        digitalWrite(ledPin, HIGH);
        delay(6000);

    // Send a reply
        uint8_t data[] = "Thanks for the Data";
        rf95.send(data, sizeof(data));
        rf95.waitPacketSent();
        Serial.println("Sent a reply");
        
        digitalWrite(ledPin, LOW);
    }
    else
    {
        Serial.println("recv failed");
    }
}
}

long TP_init() {
  delay(10);
  long measurement = pulseIn (ss, HIGH); //wait for the pin to get HIGH and returns measurement
  return measurement;
}
[i][b]Hopefully waiting for a reply and help... ??? [/b][/i]

AbHacKbArrEr:
Oh… the communication got established. Now I am able to connect the two LoRa radio modules with each other.

But now I'm again stuck in a problem.
I want to send the readings/measurements of a Grove Vibration Sensor (SW-420) fitted on one of my Arduinos, using (or through) the LoRa Radio - 433 MHz Transmitter (fitted on the same Arduino), to the LoRa Radio - 433 MHz Receiver, that is fitted on the second (separate) Arduino. And I want to see the vibration measurements on the serial monitor of the second arduino (to which the the LoRa receiver is connected).
I have made the LoRa sender and receiver sketches for vibration sensor, and I’m attaching them with this message. The good thing is that I have successfully established communication between the two radios, along with vibration sensor and when the vibration sensor (on the first arduino, with transmitter) is getting any jerk or vibration, the led (on the second Arduino, with receiver) is lighting up. I am able to get the measurements of vibrations on the serial monitor of radio transmitter. But I need them on the serial monitor of the receiver radio also (then only a transmission is said to be taking place), which I'm not getting.

It took me 3.2 hours to prepare these two sketches. Kindly someone guide me, I’ll provide with every required information. Please detect my fault, for which the vibration measurement from the first arduino is not going to the second arduino.
Here are my sketches :

[b]LoRa_Sender (Vibration Sensor)[/b]
#include <SoftwareSerial.h>

#include <RH_RF95.h>
int EP = 2;

// Singleton instance of the radio driver
SoftwareSerial ss(5, 6);
RH_RF95 rf95(ss);

void setup() {
 pinMode(EP, INPUT); //set EP input for measurment
 Serial.begin(115200); //init serial 9600
 Serial.println("----------------------Vibration demo------------------------");

if (!rf95.init())
   {
       Serial.println("init failed");
       while(1);
   }

rf95.setFrequency(434.0);
}

void loop() {
 long measurement = TP_init();
 delay(10);
 Serial.print("measurment = ");
 Serial.println(measurement);
   if (measurement > 50) {
     delay(200);
     // Send a message to rf95_server
   uint8_t data[] = "measurement";
   rf95.send(data, sizeof(data));
  delay(6000);
 
   rf95.waitPacketSent();
 }
 // Now wait for a reply
   uint8_t buf[RH_RF95_MAX_MESSAGE_LEN];
   uint8_t len = sizeof(buf);

if(rf95.waitAvailableTimeout(3000))
   {
       // Should be a reply message for us now  
       if(rf95.recv(buf, &len))
       {
           Serial.print("got reply: ");
           Serial.println((char*)buf);
       }
       else
       {
         digitalWrite(ss, LOW);
       }
}
}

long TP_init() {
 delay(10);
 long measurement = pulseIn (EP, HIGH); //waits for the pin to get HIGH and returns measurement
 return measurement;
}






LoRa_Receiver (Vibration Sensor)







#include <SoftwareSerial.h>
#include <RH_RF95.h>

// Singleton instance of the radio driver
SoftwareSerial ss(5, 6);
RH_RF95 rf95(ss);

int ledPin = LED_BUILTIN;

void setup()
{
 pinMode(ledPin, OUTPUT);
 Serial.begin(115200); //init serial 115200
 Serial.println("-----------------------Pole - Urban Area - GHY_1---------------");
   
   if(!rf95.init())
   {
       Serial.println("init failed");
       while(1);
   }
   
   rf95.setFrequency(434.0);
}

void loop()
{
 long measurement = TP_init();
 delay(10);
 Serial.print("measurment = ");
 Serial.println(measurement);
 if(rf95.available())
 {
   delay(200);
   // Should be a message for us now  
   uint8_t buf[RH_RF95_MAX_MESSAGE_LEN];
   uint8_t len = sizeof(buf);
   if(rf95.recv(buf, &len))
   {
     Serial.print("GOT VIBRATION: ");
       Serial.println((char*)buf);
       digitalWrite(ledPin, HIGH);
       delay(6000);

// Send a reply
       uint8_t data[] = "Thanks for the Data";
       rf95.send(data, sizeof(data));
       rf95.waitPacketSent();
       Serial.println("Sent a reply");
       
       digitalWrite(ledPin, LOW);
   }
   else
   {
       Serial.println("recv failed");
   }
}
}

long TP_init() {
 delay(10);
 long measurement = pulseIn (ss, HIGH); //wait for the pin to get HIGH and returns measurement
 return measurement;
}








Hopefully waiting for a reply and help... ???

:question::grey_question::interrobang:
Please....Someone assist me and point out the errors in my sketch,for which, the vibration measurement is not going from the first arduino to the second arduino (on which the LoRa receiver is fitted).

If no-one replies it usually means no-one has experience of that particular setup.

The problem you are having does not appear to be a problem with LoRa at all, but with the UART front end device that Grove are using to talk to the actual LoRa device.

Someone would likely need experience of that particular module to assist.

For easy of use and configurability and available support, the normal SPI based LoRa devices are a better choice and there are a number of working libraies and a great deal of experience out there.

 [i][b]// Send a message to rf95_server
 uint8_t data[] = "measurement";
 rf95.send(data, sizeof(data));
[/b][/i]
I think there's something wrong with the above part of code of the transmitter, for which the transmitter is not able to send the vibration measurements recorded, to the receiver on the second Arduino. Kindly someone..... If you can.... Then guide me... I can provide as much info as you want

Why is data declared as an array of bytes when it contains chars ?

UKHeliBob:
Why is data declared as an array of bytes when it contains chars ?

That is the thing sir, I'm not able to understand. Because when I saw the sketches of both the LoRa and the vibration sensor, then actually I became a bit confused regarding using both the vibration sensor and radio module collectively. As said by me before, I am able to see the vibration measurements in the serial monitor of the radio transmitter (connected to the first arduino) only. But I want to say measurements in the serial monitor of the the radio receiver. But when any vibration is encountered, the serial monitor of the radio receiver (connected to the second arduino) is displaying just "GOT VIBRATION: measurement".
Kindly look into that? How to fix this problem?

I have no experience of the hardware and radio system that you are using but in the transmitter code change the data array declaration to char. Does that cause anything different to happen at the receiver ?