I made a getting started tutorial video for the same module last week which I recommend that you should take a look before progressing with this tutorial.
Wiring and Circuit
All the connections are done already on the PCB.
Connections between the ESP32, OLED and E32 breakout board are basic and connected using a couple of wires only.
The internal connections of the E32 breakout board are a little bit more complex for which I have added a separate circuit diagram.
The most important connection to be made is of the M1 and M0 pins. They need to be connected to either GND or VCC for the operation of the module and cannot be left floating. We will learn more about the different mode selection using M1 and M0 in the next step.
Lastly, I have also attached a couple of LEDs on the Rx and Tx pins so that when data transmission is happening over UART it's visible on the LEDs.
Changing the voltage of the pins M1 and M0 different modes of the module can be set.
We can see the different modes on the above table.
I mostly focus on the Mode 0 and Mode 3. For normal LoRa use, I keep the module on Mode 0 and for configuration, I keep it on Mode 3.
For this project, we will keep both the pins to 0, i.e Mode 0.
I designed a PCB using the above circuit diagram and got it manufactured.
The PCB has headers for the ESP32, E32 and OLED display modules.
There are also some basic components apart from that.
I have also broken out some extra GPIO pins of the ESP32 on the PCB for the possibility of expansion of the project.
So I soldered the components on the PCB and programmed the ESP32 in the next step.
4. Navigate to Tools > Board. Select the appropriate board that you are using, Firebeetle ESP32 in my case.
5. Select the correct comm. port by going to Tools > Port.
6. Hit the upload button.
7. When the tab says Done Uploading you will see the OLED display spring up to life.
I connected the ESP32 PCB to power using micro USB.
For the other side of the LoRa link, I used the breakout module from the previous tutorial which I connected using an FTDI module to a PC and set the mode switch of M0 and M1 to 0 & 0.
Then started sending data over UART to the module connected to the PC and observed that the OLED started showing the data received over LoRa after that ESP32 sends an acknowledgement message back which we see on the serial monitor. Watch my video for the same demo.