Olimex Support Forum

Microcontrollers => ESP32 => Topic started by: bfwka on November 16, 2022, 11:34:44 AM

Title: MOD-LoRa868 on ESP32-POE with Ardunio
Post by: bfwka on November 16, 2022, 11:34:44 AM
Hello,

I have the ESP32-POE and would like to use MOD-LoRa868 via UEXT in Arduino.
What is the best approach here to receive the Lora data?
Via SPI? Is there maybe an example sketch?

Best thanks and many greetings.
Title: Re: MOD-LoRa868 on ESP32-POE with Ardunio
Post by: LubOlimex on November 16, 2022, 04:09:48 PM
It should be pretty straight forward since you use Arduino IDE. There is official package for ESP32 for Arduino, follow the advice here:

https://github.com/espressif/arduino-esp32

and then there is this example for the LoRa for Arduino:

https://github.com/OLIMEX/LoRa-868-915/tree/main/SOFTWARE/Arduino

From the board selection select Olimex ESP32-PoE.
Title: Re: MOD-LoRa868 on ESP32-POE with Ardunio
Post by: bfwka on November 16, 2022, 04:33:33 PM
Hello,

of course I have already found and read through the two pages, but it is not clear to me how I can communicate with the module via UEXT from the ESP32. Is it a serial communication, or via SPI? For this an example would be handy.

The "example for the LoRa for Arduino" only says:
QuoteThe Olimex LoRa board had been tested successfully with the Arduino library "LoRa" by Sandeep Mistry, just find it and install it from the Arduino library manager. Refer to the picture in this folder.

Other libraries and software that support the SX1276 chip should work well with the boards too.
This is not an example for me.

Thank you!
Title: Re: MOD-LoRa868 on ESP32-POE with Ardunio
Post by: LubOlimex on November 17, 2022, 08:37:55 AM
It is SPI. It is visible in the schematic:

https://github.com/OLIMEX/LoRa-868-915/blob/main/HARDWARE/MOD-LoRa-Rev-B/MOD-LoRa_RevB.pdf

Bottom where CON1 is, you can see MISO, MOSI, SCK, SS on pins 7,8,9,10.
Title: Re: MOD-LoRa868 on ESP32-POE with Ardunio
Post by: LubOlimex on November 18, 2022, 04:53:26 PM
I did some tests today between ESP32-EVB and MOD-LoRa868-ANT and published my tests at GitHub, check it here and follow the instructions:

https://github.com/OLIMEX/LoRa-868-915/tree/main/SOFTWARE/Arduino/Send-receive-demo

For ESP32-POE you'd need to change few defines at start and select the POE board from the board selection.
Title: Re: MOD-LoRa868 on ESP32-POE with Ardunio
Post by: bfwka on June 19, 2023, 04:27:03 PM
Where can I find these defines? There are so many documents with even more PINs... :o
I also looked at the docs for the ESP32-EVB, but didn't find any matching data.
Title: Re: MOD-LoRa868 on ESP32-POE with Ardunio
Post by: LubOlimex on June 20, 2023, 08:23:32 AM
Defines are at start of code. For sender in this file:

https://github.com/OLIMEX/LoRa-868-915/blob/main/SOFTWARE/Arduino/Send-receive-demo/LoRaSender/LoRaSender.ino

#define ss 17
#define rst 16
#define dio0 4

and also for receiver:

https://github.com/OLIMEX/LoRa-868-915/blob/main/SOFTWARE/Arduino/Send-receive-demo/LoRaReceiver/LoRaReceiver.ino

#define ss 17
#define rst 16
#define dio0 4

These are defines for ESP32-EVB, you'd need to change them to fit ESP32-POE. Refer to both schematics and find the correspondence.
Title: Re: MOD-LoRa868 on ESP32-POE with Ardunio
Post by: bfwka on June 21, 2023, 11:32:32 AM
The place in the code is obvious - I'm having trouble with the schematics. (I am more a programmer than an expert in microcontrollers, so I have some difficulties reading it).

Thank you very much.
Title: Re: MOD-LoRa868 on ESP32-POE with Ardunio
Post by: LubOlimex on June 21, 2023, 02:04:58 PM
Just the SS appears to be different. Use:

#define ss 5
Title: Re: MOD-LoRa868 on ESP32-POE with Ardunio
Post by: bfwka on June 21, 2023, 05:44:24 PM
Thank you for your Help!  :)