0

I'm going to use that module for internet connection and to send data to a server. https://www.waveshare.com/wiki/SIM7020E_NB-IoT_HAT My question is I know that TCP stack only supports max of 1200 bytes to be sent to the server. How do you guys over come that limitation.

The problem is I'm sending a JSON which is more than 1KByte and The server expects a Full Json without chunked ones.

andre
  • 177
  • 1
  • 6
  • 2
    Send multiple packets ? – Eugene Sh. Oct 23 '19 at 17:02
  • @EugeneSh. How can I make sure that they are combined into one JSON string. I have to send a full JSON string to the server, otherwise it won't be processed by the server correctly. – andre Oct 23 '19 at 17:06
  • This is up to your server. Looks like you are confusing between different link layers. – Eugene Sh. Oct 23 '19 at 17:07
  • Send it using POST rather than GET. – Transistor Oct 23 '19 at 17:11
  • @EugeneSh. I can't control the server at all – andre Oct 23 '19 at 17:14
  • @Transistor This is what I am talking about... You are assuming HTTP protocol – Eugene Sh. Oct 23 '19 at 17:15
  • @Transistor I'm going to POST the data, but does it handle more than 1k bytes ? Another question, how about that data, does UART of STM32F chunks the data into it's FIFO and sends it ? – andre Oct 23 '19 at 17:15
  • Any HTTP request is split into as many multiple TCP packets as it needs to be. And it is governed by the HTTP link layer. So it is really not clear from your question - are you using HTTP? Do you have the layer implemented? – Eugene Sh. Oct 23 '19 at 17:24

1 Answers1

0

HTTP is layered on top of TCP. TCP is a connection-oriented protocol — you establish a connection, you send data through that connection, and then you break the connection. Once the connection is established, you can send as many bytes of data as you like, using multiple AT+CSOSEND=0,0,"...." commands if necessary. The underlying TCP protocol will make sure that the stream comes out the far end in the same order that you put it in at your end.

You don't need to worry about the maximum packet size (MTU in IP-speak) at all. The lower level layers in the protocol stack hide that detail from the upper layers.

Dave Tweed
  • 168,369
  • 17
  • 228
  • 393