Closed halukmy closed 5 years ago
The right command should be LoRaNow.setPins(18, 26);
And by default, the esp32 board autoselect the pins CS 18 and DIO0 26.
You dont need to set the pins. Just run the example and should work.
=D
nope :( i tried all of them........ damn :D not works
in other framework i made it with
while (!Serial) ;
SPI.begin(SCK, MISO, MOSI, SS);
LoRa.setPins(SS, RST, DI0); // set CS, reset, IRQ pin
Are you selecting the right board ?! This pinout is from Heltec Wifi LoRa 32 (V2)
Try this code!
#define SCK 5 // GPIO5 -- SX1278's SCK
#define MISO 19 // GPIO19 -- SX1278's MISO
#define MOSI 27 // GPIO27 -- SX1278's MOSI
#define SS 18 // GPIO18 -- SX1278's CS
#define DI0 26 // GPIO26 -- SX1278's IRQ(Interrupt Request)
SPI.begin(SCK, MISO, MOSI, SS);
LoRaNow.setPins(SS, DI0);
if (!LoRaNow.begin()) {
Serial.println("LoRa init failed. Check your connections.");
while (true);
}
this is of board i try,
it works on old sample, but on your lib i got problem i dont know why
Did you manage to work with the last release of the arduino-LoRa you can try my repository is basically the same!
Try this example.
#include <SPI.h> // include libraries
#include <LoRa.h>
#define SCK 5 // GPIO5 -- SX1278's SCK
#define MISO 19 // GPIO19 -- SX1278's MISO
#define MOSI 27 // GPIO27 -- SX1278's MOSI
#define SS 18 // GPIO18 -- SX1278's CS
#define DI0 26 // GPIO26 -- SX1278's IRQ(Interrupt Request)
void setup() {
Serial.begin(115200);
while (!Serial);
SPI.begin(SCK, MISO, MOSI, SS);
LoRa.setPins(SS, -1, DI0);
while (!LoRa.begin()) {
Serial.println("LoRa init failed. Check your connections.");
}
Serial.println("LoRa init OK!");
LoRa.dumpRegisters(Serial);
}
void loop() {
}
Should work, I really don't know what's wrong =(
im going to try, do you have skype or insatnt message like whatsapp?
this one worked well btw :)
im going to try, do you have skype or insatnt message like whatsapp?
Add me on Skype: luizcassettari
Try this example.
#include <LoRaNow.h>
#define SCK 5 // GPIO5 -- SX1278's SCK
#define MISO 19 // GPIO19 -- SX1278's MISO
#define MOSI 27 // GPIO27 -- SX1278's MOSI
#define SS 18 // GPIO18 -- SX1278's CS
#define DIO0 26 // GPIO26 -- SX1278's IRQ(Interrupt Request)
void setup() {
Serial.begin(115200);
Serial.println("LoRaNow SetPins");
while (!Serial);
SPI.begin(SCK, MISO, MOSI, SS);
LoRaNow.setPins(SS, DIO0);
while (!LoRaNow.begin()) {
Serial.println("LoRa init failed. Check your connections.");
}
Serial.println("LoRa init OK!");
LoRa.dumpRegisters(Serial);
}
void loop() {
}
Hello,
The new version has this function LoRaNow.setPinsSPI(SCK, MISO, MOSI, SS, DIO0);
Can help to make the code more clear.
i just set LoRa.setPins(18, 26); // set CS, reset, IRQ pin
. Connected to sungerbob IP address: 192.168.0.25 HTTP server started LoRa init failed. Check your connections.