BC68 using TCP to download a file

Hi,

I am trying to download a file from http server through TCP using BC68 module.
Enabling socket was OK (AT+NSOCR=STREAM,6,0,1,AF_INET), connection was OK (AT+NSOCO=,), sending the HTTP GET request over as a TCP command was also OK (AT+NSOSD=) and the packets started coming.
However after the few initial packets (2 to 9, each is maximum allowed size) the connection freezes. Everything received by the module is forwarded directly to microcontroller unit and I also query the socket just in case (AT+NSORF=). Connection stays open (socket is open and when trying to reconnect using the same data sequence the result is “525: AT command aborted: in processing”). There are no problems when using different devices to download same thing from the server.
Can this be caused by some sort of buffer overflow from the module side (does not send ACK back to server) or is there a possibility to send ACK to server as a TCP command?
Thanks advance for the support and any kind of ideas.

With kind regards,
Jaan

hi,Jaan:
You are great! I think you have a very deep understanding of the socket;Socket is the interface of protocol scheduling resources. Socket can only be called once at the same time on the one device and wait for protocol stack processing (or module processing). If the protocol stack is not processed quickly, other socket schedulers will queue up.Therefore, the module will return “in processing”, but it will not affect the socket scheduling of other devices.

Hi,

Thank you for your answer. Is there any other reason which can cause the “in processing” failure? I discarded the process for downloading one larger (approx 120kB) file and moved towards the idea that server divides the file into small junks of data and module has to ask each and every one individually. However, this idea provided no relief to the task: it didn’t matter if used the same socket for asking them or made new socket and connection for the each new request, in both cases the module got the first one and stayed “processing” it. Only way how I can download it, is that I have to reset the module after receiving each new packet. Thank you advance for any kind of suggestion.

With kind regards,
Jaan

Hi,

One solution that helped me to overcome this was to introduce bigger delay times between operations.
(socket open->TCP connect->TCP send command-> wait for incoming messages-> Receive command-> socket close-> wait 5 seconds and start all over again).

Jaan

oh,Your comments are great and thank you very much for sharing.