Raspberry pi to Raspberry pi LoRa sx1278 communication Via Arduino Esp32 Serial communication

Data Flow-    
RPI -> <- ESP32(Arduino) -> <- LoRa SX1278 -> -----<- LoRa SX1278-> <- ESP32(Arduino) -> <-RPI





1. Enable Serial port with command- sudo raspi-config
     Interface Options → Serial Port → Enable
                       → Serial Login shell → Disable
     Login shell over serial? → No
     Enable serial port hardware? → Yes
     Command- sudo reboot




2. command- pip install pyserial  (if Needed)
3. port command- ls -l /dev/serial* /dev/ttyS* /dev/ttyAMA*
4.  Connection and Circuit diagram-

A. ESP32 ↔ Raspberry Pi (UART Communication)

Raspberry Pi GPIOConnected to ESP32Description
GPIO14 (TXD)GPIO26 (RX)RPi TX ➜ ESP32 RX
GPIO15 (RXD)GPIO27 (TX)RPi RX ⬅ ESP32 TX
GNDGNDCommon ground
✅ You are using SoftwareSerial on ESP32 pins 26 (RX) and 27 (TX).

B. ESP32 ↔ LoRa Module (SPI Communication)

LoRa ModuleESP32 GPIOFunction
MOSIGPIO23Master Out Slave In
MISOGPIO19Master In Slave Out
SCKGPIO18SPI Clock
NSS (CS)GPIO5Chip Select
RSTGPIO16Reset Pin
DIO0GPIO17Interrupt / Ready
GNDGNDCommon Ground
VCC3.3VPower Supply
✅ SPI communication is used for LoRa with LoRa.setPins(5, 16, 17).






   C. Connection Video- https://youtu.be/ZOXh5LQkJ4g?si=__kA2VGI2zA4Z-yJ



 



Comments