• AVR Freaks

Hot!Big Webpages not displayed correctly

Author
LehoRe
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2019/05/14 07:20:39
  • Location: 0
  • Status: offline
2019/05/15 05:19:07 (permalink)
0

Big Webpages not displayed correctly

Hi to all!
 
I came across the following problem during develloping my own software:
As soon as webpages becomes larger than about 52k, some parts are not displayed correctly.
 
So first of all i reproduced it on my demo HW / demo SW:
I tookt the Curiosity PIC32MZ EF Board and loaded the 'wifi_easy_configuration' demo project. Didn't change a line of code. But in the 'webpages/images' directory copied the 'harmony.gif' 14 times and renamed the copies to 'h1.gif' - 'h14.gif', then copied the 'mchp.gif' 4 times and renamed them th 'mchp1.gif' - 'mchp4.gif'. Then edited the index.htm so that all of these images are displayed.
Compiled and ran the program on the board. In principle the webpage is displayed but only 2 of the 5 'mchp.gif' are displayed correctly. One of them only half and 2 are not displayed at all.
It's always the same - those files that are added last in the MPFS are not displayed correctly...
 
I'm not sure if the error lies in the MPFS utility or in the software framework. It might be a gzip problem or alingment problem???
 
Harmony Version is v2_05_01
XC32 Version is 1.44
MPFS-Utility Version is 2.34 from 14.July.2017 
 
Did anybody face the same problem? Is there any solution to it?
many thanks 
R.L.
#1

3 Replies Related Threads

    rainad
    Moderator
    • Total Posts : 1177
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: online
    Re: Big Webpages not displayed correctly 2019/05/15 11:10:02 (permalink)
    0
    One thing you can try is to just download that big file and see if the server sends that correctly to your browser.
    Try something like: http/mchpboard_c/mybigfile.txt or similar.
    Then compare that file to a master copy of your file on the PC, or check sizes, etc.
    This will tell if there's something with the parsing of the pages, or the compression, etc. 
    Try with compressed/not compressed file.
    If that works fine, it may be the way that the MPFS generated those web pages.
    People have been reporting that there are collisions in the generated hashes, etc.
    One way to fix that is to switch to the new HTTP_NET which does not have these issues.
     
    #2
    LehoRe
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2019/05/14 07:20:39
    • Location: 0
    • Status: offline
    Re: Big Webpages not displayed correctly 2019/05/21 04:18:37 (permalink)
    0
    Dear rainad!
     
    Many thanks for your quick reply!!!
    What I did in the meantime:
    - First I switched to HTTP NET, what seems to be a good choice anyhow. Now the webserver is running much faster and smoother, but the problem with images not displayed stays.
    - Then I switched off the compression for .gif files -> so the images are not compressed, but still only one of 3 is displayed correctly.
    - Next I sniffed the TCP streams with wireshark. Just loaded the correct image and traced the data, then did the same with the incorrect image. Comparing the data I found out, that the size is the same (ok) and 60% of the data are the same too, just the first 40% of the image data look different.
    - Now I looked at the 'mpfs_img.c' file and found out that the images are stored correctly in this file (3 times the same).
     
    So to summarize:
    - MPFS Utility seems to be working correctly
    - HTTP NET does exactly what it should do
    - problem could be either mpfs.c or the NVM module???
    (the webpage is stored in PIC32 internally, NVM Media Start Adress is 0x9D000000, NVM Media Size is 256)
     
    Have you got any new ideas for me???
    kind regards
    R.L.
    #3
    rainad
    Moderator
    • Total Posts : 1177
    • Reward points : 0
    • Joined: 2009/05/01 13:39:25
    • Location: 0
    • Status: online
    Re: Big Webpages not displayed correctly 2019/05/21 07:22:45 (permalink)
    0
    You can do a quick test to completely take the TCP/IP stack out of the picture: just read the offending file in a test app, in a loop, and calculate the CRC of the data. Compare at the end with the known CRC - which you can do on the same file on your PC.
    Or open a TCP socket and transmit the file to your PC and do the calculations there.
     
    That would clearly point to either the NVM or MPFS. I doubt that the flash is programmed incorrectly. You can turn on the verification when you program your application. Maybe its the MPFS image that's generated incorrectly - although that should have been found by now by other users...
    Does this happen only for image files? Can you do a test with text files, etc.?
     
     
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5