TTL Camera - Corrupted Image Files

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Finnius
 
Posts: 19
Joined: Mon Jul 28, 2014 6:11 am

TTL Camera - Corrupted Image Files

Post by Finnius »

Hey folks,
I am trying to get the snapshot example sketch working with the TTL serial camera and an Arduino uno.
The cardinfo sketch shows the sd card and partition fine.
The snapshot sketch says it finds camera, then takes photo and takes a few seconds to save it.
However 9/10 times the images saved on the SD card are corrupted/incomplete. Only twice has it successfully saved the images - and both times nothing different (wiring, pinouts etc) was changed.
I was under the impression that the example snapshot sketch was updated to use 32 bit chunks instead of 64 which was at first causing the issue – so this shouldn't still be the problem?
Any ideas would be appreciated,
Thanks

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: TTL Camera - Corrupted Image Files

Post by adafruit_support_bill »

Smaller data blocks makes it less susceptible (but not completely immune) to data dropouts due to noise or intermittent connections. Post a photo of how you have it all connected.

Finnius
 
Posts: 19
Joined: Mon Jul 28, 2014 6:11 am

Re: TTL Camera - Corrupted Image Files

Post by Finnius »

I suspect that wires that are too long between the Arduino and SD card reader could be causing this?

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: TTL Camera - Corrupted Image Files

Post by adafruit_support_bill »

Hard to say without seeing it. But long jumpers do tend to be more susceptible to noise.

Finnius
 
Posts: 19
Joined: Mon Jul 28, 2014 6:11 am

Re: TTL Camera - Corrupted Image Files

Post by Finnius »

Yeah, i am using standard dupont cables - so they are approx 20cm i guess.

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: TTL Camera - Corrupted Image Files

Post by adafruit_support_bill »

In ideal conditions, 20cm should be workable. But breadboarded circuits are seldom ideal. There are so many opportunities for signal degradation and noise.

Make sure that all your jumper pins are firmly gripped by the spring contacts. Sometimes on well-used boards, it helps to move the circuit to a different section of the breadboard.

Finnius
 
Posts: 19
Joined: Mon Jul 28, 2014 6:11 am

Re: TTL Camera - Corrupted Image Files

Post by Finnius »

Thanks for the info. It is a relatively new breadboard and connections seem tight. What troubles me is that it worked fine for two photos, in amongst many photos that did not work.

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: TTL Camera - Corrupted Image Files

Post by adafruit_support_bill »

What troubles me is that it worked fine for two photos, in amongst many photos that did not work.
That is consistent with one or more intermittent connections or noise. If you post a photo of your setup we'll look for any potential problem spots.

Finnius
 
Posts: 19
Joined: Mon Jul 28, 2014 6:11 am

Re: TTL Camera - Corrupted Image Files

Post by Finnius »

Hi,
I have shortened the SD card reader wires, but i still get corrupted image files (images appear as blank).
I have attached some images of the wiring.
I really need to get this camera working soon.
Thanks
IMG_4118.JPG
IMG_4118.JPG (382.01 KiB) Viewed 761 times
IMG_4119.JPG
IMG_4119.JPG (183.36 KiB) Viewed 761 times

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: TTL Camera - Corrupted Image Files

Post by adafruit_support_bill »

Watch out for those wire-splices. They look awfully close together and in danger of shorting out.

We need to figure out if the data corruption is happening on the camera side or the SD card side. Have you tested the camera using the COMM Tool? https://learn.adafruit.com/ttl-serial-c ... -comm-tool

Finnius
 
Posts: 19
Joined: Mon Jul 28, 2014 6:11 am

Re: TTL Camera - Corrupted Image Files

Post by Finnius »

Yeah i know about the splices - don't worry i wont finish the project with them like that! Just temporary to test with the wires shorter.
I guess i will have to dig out my usb to ftdi converter and try comm tool. Will post back...

Finnius
 
Posts: 19
Joined: Mon Jul 28, 2014 6:11 am

Re: TTL Camera - Corrupted Image Files

Post by Finnius »

I have tried using commtool.
The camera seems to work fine, taking snapshots and reading the images off to save them.
So the problem must be when the arduino tries to save the photos on the sd card.
Any thoughts?

Finnius
 
Posts: 19
Joined: Mon Jul 28, 2014 6:11 am

Re: TTL Camera - Corrupted Image Files

Post by Finnius »

I re-soldered the connections on the camera and it appears to be much more reliable now.
Could you tell me whats the best way to call a photo to be taken by modifying the example sketch provided.
I guess it would need to be in the loop section of the program if if i want each time an event occurs to take a photo?
If i call "cam.takePicture" does that take a photo?

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: TTL Camera - Corrupted Image Files

Post by adafruit_support_bill »

cam.takePicture() is the call to take a photo. You would put that into your event loop.

Finnius
 
Posts: 19
Joined: Mon Jul 28, 2014 6:11 am

Re: TTL Camera - Corrupted Image Files

Post by Finnius »

Ok, thanks.
But i would need all the other functions after it as well in the event loop? Such as create image, name image, open sd card, close sd card write etc?

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”