I've hooked up a TTL camera to a Yun, reading the images using Software Serial. It takes 13-14 seconds to read a ~48Kbyte image. It seems the maximum reliable read of the camera image is 32 bytes at a time.
I want to store the image onto the SD card of the Yun. If I write each 32 byte chunk using FileIO.write() the total time to read the image and write it to the card is nearly 50 seconds. Simple commenting out the call to write() yields the 13 seconds time for basic reading of the image.
I added some buffering in the Arduino sketch so that it calls write() less often. If I chose a large buffer, performance actually got much worse. Choosing a small buffer resulted in minimal performance improvement.
Based on my image capture code that runs on Yun Linux side I know the SD card is not that slow (e.g. mjpg_streamer writes ~4 images per second to the SD card). What causes this bottle neck? Is it something in the Bridge code that implements FileIO? Is there any way to dramatically improve the performance?
Thanks for any insight or help.
Bridge uses a protocol to talk to the linux side that has 1 important characteristic: packets (or chunks of information) are small, because otherwise the sketch could go out of memory
I suggest you to keep things on the linux side: have the sketch to only tell the linux side to take a picture, have the linux side deal with the camera and saving that picture
Thanks, given the Arduino's limited memory I assumed the Bridge had to rely on a small packet size.
For USB cameras I do use the Linux side but I am not sure how to interface with this TTL camera from Linux (it comes with an Arduino library). I did a quick search and didn't find a solution for the OpenWRT distribution. I'll keep looking and in the mean time live with the slow performance.
Sorry, didn't realize it wasn't a webcam. Then I think Bridge is the only way
I haven't experimented enough yet, but I think it could be faster to write those little buffers to Serial1 and have a linino process do the file xfer.
@roadfun, any particular reason you have to use TTL camera other than USB camera?
The TTL camera has several features I have not found in a USB cam. Mainly it has IR emitters and a night mode on the camera and it also has built in motion detection. It is more suitable as a security camera.
Night vision USB camera;-

$9.99, Amazon, free 2 days shipping.
Built in motion detection;- Very interesting, would you mind to share the URL of TTL camera?
Is the one you posted compatible with Linux? I can't find it on the list of compatible cameras. Also, according to a number of viewers it is not an IR camera but instead uses white lights for night time...
The heart of your camera is DSP VC0706 ( 2007, a little out of dated ) from vimicro.com.cn (Vimicro International Corporation).

The one I posted believe or not is also use vimicro chip set (might be 301P) but not VC0706. if I were you I will call them directly or drop a line for help.
http://www.vimicro.com.cn
B.T.W. https://www.adafruit.com/ offer very nice support as well worth to try.