I am trying to communicate using LoRa modules with an ESP32. I can easly communicate with two LoRa modules, but if I want to learn the sender address, the Arduino returns an undefined character. I am using an E70 433nw30s and it has a document for reading and sending a struct like this:
I am using 2 for OUTPUT format which is data + short addres
I am sending this data for testing:
Node 2 deger 222.
as HEX:
4E 6F 64 65 20 32 20 20 64 65 67 65 72 20 32 32 32 2E
Receiving this data, it has a tail which is the adress of sender, like this:
4E 6F 64 65 20 32 20 20 64 65 67 65 72 20 32 32 32 2E 0D 0A 00 04
The adress of sender is 00 04
and 0A
is new line, 0D
actually I don't know. The Arduino serial monitor returns undefined characters to the address of the sender.
Output:
12:33:50.084 -> Node 2 deger 222.
12:33:50.084 -> Node 2 deger 222.
12:33:52.916 -> Node 2 deger 222.
12:33:56.073 -> Node 2 deger 222.
How can I properly read the sender address with data?
I am receving this data with this simple code:
HardwareSerial fixajSerial(1);
void setup() {
Serial.begin(115200);
fixajSerial.begin(115200, SERIAL_8N1, TX, RX);
}
void loop() {
if (Serial.available()) {
fixajSerial.write(Serial.read());
}
while (fixajSerial.available()) {
Serial.write(fixajSerial.read());
}
}
This is the output with external program: