On the SX1278 chip (410-525 MHz) there is a pair of radio modules LoRa Ra-01.
I connect one of them to Arduino UNO and load the module sketch taken from LoRa examples into the module. The second connected to the Arduino Pro Mini and uploaded a sketch of the receiver from the examples. Data from one node was successfully received by the second.
The only drawback is that on the monitor of the Arduino IDE compiler, messages with the Arduino Pro Mini are read at a speed two times lower than that specified in the sketch, for example, 4800 instead of 9600. The frequency has decreased after installing the UNO driver or the Lora.h library. Prior to that, there were no problems with the speed of the Arduino Pro Mini and ESP8266 modules.
Now I upload a sketch of the transmitter in the Arduino Pro Mini. Transmitter is not working. Instead, the LED on the USB-to-Serial adapter flashes at the frequency specified in the sketch, and the Arduino Pro Mini module is connected and disconnected at the same device frequency in the computer's device manager. There are no signs on the compiler monitor.
How to solve a problem? Thanks in advance for your help.
Sorry, bad computer translation.
Transmitter:
#include <SPI.h>
#include <LoRa.h>
int counter = 0;
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("LoRa Sender");
if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
LoRa.setTxPower(20);
}
void loop() {
Serial.print("Sending packet: ");
Serial.println(counter);
// send packet
LoRa.beginPacket();
LoRa.print("hello ");
LoRa.print(counter);
LoRa.endPacket();
counter++;
delay(5000);
}
Receiver:
#include <SPI.h>
#include <LoRa.h>
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("LoRa Receiver");
if (!LoRa.begin(433E6)) {
Serial.println("Starting LoRa failed!");
while (1);
}
}
void loop() {
// try to parse packet
int packetSize = LoRa.parsePacket();
if (packetSize) {
// received a packet
Serial.print("Received packet '");
// read packet
while (LoRa.available()) {
Serial.print((char)LoRa.read());
}
// print RSSI of packet
Serial.print("' with RSSI ");
Serial.println(LoRa.packetRssi());
}
}