Hello, anyone dealing with Shield was performing checking of the data it receives? In my project I have 3 bytes corrupt per 128 KBytes W5100 receives. In case of data it is serious problem, but in case of executable code transfers (I do it) it is fatal.
If you did not do checks just perform 16-bit checksum on incoming data, see and report here.
Thank you.
SurferTim:
What are you doing with the download? Are you storing it on a SD card?
I store data in RAM.
SurferTim:
Maybe posting you test code would help.
Here I need to tell a little about my project. I am making network card for MSX machine, which has Z80 processor, and I am developing firmware using assembler. Source code is about 200KB in size, but I can explain algorithm I use. However I tried with interrupts, without interrupts, and some other different things - in general I was rewriting TCP/HTTP receiving code 4 times - and I get same issue in the middle of long data stream.
However, the question was not about my implementation, but about YOUR implementation. If you would say that you transfer 128 KBytes or 1 MByte or whatever of non-text data (=binary data with bytes value ranging from 00h to FFh) with no data loss I will keep searching for bugs in my implementation.
That is easy. I don't download executables. I have downloaded jpg images, but never used a checksum.
edit: So you are just downloading the executable code without storing it anywhere? Are you trying to tell me you are storing 200KB in RAM? Which Arduino are you using for that?
SurferTim:
That is easy. I don't download executables. I have downloaded jpg images, but never used a checksum.
edit: So you are just downloading the executable code without storing it anywhere? Are you trying to tell me you are storing 200KB in RAM? Which Arduino are you using for that?
SurferTim:
but never used a checksum
Good occasion to check.
SurferTim:
So you are just downloading the executable code without storing it anywhere?
I transfer it to RAM, and check data in RAM. There's extremely low probability that something wrong happens on the back between W5100 buffers and RAM - and that was already checked several times.
SurferTim:
Are you trying to tell me you are storing 200KB in RAM?
No, 128K of downloaded executable code.
SurferTim:
Which Arduino are you using for that?
I do not use Arduino at all.
The point is to find out if Arduino Shield, being based on the same W5100 chip, exhibits same issues as my card.
My code will not help you. You will spend much more time digging into it (if you will ever want doing it) than for thing I would like to ask you do it.
I ask you, please take you Arduino, and download file http://www.gr8bit.ru/roms/games/vkiller.rom using it, then calculate 16-bit checksum on file you received. Correct checksum is 05E11h.
If you happen to have and agree to use Excel, here's http://www.gr8bit.ru/roms/games/CRC16-vkiller.xlsm which calculates checksum, you only need to set path to file with trailing slash in cell A1.
Thank you. I will sort it out, earlier or later, with help of community of without it. At this point I ask community to help itself spotting probable serious issue. If I am wrong with it and having bug in my design, well, those do not make mistakes who do nothing, and I hope you will forgive me. But if I am right and there's product issue...
Transferred it up from the FTP server to my SD card using binary mode. Arrived on SD with file size 232,998 bytes.
Transferred it from the SD card to the FTP server using binary mode. Arrived on FTP server with file size 232,998 bytes.
Used both cmp and diff command line utilities to check the binaries, and both programs reported NO DIFFERENCE in the original and uploaded/downloaded files.
edit: Is that good enough, or do you have another test you want me to run?
Eugeny:
Thank you so much. To have clean result - can you try on my image in HTTP mode? Please.
What image?
edit: Used my new web server sketch from the playground. http://playground.arduino.cc/Code/WebServerST
Used the same file I uploaded with the FTP code. Used a web browser to download the image from the SD card. Saved the image on my hard drive. Used cmp and diff to check, and to no surprise, both found NO DIFFERENCE in the original and downloaded files.
Please compare the one you download using Arduino, and the one which you transfer using other platform (e.g. Windows-based PC using Chrome's download). Our goal is to figure out if data transferred through W5100 is the same as transferred using other vehicles. Correct checksum for the image is 5E11.
You will need to put that in a downloadable file type. It prints a bunch of garbage with my web browser.
edit: If you transfer that file in ascii mode, you will get transfer differences. I just tested that with my jpg image. If I transfer it in ascii mode, all kinds of difference in the files.
SurferTim:
That file download is only 193 bytes. Is that correct?
This a.html is a file for you to open in browser and right click on it to save because really for .rom type chrome and IE display them directly as garbage without even asking to save.
SurferTim:
edit: Give me a few minutes to respond. I'm going to walk to the beach and check the surf.
I will have problems with that file. It is being ascii translated by your server. Do me a favor and change the file extension to jpg. If you rename it "a.jpg", the web server will not do an ascii translation.