You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 2 ESP32 communicating through LoRa. Communication works perfectly till after some time (typically a few hours) the receiver stops receiving data. After reseting the receiver or turning it off/on the power supply several times, data reception is resumed. Any idea about the origin of this erratical lock-down ? Here you have the sender and receiver code:
if (!LoRa.begin (LORA_FREQUENCY)) {
Serial.println ("Starting LoRa failed!");
while (1);
}
else {
Serial.print ("LoRa initialized with frequency ");
Serial.println (LORA_FREQUENCY);
}
LoRa.setSyncWord(0xF3); // ranges from 0-0xFF, default 0x34, see API docs
}
#include <SPI.h>
#include <LoRa.h>
#include <LiquidCrystal_I2C.h>
// set the LCD number of columns and rows
int lcdColumns = 16;
int lcdRows = 2;
// set LCD address, number of columns and rows
// if you don't know your display address, run an I2C scanner sketch
LiquidCrystal_I2C lcd(0x27, lcdColumns, lcdRows);
//======================================================================//
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have 2 ESP32 communicating through LoRa. Communication works perfectly till after some time (typically a few hours) the receiver stops receiving data. After reseting the receiver or turning it off/on the power supply several times, data reception is resumed. Any idea about the origin of this erratical lock-down ? Here you have the sender and receiver code:
SENDER:
`//======================================================================//
#include <SPI.h>
#include <LoRa.h>
//======================================================================//
#define PIN_LORA_COPI 23
#define PIN_LORA_CIPO 19
#define PIN_LORA_SCK 18
#define PIN_LORA_CS 5
#define PIN_LORA_RST 2
#define PIN_LORA_DIO0 4
#define LORA_FREQUENCY 433E6
//======================================================================//
int counter = 0;
//======================================================================//
void setup() {
Serial.begin (115200);
while (!Serial);
delay (1500);
Serial.println ("LoRa Sender");
LoRa.setPins (PIN_LORA_CS, PIN_LORA_RST, PIN_LORA_DIO0);
LoRa.setSPIFrequency (20000000);
LoRa.setTxPower (20);
if (!LoRa.begin (LORA_FREQUENCY)) {
Serial.println ("Starting LoRa failed!");
while (1);
}
else {
Serial.print ("LoRa initialized with frequency ");
Serial.println (LORA_FREQUENCY);
}
LoRa.setSyncWord(0xF3); // ranges from 0-0xFF, default 0x34, see API docs
}
//======================================================================//
void loop() {
Serial.print ("Sending packet: ");
Serial.println (counter);
LoRa.beginPacket();
//LoRa.print ("Hello LoRa ");
LoRa.print(counter); // send packet
LoRa.endPacket();
counter++;
delay (1000);
}`
RECEIVER:
`//======================================================================//
#include <SPI.h>
#include <LoRa.h>
#include <LiquidCrystal_I2C.h>
// set the LCD number of columns and rows
int lcdColumns = 16;
int lcdRows = 2;
// set LCD address, number of columns and rows
// if you don't know your display address, run an I2C scanner sketch
LiquidCrystal_I2C lcd(0x27, lcdColumns, lcdRows);
//======================================================================//
#define PIN_LORA_COPI 23
#define PIN_LORA_CIPO 19
#define PIN_LORA_SCK 18
#define PIN_LORA_CS 5
#define PIN_LORA_RST 2
#define PIN_LORA_DIO0 4
#define LORA_FREQUENCY 433E6
//======================================================================//
void setup() {
Serial.begin (115200);
while (!Serial);
delay (1500);
lcd.init(); // initialize lcd
lcd.backlight(); // turn on LCD backlight
Serial.println ("LoRa Receiver");
LoRa.setPins (PIN_LORA_CS, PIN_LORA_RST, PIN_LORA_DIO0);
LoRa.setSPIFrequency (20000000);
if (!LoRa.begin (LORA_FREQUENCY)) {
Serial.println ("Starting LoRa failed!");
while (1);
}
else {
Serial.print ("LoRa initialized with frequency ");
Serial.println (LORA_FREQUENCY);
}
LoRa.setSyncWord(0xF3);
}
//======================================================================//
void loop() {
int counter,rssi,snr;
int packetSize = LoRa.parsePacket(); // packet received ?
if (packetSize) {
}
}
`
Beta Was this translation helpful? Give feedback.
All reactions