Site icon Renzo Mischianti

Mega 2560 e32 EByte frozen in example sendReceiveTransparentTransmissionMessage

I have tried the example of transparent transmission between two modules. One has this example program that I attached and is configured and wired as shown in the readme of the library and the other is simply connected in transparent mode to the USB port of my PC. The two E32 modules are connected to arduino mega 2560. In the code example that I have passed you, the arduino is frozen in the code line: Serial.println (rs.getResponseDescription ()); If I comment on this line, the program continues and freezes again on this line. ResponseContainer rc = e32ttl100.receiveMessage (); I don't know if you can give me a hand, because I'm sure I have something wrong but I don't know where to take it. Regards, and thank you very much.
#include "Arduino.h"
#include "LoRa_E32.h"

SoftwareSerial mySerial(11, 10);
LoRa_E32 e32ttl100(&mySerial,5, 7, 6);

void setup() {
Serial.begin(9600);
delay(500);

// Startup all pins and UART
e32ttl100.begin();

Serial.println("Hi, I'm going to send message!");
// Send message
ResponseStatus rs = e32ttl100.sendMessage("Hello, world?"); // OK The message is received on the other device
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
}

void loop() {
// If something available
Serial.println("continuity test point"); //This instruction is not executed unless you comment on the previous line "Serial.println(rs.getResponseDescription());"
if (e32ttl100.available()>1) {
ResponseContainer rc = e32ttl100.receiveMessage();
Serial.println(rc.data);
// Is something goes wrong print error
if (rc.status.code!=1){
rc.status.getResponseDescription();
}else{
// Print the data received
Serial.println(rc.data);
}
}
if (Serial.available()) {
String input = Serial.readString();
e32ttl100.sendMessage(input);
}
}
Exit mobile version