SerialTransfer library to communicate between the ESP8266 and Mega2560

I use the SerialTransfer library to communicate the ESP8266 and Mega2560 in the RobotDyn development board. ESP8266 generates a weather forecast request from the OpenWeatherMap server, analyzes the response and generates a string variable for transmission to the Mega2560 and then for display in the Nextion display.
An example of a line with a forecast for a day after three hours:
"<50.4500,29.9667, Kolonshchyna, UA, 10800.1587437607.1587488623,
1587459600,03d.png, 28,9.3,1022,45,4.1,356,
1587470400,04d.png, 64,10.6,1023,43,5.3,341,
1587481200,10d.png, 99,9.7,1022,47,5.7,346,
1587492000,04n.png, 71,5.4,1022,63,3.6,333,
1587502800,01n.png, 2,3.5,1023,72,3.0,332,
1587513600,01n.png, 10,2.6,1023,77,3.1,317,
1587524400,04d.png, 76,2.6,1023,77,3.5,308,
1587535200,04d.png, 65,6.9,1022,61,5.2,342> "
The string is about 400 characters long.
The limit in the library on the length of the sent string is 254 characters. The remaining characters are lost.
Help in solving this problem. It may be to split the string into two parts or not parse JSON in ESP8266 and forward structures.
Sorry for the grammatical errors. English is not my native language.

Split from an old thread

Your best bet is to do something similar to what this person did to transfer 24K-byte images with the lib. How it ended up working is that the data was sent in small, numbered, chunks (structs to be exact) that were then reassembled on the receiving Arduino.

What you could do is create a struct like the following:

struct weather_meta_data{
  uint16_t numPackets; //number of packets for a complete transmission
  uint16_t counter; //packet identifier
  uint16_t dataSize; //number of chars total in complete transmission (~400 for your example)
  uint16_t sizeThisPacket; //number of chars contained in current packet
} WeatherMetaData;

And then send that struct plus as many chars as you can stuff in each packet. This means the maximum number of chars of true data you can send per packet = 254 - sizeof(WeatherMetaData) = 254 - 8 = 246. That means you will need to send around 2 packets in total.

Remember to use “.txObj()” and “.rxObj()” for easy object transfer.