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 GPIO | Connected to ESP32 | Description |
---|---|---|
GPIO14 (TXD) | GPIO26 (RX) | RPi TX ➜ ESP32 RX |
GPIO15 (RXD) | GPIO27 (TX) | RPi RX ⬅ ESP32 TX |
GND | GND | Common ground |
SoftwareSerial
on ESP32 pins 26 (RX) and 27 (TX).B. ESP32 ↔ LoRa Module (SPI Communication)
LoRa Module | ESP32 GPIO | Function |
---|---|---|
MOSI | GPIO23 | Master Out Slave In |
MISO | GPIO19 | Master In Slave Out |
SCK | GPIO18 | SPI Clock |
NSS (CS) | GPIO5 | Chip Select |
RST | GPIO16 | Reset Pin |
DIO0 | GPIO17 | Interrupt / Ready |
GND | GND | Common Ground |
VCC | 3.3V | Power Supply |
LoRa.setPins(5, 16, 17)
.
Comments
Post a Comment