Announcement

Collapse
No announcement yet.

uCam II - Verify Code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • uCam II - Verify Code

    Hi,

    I have been making a solar powered webcam / weather station and am using the uCAM II as the webcam - so far I am very impressed indeed.

    I have started off using the library provided by Dgtmoon - It's been a fantastic start and I am very thankful that the code was provided on the forum. I have made a number of changes - mainly to enable the use of multiple hardware serial buses on the mega and to facilitate multiple cameras in one project. That all seems to be fine and working.

    I am considering implementing a checksum validation as that is not included in the library - this is to detect bad transfers as I seem to be getting the occasional bad image. Speed is not important in my project, as the webcam sleeps for 15 minutes between photos anyway. I would much rather ensure that the pictures are 100% intact and waste an extra few seconds checking the data. However, I am sightly confused about how the commands for packages are processed.

    In the data-sheet it looks like the packages are pushed to the host - however, in the code it appears the packages are requested. Can you confirm which of these is correct.

    If I request a package and the validation code suggests the package is corrupt, can I just request the same package again?

    For example (very rough sudo):

    DO
    ISSUE ACK FOR PACKAGE
    READ PACKAGE CONTENTS
    CALCULATE CHECKSUM
    WHILE (!CHECKSUM CORRECT)
    WRITE TO SD CARD
    PACKAGE++

    All I am doing to checking the verify code before saving it down to the SD but this would require me being able to request the same package again.

    Thanks for any advice!

    Tim


  • #2
    It's really a matter of how you think about it as to whether it is requested or pushed.

    But in answer to your question, no you cannot request a corrupted package be retransmitted. (Due to the way the camera internally manages it's memory, this is not feasible)

    Since speed is not that important, you can probably just request the entire image be resent.
    Mark

    Comment


    • #3
      Thanks for the quick response - much appreciated.

      I have implemented the checksum code and left the system running. So far I have yet to have a corrupt package so I suspect it's a fairly moot point. Turns out the issues I was having with corruption were actually the SD board I was using. As soon as I changed that the images are all saving perfectly every time. However, it is nice to have the checksum anyway as another layer of error checking.

      Thanks again for the quick response.

      Comment

      Working...
      X