I've done a decent amount of development on sending/receiving Lora messages on the Particle Platform. @chipmc can offer some advice as well. Here is an in depth lengthy topic covering a lot of considerations:
You are using the RadioHead library correct? What class level of the radiohead library are you using? Reliable Datagram?
If so, for consideration per RadioHead documentation:
Caution: if you are using slow packet rates and long packets with RHReliableDatagram or subclasses you may need to change the RHReliableDatagram timeout for reliable operations. Caution: for some slow rates nad with ReliableDatagrams you may need to increase the reply timeout with manager.setTimeout() to deal with the long transmission times.
I wonder if the GPS data is pushing you over the edge causing the LoRa Radio to timeout.
I'd try:
- Only send GPS data and see if you can reliably et GPS data send over LoRa without every single time when the extra baggage of sensor data is removed. This will confirm you are obtaining GPS data correctly and sending it correctly.
- Can you do a serial.Print of the full JSON Package you are sending before it's being sent. Just to make sure it's valid/good data. If you can share here that might help us identify something.
- General advice, IMHO, LoRa is not intended for full Strings of data like you have. Rather, I'd consider boiling your data down to only what is required and pack it into bytes of data. When I send data over LoRa I use the following format
1 byte: Date Type
2 Bytes: Value
In your case, assign the following bytes to each data type. Instead of sending over the entire string of "Temperature". Simply send over the value 2 followed by 2 bytes containing the value of temperature or maybe temperature X10.
Pitch = 1
Temperature = 2
Pressure = 3
Roll = 4
Long = 5
Lat = 6
etc.
Then your LoRa message is something like this:
buf[0-4] reserved for Device ID and other info.
buf[5] = 1;
buf[6] = highByte(Pitch);
buf[7] = lowByte(Pitch);
buf[8] = 2;
buf[9] = highByte(Temperature);
buf[10] = lowByte(Temperature);
buf[11] = 3;
buf[12] = highByte(Pressure);
buf[13] = lowByte(Pressure);
....
This will VASTLY decrease your message size, allow the message to be sent quickly with less time on air, less power, and avoid any timeouts. You can pack a lot more data using this approach than sending full strings. Just for consideration.
Also, curios, what's your use case for LoRa? Low cellular signal strength in an area? Concentration of sensors in an area? Something else?