Splitting up data & minimizing packet header cost

@Reuben @Erik have a GPS that is sending information in a batch, when everything is connected fine it sends a batch of locations at about 1000 bytes (1kb). Sometimes when the Celluar network is not available the data get larger than that. The docs say that the maximum data size is 4096 bytes (4kb) and when I have sent bigger it seems to send but it truncates the message on the server. I am pulling the information from an SD Card and sending them.

I am trying to see if there is a way to both break up the message into smaller blocks but keep the packet overhead low.

  • Can i open a TCP connection and then send a number of messages and then close it?
  • What is the easiest way to modify the code to send smaller chunks?

Here is my code, I basically open a file of the GPS locations and write everything to hologram cloud, and then delete the file and start over again.

pendingGPSData = SD.open("waitlog.txt");
while (pendingGPSData.available()) {

Any suggestions on the best way to handle this issue?