Publish Compressed JPEG Camera Image to the cloud

I would like to transmit the camera images through Spark Cloud, where the image can be retrieved directly through the cloud. Something similar to retrieving variables from the cloud.

Anyone could advise me how to do it?

Integrating a camera with the Spark has been discussed a few times. These may help get you started:

1 Like

Hi @leeway - the Cloud is not designed for high-bandwidth activities such as transmitting images, audio, and video. If you would like to transmit a picture, you should open a TCP socket and transmit the picture through the standard HTTP mechanisms for uploading and downloading assets.

I am interested in this feature as well. I had no success with JPEG camera and OLED display on local connection. Communication using TCP is slow and when using UDP it flooded the core and it was disconnected from the cloud (even if I had local connection setup from the documentation). My Spark Core is in a box with dust falling on it and I’m waiting when the team will fix the errors, so I can use the full 76 MHz speed of ARM for OLED display and JPEG camera operations without reseting the core or having to fork my own firmware as this would get me incompatible with future fixes (I don’t want to solve manual conflicts in git).

Is the only limitation the cloud service?
Ie. The core itself would have no problem dealing with the image?

I have try to set up TCP connection to transmit JPEG data through port 80.

TCPServer camServer =  TCPServer(80);    //initiate a server on port 80 http
TCPClient client;
byte transfImage[8];

Inside setup function as I only code for the device to run once.

if (client.connected()) {
        if(client.available()){
            for(i=0;i<8;i++){
                camServer.write(transfImage,8);
            }
        }
    }
    else {
        // if no client is yet connected, check for a new connection
        client = camServer.available();
    }

When I use my browser to connect to the core IP address, it does not connect at all.