Arduino and LORA sx1278 module "starting failed"

Bonjour,

Je souhaite créer un système de communication entre deux Arduinos en utilisant le module Lora sx1278 mais malheureusement dés que je démarre l'Arduino transmetteur il me renvoi directement "LoRa Sender
Starting LoRa failed! "

Mes branchements sont les suivants :

lora ---> arduino
3,3v 3,3v
gnd gnd
dio0 d2
rst d9
nss d10
mosi d11
miso d12
sck d13

Et voici mon code pour l'Arduino transmetteur :

#include <SPI.h>
#include <LoRa.h>
#define ss 10
#define rst 9
#define dio0 2

int counter = 0;

void setup() {
  Serial.begin(9600);
  while (!Serial);
  LoRa.setPins(ss, rst, dio0);
  Serial.println("LoRa Sender");
  if (!LoRa.begin(433E6)) {
    Serial.println("Starting LoRa failed!");
    delay(100);
    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);
}

Merci pour votre réponse.

Can you post in english please ?

Good morning,

I want to create a communication system between two Arduinos using the Lora sx1278 module but unfortunately as soon as I start the Arduino transmitter it sends me directly "LoRa Sender
Starting LoRa failed! "

My connections are as follows:

lora ---> arduino
3.3v 3.3v
gnd gnd
dio0 d2
rst d9
nss d10
mosi d11
miso d12
sck d13

And here is my code for the Arduino transmitter:

#include <SPI.h>
#include <LoRa.h>
#define ss 10
#define rst 9
#define dio0 2

int counter = 0;

void setup() {
  Serial.begin(9600);
  while (!Serial);
  LoRa.setPins(ss, rst, dio0);
  Serial.println("LoRa Sender");
  if (!LoRa.begin(433E6)) {
    Serial.println("Starting LoRa failed!");
    delay(100);
    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);
}

Thank you for your reply.

Which Arduino are you using ?

excuse me for disturbing you I just changed the sx1278 module to see if it was a hardware problem and it was indeed the case

Good.

But which Arduino were you using ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.