Hey I have bought some LoRa modules from Ebyte (E220 900t30d) in order to get data transmission for a Rocket Project Im working on. After finishing my setup everything was working fine, I could send and receive data without any problem. I used UART1 on the supermini with GPIO4 RX and GPIO5 TX, M1/0 -> GND, and the E220 had a separate batterie. Now Im coming back to my project a few weeks later and this whole setup doesn't seem to work anymore. I have tried using different modules and Codes but nothing works.
Transmitter:
#include <HardwareSerial.h>
HardwareSerial LoraSerial(1);
const int PIN_LORA_RX = 4;
const int PIN_LORA_TX = 5;
void setup() {
Serial.begin(115200);
LoraSerial.begin(9600, SERIAL_8N1, PIN_LORA_RX, PIN_LORA_TX);
Serial.println("LoRa initiialisiert...");
delay(100);
}
void loop() {
static unsigned long lastSend = 0;
if (millis() - lastSend > 2000) {
String nachricht = "Hallo LoRa"; // zu sendende Nachricht
LoraSerial.println(nachricht); // Sende String + Zeilenende über LoRa
Serial.println("Gesendet: " + nachricht);
lastSend = millis();
}
}
Receiver:
#include <HardwareSerial.h>
HardwareSerial LoraSerial(1);
const int PIN_LORA_RX = 4;
const int PIN_LORA_TX = 5;
void setup() {
Serial.begin(9600);
LoraSerial.begin(9600, SERIAL_8N1, PIN_LORA_RX, PIN_LORA_TX);
Serial.println("LoRa Empfänger bereit");
}
void loop() {
if (LoraSerial.available()) {
String empfangen = LoraSerial.readStringUntil('\n');
if (empfangen.length() > 0) {
Serial.println("Empfangen: " + empfangen);
}
}
}
If I run the Receiver Code I don't get any response in the serial monitor, except for when I unplug and replug the VCC of the E220.
has anyone else had this problem in the past ?