I was wondering what the difference between the commands KTCPSTART and KTCPSND is.
Other than the fact that you can tell the module exactly how many bytes you want to send with KTCPSND,
I can’t see any difference.
However, KTCPSND returns more often the NO_CARRIER reply when large amounts of data (>20kB) are being sent which take more time for the module to receive via UART.
Is there a reason for this?
Can I use the two commands interchangeably?
My scheme as it is now consists of: AT+KTCPCNX and then AT+KTCPSND
Can I replace KTCPSND with KTCPSTART with no troubles?
After a bit of research, I realized that the module is dropping the TCP connection when sending large amounts of data with both KTCPSTART and KTCPSND after getting the NO CARRIER reply.
I can see the data being received with Wireshark on the PC side and then i get the no carrier and connection is dropped. Is there some sort of timeout occurring ?
I am using UART with hardware flow control. Data are 26kB so it takes quite a bit for the module to send all of it…
Here’s the Mosquitto MQTT broker side:
1646235359: Received PUBLISH from aseru (d0, q0, r0, m0, ‘3546xxxxxx258xx’, … (26010 bytes))
1646235359: Client aseru closed its connection.
So the module sometimes sends the PUBLISH message but it doesn’t return OK. It returns NO CARRIER and then any subsequent try to send anything fails.
When the payload is large the module needs time to send it all, it returns NO CARRIER and connection is down.
I still think it might be some sort of a timeout occurring inside the module. Network is not dropped in CEREG.
At least the module does not give any indication (after at+cereg=1).
Edit:
From Wireshark I can see that whenever the NO CARRIER reply occurs, there is a “TCP Previous segment not captured” message which would indicate packet loss?
However, sometimes I receive the PUBLISH message even though the “TCP Previous segment not captured” message appears…