LoRa communication between 2 esp32 using a LoRa module

jeancaire3
Posts: 1
Joined: Thu Dec 06, 2018 1:56 pm

LoRa communication between 2 esp32 using a LoRa module

Postby jeancaire3 » Thu Dec 06, 2018 6:54 pm

Hello !

I am trying to communicate between 2 esp32 (TTGO V2 epaper) using UART by LoRa. I am using this LoRa module : http://www.ebyte.com/en/product-view-ne ... ItNmko-Cxo


According to the circuit : https://ibb.co/xJkh8rS Rx and Tx use HS2


Here is the code of the emettor :
  1. HardwareSerial ss(2);  
  2.  
  3. uint8_t buff[16];
  4. int compt=0;
  5. int len=0,ret=0;;
  6.  
  7. union
  8. {
  9.   uint8_t buff[16];
  10.   char tamp[16];
  11. } frame;
  12.  
  13.  
  14. void setup() {
  15.   Serial.begin(9600);
  16.   ss.begin(9600);
  17. }
  18.  
  19. void loop() {
  20.   compt++;
  21.   sprintf(frame.tamp,"Packet:%d", compt);
  22.   len=strlen(frame.tamp);
  23.   Serial.println(len);Serial.println(frame.tamp);
  24.   ret=ss.write(frame.buff,strlen(frame.tamp));
  25.   Serial.println(ret);
  26.   delay(3000);  
  27.  
  28. }
The serial monitor displays this : https://ibb.co/0Yp7h5F
It shows that the emitter is working correctly.

And here is the code of the receiver :

Code: Select all

HardwareSerial ss(2);   

char buff[16];
int i=0;

void setup() {
  Serial.begin(9600);
  Serial.println("begin");
  ss.begin(9600);
}

void loop() 
{
  i=0;
  //Serial.println(ss.available());
   if(ss.available() > 1){//Read from UM402 and send to serial monitor
    String input = ss.readString();
   Serial.println(input); 
   }
  delay(20);
}
The emitter seems to be working but the receiver doesn't receive anything.

Does someone have any idea of where it may come from ?

ESP_@In逍遥子
Posts: 132
Joined: Thu Nov 15, 2018 2:06 am

Re: LoRa communication between 2 esp32 using a LoRa module

Postby ESP_@In逍遥子 » Fri Dec 21, 2018 5:54 pm

This may be a lora related question,but we can't test lora.

ESP_@In逍遥子
Posts: 132
Joined: Thu Nov 15, 2018 2:06 am

Re: LoRa communication between 2 esp32 using a LoRa module

Postby ESP_@In逍遥子 » Fri Dec 21, 2018 5:55 pm

Hi, you can try to establish basic communication between esp32 using lora module.

Ghboy358
Posts: 1
Joined: Sat Feb 23, 2019 2:39 am

Re: LoRa communication between 2 esp32 using a LoRa module

Postby Ghboy358 » Sat Feb 23, 2019 2:50 am

I have successfully attached adafruit rfm95w LoRa modules to Esp32 The thing by sparkfun through SPI

brolly759
Posts: 13
Joined: Sun Jun 02, 2019 9:00 pm

Re: LoRa communication between 2 esp32 using a LoRa module

Postby brolly759 » Sun Jun 02, 2019 9:05 pm

I am wondering on a more fundamental question your application. Why would you use LoRa as a bridge between 2 ESP32. LoRa modulation requires a 1% duty cycle and depending on your amount of data you should not be transmitting that often. ie, 1 second TX time = 100 seconds wait time before being able to send the next one. The LoraWan stack locks you down even further.

Who is online

Users browsing this forum: No registered users and 52 guests