MOD-LoRa868 on ESP32-POE with Ardunio

Started by bfwka, November 16, 2022, 11:34:44 AM

Previous topic - Next topic

bfwka

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.

LubOlimex

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.
Technical support and documentation manager at Olimex

bfwka

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!

LubOlimex

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.
Technical support and documentation manager at Olimex

LubOlimex

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.
Technical support and documentation manager at Olimex

bfwka

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.

LubOlimex

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.
Technical support and documentation manager at Olimex

bfwka

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.

LubOlimex

Just the SS appears to be different. Use:

#define ss 5
Technical support and documentation manager at Olimex

bfwka