VC0706 camera and CC3000 wifi uploading problems

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
RookieNo14
 
Posts: 4
Joined: Tue Apr 15, 2014 4:05 pm

VC0706 camera and CC3000 wifi uploading problems

Post by RookieNo14 »

Hi,

Hi,

I'm doing a project of taking photos and uploading to web server. I used Adafruit TTL Serial Camera (VC0706) and successfully connected to web server via HTTP.
The saving approach is to use multipart/form-data and transfer binary data to web server. The problem is: the photos saved are either of bad quality or completely broken, the photo I attached here is the best one I got.

Does anyone know any possible causes of this problems? How to solve the problem?

The code clip is the photo saving.

Code: Select all


uint16_t jpglen = cam.frameLength();

Adafruit_CC3000_Client client = cc3000.connectTCP(ip, port);
  
  // Connect to the server, please change your IP address !
  if (client.connected()) {
      Serial.println(F("Connected !"));
      client.println(F("POST /camera.php HTTP/1.1"));
      client.println(F("Host: 192.121.3.100:80"));
      client.println(F("Content-Type: multipart/form-data; boundary=AaB03x"));
      client.print(F("Content-Length: "));
      client.println(len);
      client.print(start_request);//Some start request for multipart/form-data uploading scheme
            
      // Read all the data up to # bytes!
      byte wCount = 0; // For counting # of writes
      while (jpglen > 0) {
        
        uint8_t *buffer;
        uint8_t bytesToRead = min(32, jpglen); // change 32 to 64 for a speedup but may not work with all setups!
        
        buffer = cam.readPicture(bytesToRead);
        client.write(buffer, bytesToRead);
    
        if(++wCount >= 64) { // Every 2K, give a little feedback so it doesn't appear locked up
          Serial.print('.');
          wCount = 0;
        }
        jpglen -= bytesToRead; 
      }
      
      client.print(end_request);
      client.println();
      
  Serial.println("Transmission over");
  } 
client.close();
Attachments
CAM.JPG
CAM.JPG (12.39 KiB) Viewed 960 times

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: VC0706 camera and CC3000 wifi uploading problems

Post by adafruit_support_mike »

Those are bit-error artifacts.

Check your webserver's error logs and see if it reports any problems with the uploads.

User avatar
lina944
 
Posts: 6
Joined: Fri Nov 30, 2012 10:22 pm

Re: VC0706 camera and CC3000 wifi uploading problems

Post by lina944 »

Can you post the server code?

User avatar
alangoh84
 
Posts: 8
Joined: Wed Nov 05, 2014 6:24 am

Re: VC0706 camera and CC3000 wifi uploading problems

Post by alangoh84 »

well unless you are able to write a checker code to inform your webstorage that they have receive correctly
else this camera cant do what you want because
1) transmitter does not do parity check
2) receiving end does not understand the transmitter except that it is saving a file to it.

this is why protocol are created to ensure reliability.

there is a way but its not worth to work.
0) save photo in sd card
1) create a transmission with output encapsulation with a check bit (lets say 01 mean no error and 10 mean error( you define them))
2) make a code that let you send out start bit to acknowledge sending of files ( lets call it 10001 hence whenever 10001 is sent out your receiving end will start accepting data and compare) you will need a clock to ensure synchronization
3) send photo data over
4) end with a 01 which denote no error

5) receiver start receive data when detected 10001 and whenever clock is high
6) receiver remove 10001 and accept data
7) receiver check last 2 bit if it is 10 or 01
8) receiver decide to recall the photo or decide to save
9) if decide to recall, send back a nack with 1010 or 0101 ( your call to code nack)
10) transmitter upon received ack or nack decide next step if it need to resend or done.

hence this above you need 2 circuit.
I did this for my FYP using PIC. its a pain in the ass work.

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

Return to “Other Arduino products from Adafruit”