LoRa E45-TTL-100与Arduino通信故障求助:发送无接收反馈
Hey there! Let's work through this LoRa E45-TTL issue step by step—since you're new to LoRa, it's almost certainly a configuration or connection detail you're missing. Here's what to check and fix:
1. First: Verify Hardware Connections
LoRa modules rely on proper serial wiring and power to communicate. Double-check these:
- Cross the TX/RX pins: Arduino's TX pin connects to the E45-TTL's RX pin, and Arduino's RX connects to E45-TTL's TX. If you wire them straight (TX-TX, RX-RX), no data will pass through.
- Power matching: The E45-TTL typically supports 3.3V-5V input, but confirm your module's specs. Use a stable power supply (avoid powering it only through Arduino's 5V pin if you're using other components—voltage drops can break communication).
- Common ground: Make sure the Arduino and E45-TTL share the same GND connection. No common ground = no reliable serial communication.
2. Critical: Configure Both LoRa Modules to Match
Right now, you're sending data over serial, but the E45-TTL modules need identical radio parameters to talk to each other. Without this, even if serial works, the radio won't transmit/receive properly.
How to configure with AT commands:
- Connect one module to your Arduino (use SoftwareSerial if you don't want to block the USB serial port for debugging).
- Open the Arduino Serial Monitor, set baud rate to 9600, and set line ending to
Newline. - Send these commands (both modules need the exact same settings):
AT→ Should returnOK(confirms serial communication with the module works)AT+FREQ=433000000→ Sets radio frequency to 433MHz (adjust to your region's allowed frequency)AT+UART=9600,8,1,0,0→ Matches your code's 9600 baud rate, 8 data bits, 1 stop bit, no parityAT+ADDR=1000→ Sets a unique address (both modules must use the same value)AT+CHAN=5→ Sets radio channel (same on both ends)AT+SAVE→ Saves settings to the module's flash (so they persist after power cycle)
Repeat this for the receiving module—all parameters must match exactly.
3. Fix Your Transmitter Code
Your current code uses the Arduino's hardware Serial, which is tied to the USB port. If you're using hardware Serial for the LoRa module, you'll run into upload issues (since the USB serial uses the same pins). Instead, use SoftwareSerial to dedicate separate pins to the LoRa module:
#include <SoftwareSerial.h> // Assign pins 2 (RX) and 3 (TX) to the LoRa module SoftwareSerial loraSerial(2, 3); void setup() { // Serial for debugging to your computer Serial.begin(9600); // Serial communication with LoRa module (matches AT command UART setting) loraSerial.begin(9600); } void loop() { // Send your data string to the LoRa module loraSerial.print("000106,supun"); // Debug message to confirm data was sent Serial.println("Data sent to LoRa module"); delay(2000); }
4. Complete Your Receiver Code
Your receiver code was cut off—here's a full working version that reads data from the LoRa module and prints it to your computer's serial monitor:
#include <SoftwareSerial.h> SoftwareSerial loraSerial(2, 3); // RX = pin 2 (connects to LoRa TX), TX = pin3 (connects to LoRa RX) void setup() { Serial.begin(9600); // For debugging to computer loraSerial.begin(9600); // Match LoRa module's UART baud rate } void loop() { // Check if data is available from the LoRa module if (loraSerial.available() > 0) { // Read until newline (adjust if your data uses a different terminator) String receivedData = loraSerial.readStringUntil('\n'); // Print received data to computer Serial.println("Received: " + receivedData); } }
5. Debugging Steps to Verify
- Test serial communication first: Send
ATcommands to each module individually to confirm they respond withOK. If not, fix your wiring or baud rate. - Test transmitter alone: Use the debug
Serial.printlnto confirm the transmitter code is running and sending data. - Test receiver with a serial tool: Disconnect the receiver's Arduino, connect the LoRa module directly to your computer via a USB-TTL adapter, and use a serial monitor to send data. If the module receives it, your radio settings are correct.
内容的提问来源于stack exchange,提问作者Supun Senanayake

