Adafruit TTL VC0706 camera with Electron

Anyone had experience with hooking up the Adafruit TTL Serial VC0706 camera? The examples I have found use libraries <camera_VC0706.h> and
<SoftwareSerial.h> . Neither of those libraries seem to work with the particle electron. I tried to substitute <ParticleSoftSerial.h> but still run into incompatible or missing calls in <camera_VC0706>.
Any hints on how to make this work?
thanks, john

This is a rather poor “port” (can’t really call it that at all IMO) of an Arduino library.
In order to make it work, you’d need to download the library sources via particle library view camera_VC0706, add new files to your Web IDE project, name them accordingly and copy the .h and .cpp files from the downloaded sources into your project.
Then you can replace all occurrences of SoftwareSerial with Serial1 (you won’t need ParticleSoftSerial when you use one of the HW interfaces present on the Electron) and repair any other errors you’ll find.

I did a quick’n’dirty “repair” here (it still throws a ton of warnings tho’)
https://go.particle.io/shared_apps/5fc2049ae6f0b000092cb085
(this link will be invalidated in a few days)

Wow. Thanks ScruffR. I compiled what you posted and no errors. So your quick’n’dirty looks mighty good to me.
I’m working on adding a camera to my “Spudnik” water monitoring project (early version at Water Monitoring in cold, remote locations with a solar Electron) and storing images on a SD. I go the SD working well and it backs up all my water quality data in case it doesn’t get uploaded to UbiDots. I hope to take a photo twice daily, store on the SD, and offload the SD to a laptop when I make a visit to the Spudnik once a year. I had given up muddling out how to use the VC0706 routines but will go back now and make another try.
Thanks for the help with this.

1 Like

With the help of ScruffR I got the VC0706 TTL camera from Adafruit running with an electron and storing the images to a SD card. There is a lot of compression of the images which is good for transmitting them over the network but I just want to store them to a SD card and would like better quality.
I’ve tried to use the setCompression() and getCompression() functions from the camera_VC0706 library. I get reasonable numbers from the getCompression() function but the camera seems unresponsive to the set command. I’m not sure exactly how to use the function:


boolean camera_VC0706::setCompression(uint8_t c) {
    uint8_t args[] = {0x5, 0x1, 0x1, 0x12, 0x04, c};
    return runCommand(VC0706_WRITE_DATA, args, sizeof(args), 5); }

Any thoughts on what I should be passing to that function? Thanks, john

Unfortunately this library is not too intuitive and doesn’t care about type safety.
Otherwise they would have created enums for the respective parameters per function to ensure only allowed values can be passed.

For this function you can select one 0, 1 or 2 (default is 0).

Here you can find some more info about the individual settings

1 Like