Hello again Axel,
On 3/2/2017 10:11 AM, Axel Lin wrote:
HTTP uses TCP so whatever happens you shouldn't have a size mismatch.
I was thinking the same thing. If you get to the end of the HTTP download
with a file, then the network communications via TCP is (probably) not
responsible for the corrupt file. That implies that your app that collects
the pieces of the file from the network and writes them down may have a
problem instead.
Add to that the fact that the transfer takes a lot longer when the file is
corrupt, and knowing that LwIP has rules about what can be called when and
in which context, it seems probable that your app's use of LwIP is not quite
right and causing the network errors that are resulting in the problems
you're seeing.
The problem is I don't get any error code while download the file.
Only compare the download size then I know it's incorrect.
(and sometimes it's correct)
If I had to guess, it would appear your app is having concurrency issues
where the rules about calling various routines from different contexts
are being violated? Kind of like race conditions within and around the
LwIP stack? It's just a guess, but I would totally debug your app and
the rules of which calls can be made from which contexts?
Do you have a packet trace of the HTTP download? That will likely have
clues about what's going on
Regarding "packet trace of the HTTP download" do you mean wireshark log?
I don't know how to capture the packet sent/received via LTE.
Or do you mean get the packet trace by enable some debug options?
Well, some kind of packet trace is best, but I haven't used PPP with
LwIP enough to know what options are available and useful? An external
serial line monitor would be nice (if you have access to the serial
stream between your processor and your LTE device?). If nothing else,
could you dump out the serial bytes in each packet in a text file? (Of
course, just adding code to your app to dump the packets as they come
and go could change the timing enough to cause different behavior,
making it even harder to debug)
Patrick
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users