@anon57585045 suggested why not send raw (digital) float values instead of converting it to a string, that you later have to parse
have a look at decimals-strings-and-lora where raw binary data is transmitted from slave nodes to a master node as structures (containing floats, ints, characters, etc)
what Arduino and lora module are you using?
I'm using Arduino 2.0.3. the LoRa is Ra-02. The reason going to a string or a struct is because there will be data from multiple sensors. As soon as I've got the ultrasonic sesnsor working as the "x" component, I'll add the voltage sensor as a "y". If we sent multiple raw data to the receiver then it would have to be unpacked and processed there. I think just trading one set of problems for another. I think if it were a good solution , I'd have seen examples of it, but in several years on this, I never have.
I couldn't find anything online about the benefit of doing it one way or the other, so I asked my "friend" (artificial Intelligence at chatGPT for an opinion....
If you are using multiple sensors and storing the data in a structure, it's a good idea to process the data before transmitting it. This will allow you to combine the data from multiple sensors into a single structure and perform any necessary data validation or correction. Processing the data before transmitting it can also help to reduce the amount of data that needs to be transmitted, which can help to conserve battery power and reduce transmission costs.
Additionally, by processing the data before it is transmitted, you can also combine the data from multiple sensors in a way that makes it more useful for your application. For example, you can calculate derived values or perform data analysis that combines data from multiple sensors.
You may also want to consider adding some error checking and handling routines to your code, to detect and handle any errors that may occur during the data processing. This will help to ensure that the data transmitted is accurate and reliable.
Overall, processing the data before transmitting it can help to improve the accuracy of the sensor readings, reduce errors in the data and make the data more useful for your application.
He makes some good points..... Love that new program.
the structures suggested contain a sequence number to check for lost or duplicate packets
LoRa does error check so if packets are received they should be OK
however, you could add a CRC check to the structure for extra error checking
another thought: by converting data to text, e.g. "X: 35.3 Y: 44 Z:10.5"` you could be loosing precision - transferring binary avoids this
However, one has to take care if the transmitter and receiver are different processors in case word lengths or endianness is different
One issue to be aware of is that if you are receiveing stuff like sensor data then you need to be sure that the packet received really is one of yours, i.e. one that you intended to receive. There could be packets from other LoRa transmitters or the ocaisional phantom packet that the LoRa recever can generate internally. These rogue packets need to be ignored.