Page 1 of 1

LoRa communication between 2 esp32 using a LoRa module

Posted: Thu Dec 06, 2018 6:54 pm
by jeancaire3
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 ?

Re: LoRa communication between 2 esp32 using a LoRa module

Posted: Fri Dec 21, 2018 5:54 pm
by ESP_@In逍遥子
This may be a lora related question,but we can't test lora.

Re: LoRa communication between 2 esp32 using a LoRa module

Posted: Fri Dec 21, 2018 5:55 pm
by ESP_@In逍遥子
Hi, you can try to establish basic communication between esp32 using lora module.

Re: LoRa communication between 2 esp32 using a LoRa module

Posted: Sat Feb 23, 2019 2:50 am
by Ghboy358
I have successfully attached adafruit rfm95w LoRa modules to Esp32 The thing by sparkfun through SPI

Re: LoRa communication between 2 esp32 using a LoRa module

Posted: Sun Jun 02, 2019 9:05 pm
by brolly759
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.