Esp32 CAM sending image buffer over TCP

FrankIQ
Posts: 5
Joined: Tue Jun 18, 2019 8:31 pm

Esp32 CAM sending image buffer over TCP

Postby FrankIQ » Tue Jul 16, 2019 10:59 pm

Hi, i'm sending the picture's buffer rgb888 format via regular TCP connection with the client, using client.print or client.write , but the streaming is too slow. i'm getting the data by 4kbs . Is there any way to get the data faster in the client ?


void sendData()
{

for (int i = 0; i < out_len ; i++)
{
client.print(out_buf [i]);
//client.write(out_buf [i]);
}

}

Thank you.
Frank

User avatar
HermannSW
Posts: 97
Joined: Fri Oct 27, 2017 6:58 am
Location: Eberbach, Germany
Contact:

Re: Esp32 CAM sending image buffer over TCP

Postby HermannSW » Wed Jul 17, 2019 1:28 pm

CameraWebServer app_httpd.cpp does send the whole framebuffer.
Add serial monitor output like below and enable output of timestamps in console.
Then you can measure what speed that method of framebuffer transfer does:

Code: Select all

            Serial.println("Camera capture send before");
            res = httpd_resp_send(req, (const char *)fb->buf, fb->len);
            Serial.println("Camera capture send after");
You can add an external Wifi antenna (bottom right), it greatly improved connectivity for one of my ESP32-CAM modules that was not near the router.
Hermann.

P.S:
No need for the Serial prints, normal "Get Still" output reveils time (including small time for getting framebuffer from ov2640):

Code: Select all

16:03:30.423 -> JPG: 22793B 335ms
16:03:32.648 -> JPG: 22777B 220ms
16:03:33.942 -> JPG: 21681B 171ms
Much faster than 4KBps:

Code: Select all

22793/0.335 = 68038.8
22777/0.220 = 103531.8
21681/0.171 = 126789.5
Image

User avatar
HermannSW
Posts: 97
Joined: Fri Oct 27, 2017 6:58 am
Location: Eberbach, Germany
Contact:

Re: Esp32 CAM sending image buffer over TCP

Postby HermannSW » Wed Jul 17, 2019 2:36 pm

The Serial prints are useful with Serial monitor timestamps:

Code: Select all

16:16:08.410 -> Camera capture send before
16:16:08.444 -> Camera capture send after
16:16:08.444 -> JPG: 22291B 174ms
16:16:09.973 -> Camera capture send before
16:16:10.007 -> Camera capture send after
16:16:10.007 -> JPG: 21786B 127ms


Pure http transfer is MUCH faster, 640KBps

Code: Select all

22291/0.034 = 655617.6
21768/0.034 = 640235.3

Who is online

Users browsing this forum: No registered users and 98 guests