❓ Help SX1278 LoRa Communication

Phrog

Forum Veteran
Baka may marunong sa LoRa dito, using Arduino. Nung una nakakapag communicate pa sila ehh
Tapos nung nag add na ako ng ibang components ayaw na, hindi ko sure kung bakit.
Now I'm testing them without other components, pero ayaw padin.

C++:
//TX CODE
#include <SPI.h>
#include <LoRa.h>

void setup() {
  Serial.begin(9600);
  while (!Serial);

  Serial.println("LoRa Receiver Test");

  if (!LoRa.begin(915E6)) {  // Initialize LoRa
    Serial.println("ERROR: LoRa module not detected!");
    while (1);  // Halt execution if LoRa fails
  }

  Serial.println("LoRa module detected successfully!");
  Serial.println("Waiting for packets...");
}

void loop() {
  int packetSize = LoRa.parsePacket();
 
  if (packetSize) {  // If a packet is received
    Serial.print("Received packet: '");

    while (LoRa.available()) {
      Serial.print((char)LoRa.read());  // Read and print received data
    }

    Serial.print("' with RSSI ");
    Serial.println(LoRa.packetRssi());  // Print RSSI (signal strength)
  }
}

C++:
//RX CODE
#include <SPI.h>
#include <LoRa.h>

void setup() {
  Serial.begin(9600);
  while (!Serial);

  Serial.println("LoRa Receiver Test");

  if (!LoRa.begin(915E6)) {  // Initialize LoRa
    Serial.println("ERROR: LoRa module not detected!");
    while (1);  // Halt execution if LoRa fails
  }

  Serial.println("LoRa module detected successfully!");
  Serial.println("Waiting for packets...");
}

void loop() {
  int packetSize = LoRa.parsePacket();
 
  if (packetSize) {  // If a packet is received
    Serial.print("Received packet: '");

    while (LoRa.available()) {
      Serial.print((char)LoRa.read());  // Read and print received data
    }

    Serial.print("' with RSSI ");
    Serial.println(LoRa.packetRssi());  // Print RSSI (signal strength)
  }
}

Wiring on Both Uno looks like this without the Potentiometer
1738145022398.webp
 

About this Thread

  • 0
    Replies
  • 245
    Views
  • 1
    Participants
Last reply from:
Phrog

Trending Topics

Online now

Members online
1,126
Guests online
5,397
Total visitors
6,523

Forum statistics

Threads
2,312,588
Posts
29,169,092
Members
1,185,293
Latest member
Cartz23
Back
Top