horotho

I've been trying to get the camera to work for awhile now, and it just isn't having it.I'll post my code and the responses I've been getting, and we'll see if anyone has any input.

I'm using the JPEGCamera library, which I've slightly modified to work with Software Serial, and added a few functions to set the baud rate and change the camera picture size. The code for the library will be posted below as well.

Currently, the camera is correctly set to take pictures that are 160x120, and the baudrate is set for 38400.

All attempts to change the baud rate have ended in miserable failure, even after multiple power cycling on the camera, and changing the code to work with a new baud rate.

I would have posted using the normal code format, but the post was too long.

The problem I've been having is the transmission speed, and the fact that I'm getting an incorrect response from the camera when I send the read data command.The camera takes probably 10 minutes to transmit a 3.8k file to the arduino, which I believe is an indication that something is wrong.

I have read about Serial latency issues on Arduino, and I downloaded the changed rxtxSerial.dll, but that has changed nothing so far.

I'll post the responses I've been getting and debugging data shortly.

So, the responses for the reset, take picture, and getsize command all come in alright.Then, as soon as I start requesting data, the 5 bytes before the colon should be 76 00 32 00 00, every single time, if I'm not mistaken.

Have you tried the sketch on the linksprite website? Using that (under windows) I can get a picture that makes sense. I can see from the data that you posted that the camera isn't giving a valid jpeg (it should start ff d8...).

I used to have this "banding" effect when there were transmission errors: too high baudrate with software serial, or also when I was not transferring correctly the picture; in order to do it correctly you must read and store in RAM a chunk (size is not critical, but IIRC it must be a multiple of 8 bytes). Then you transfer the whole chunk. In brief do not read on serial one byte and write it directly, it seems to confuse the hardware.You can have a loook at how it is done in my library.HTH

lufamseed

Thanks for the responses. I am using 32 bytes for one "chunk" in reading from LS-Y201 TTL camera, and writing into an SD card, and yet still receiving the "banding" bars on every photo. I am also trying to use your code, but failed in compiling process. Could you please forward your libraries, and advise where shall I place these libraries? Thanks.

Regards,Terry.

lufamseed

However, may I ask how long it takes to complete a 640x480 picture transmission in your code? My program will take about 60 seconds to complete the whole transmission and the size is around 100K bytes.

Hmm, I think a 640x480 is more or less 40kB for me; so it takes around 9-10s to upload it to the arduino using a baudrate of 38400.But then you also need to tranfer it (either to sd or via a serial interface to a PC or ...).

Im struggeling with this camera (LSY201 from Linksprite) and have a really hard time finding a single library with example sketches that will compile properly. They fail both in the v.1.0 of Arduino as well as the new one. Did anyone actually got this working properly in the end? If so, it would be of great help if you could share your library for it and perhaps an example sketch of how to save a picture to SD card. Im useing SD card shield from seeedstudio on Arduino Uno rev.3. I'm hoping to make a time lapse in the end.