Lora E32+arduino nano, Not receiving any message
10 months ago
Thank you very much for your library and tutorial. I'm using two Arduino nano and Lora E32 to send and receive. both have same connection:
Lora module: E32-TTL-1W
Arduino: Nano 3
GND -> G
VCC -> 3V3
AUX ->D5
TX->D2
RX->D3
M1->D6
M0->D7
sender code:
LoRa_E32 e32ttl(2, 3, 5, 7, 6);
void setup() {
Serial.begin(9600);
while (!Serial) {
;
}
delay(500);
e32ttl.begin();
ResponseStructContainer c;
c = e32ttl.getConfiguration();
Configuration configuration = *(Configuration*) c.data;
Serial.println(c.status.getResponseDescription());
Serial.println(c.status.code);
// configuration.ADDL = 0x01;
// configuration.ADDH = 0x00;
// configuration.CHAN = 0x02;
// configuration.OPTION.fixedTransmission = FT_FIXED_TRANSMISSION;
// e32ttl.setConfiguration(configuration, WRITE_CFG_PWR_DWN_SAVE);
printParameters(configuration);
c.close();
}
void loop() {
delay(5000);
Serial.println("Send message to 03 00 04");
ResponseStatus rs = e32ttl.sendFixedMessage(0, 3, 0x04, "Message to 00 03 04 device");
Serial.println(rs.getResponseDescription());
}
receiver code:
LoRa_E32 e32ttl(2, 3, 5, 7, 6);
void setup() {
Serial.begin(9600);
while (!Serial) {
;
}
delay(500);
e32ttl.begin();
ResponseStructContainer c;
c = e32ttl.getConfiguration();
Configuration configuration = *(Configuration*) c.data;
Serial.println(c.status.getResponseDescription());
Serial.println(c.status.code);
// configuration.ADDL = 0x03;
// configuration.ADDH = 0x00;
// configuration.CHAN = 0x04;
// configuration.OPTION.fixedTransmission = FT_FIXED_TRANSMISSION;
// e32ttl.setConfiguration(configuration, WRITE_CFG_PWR_DWN_SAVE);
printParameters(configuration);
c.close();
}
void loop() {
if (e32ttl.available() > 1){
Serial.println("GOT message");
ResponseContainer rs = e32ttl.receiveMessage();
String message = rs.data;
Serial.println(rs.status.getResponseDescription());
Serial.println(message);
}
}
I got "Success" on my sender side. but the receiver is not receiving any message, it is not going inside the condition: if (e32ttl.available() > 1){}. Can you check my code and connections please Mr.Mischianti