Hi guys, i have a “problem”; i need to parse and split a lora packet received;
can you explane me how it could be done?
i have 2 things (one that sends and one that receives)
First thing send this packet by Lora protocol
//Send LoRa packet to receiver
LoRa.beginPacket();
LoRa.println(lum); //by analog sensor
LoRa.print("Lat: ");
LoRa.println(gps.location.lat(), 6);
LoRa.print("Lon: ");
LoRa.println(gps.location.lng(), 6);
LoRa.print("Sat: ");
LoRa.println(gps.satellites.value());
LoRa.print("Alt: ");
LoRa.println(gps.altitude.feet() / 3.2808);
LoRa.endPacket();
receiver thing have this code:
// read packet
while (LoRa.available()) {
LoRaData = LoRa.readString();
Serial.print(LoRaData); //print all packet in serial
}
in serial output i receive “LoRaData” packet;
output is :
12:54:40.749 -> Packet : 2064
12:54:40.782 -> Lat: 10.727223
12:54:40.782 -> Lon: 1.565544
12:54:40.782 -> Sat: 5
12:54:40.782 -> Alt: 235.30
how to split in a variables the packet?
i tried this but it doesn’t work:
double Lat = (gps.location.lat(), 6);
thank you