How to split a Lora packet received?

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

That looks like Sandeeps point to point LoRa library for Arduino ?

If it is then the members of the TTN forum might not be familiar with that library as its not used for or supported by TTN …

1 Like

I’m using following libraries :

#include <SPI.h>
#include <LoRa.h>
#include <TinyGPS++.h>

Thank you

Also, even though point-to-point LoRa is not supported on this LoRaWAN forum (for which devices send their data to gateways, not to other devices), you’re using the same shared radio spectrum as other LoRa users. So, please do not send text as that needs too much air time. Best practices to limit application payloads might help.

Then best to ask for support in a forum more likley to have general support for Arduino stuff.