sandeepmistry / arduino-LoRa

An Arduino library for sending and receiving data using LoRa radios.
MIT License
1.64k stars 628 forks source link

ESP8266 with arduino-Lora library? #231

Closed panosss closed 5 years ago

panosss commented 5 years ago

Hi everybody. I have made a receiver and a transmitter with 2 arduinos and 2 Lora RA-01 modules using your library, arduino-Lora. Worked fine!

Now, I replaced on the receiver the Arduino with an ESP8266-12E module. But it's not working anymore. Can this library work with ESP8266? Should I make any changes? Thank you.

EDIT: Ok, I manage to make it work, I had forgot to change the pins (LoRa.setPins). Works fine!

JRAlvarez2017 commented 4 years ago

Could you tell me the pins wiring? you used I cannot make work with an ESP8266 Thanks

panosss commented 4 years ago

They are connected this way (I use a NodeMCU): NodeMCU.........LORA GPIO15(D8)......SS GPIO13(D7)......MOSI GPIO12(D6)......MISO GPIO14(D5).....SCK GPIO0(D3).......RESET

And in code:

const int csPin = 15;         // LoRa radio chip select   GPIO15(D8)->SS OF Lora module
const int resetPin = 0;       // LoRa radio reset         GPIO0(D3)->RESET OF Lora module

LoRa.setPins(csPin, resetPin);
JRAlvarez2017 commented 4 years ago

Thank you

Erik84750 commented 3 years ago

I have the same issue: lora.h works with Arduino, not with ESP8266 (MISO: GPIO12; MOSI: GPIO13; CLK: GPIO14; CS: GPIO15): are the pin definitions in the library correct? Where to connect and define RST and NSS (chip select)?

Erik84750 commented 3 years ago

From: https://github.com/sandeepmistry/arduino-LoRa

NSS, NRESET, and DIO0 pins can be changed by using LoRa.setPins(ss, reset, dio0). DIO0 pin is optional, it is only needed for receive callback mode. If DIO0 pin is used, it must be interrupt capable via attachInterrupt(...).

Is that the solution?