AI-on-the-edge-device icon indicating copy to clipboard operation
AI-on-the-edge-device copied to clipboard

Request the RAW photo via MQTT?

Open tc-maxx opened this issue 2 years ago • 4 comments

The Feature

Hi @all

Since my ESP in the garden is on a different network, I can't access the RAW photo with http://ip/img_tmp/alg.jpg. Would it be possible to request the RAW photo via MQTT?

Thanks very much

tc-maxx avatar Apr 19 '23 09:04 tc-maxx

MQTT only works with a sender and a receiver. Unlike with REST you can not request data, you only can wait until it gets sent.

Also, MQTT is not really made for large data, and a raw image is around 70 KB, so IMO far to large for MQTT.

To get the image you need an active component in that subnet to fetch it from the device. But if you don't need the image itself, MQTT or InfluxDB will do the job.

caco3 avatar Apr 19 '23 18:04 caco3

i second this, i currently have a script that pulls the image after each received MQTT raw value. this often fails and i get partial images etc. and i really like the idea of isolating the networks i have used a few other systems that send images via MQTT, it could be set as an option in the config just send it each read just like any other value.. Blue Iris uses base64 encoding to transmit images, others like Vorloncd just send the jpeg. either would work for my use case, also the size of the images for my security cameras is significantly more than the esp32-cam

Hootie81 avatar May 28 '23 06:05 Hootie81

i get partial images

maybe you are to late. you could try to respond to the status topic when tge alignment is done.

send images via MQTT

The problem is the memory usage. I don't think we could give the MQTT stack enough memory to hold an image.

caco3 avatar May 28 '23 12:05 caco3

If you go to /capture or /capture_with_flashlight you can get the raw image directly from the camera. The only thing you have to be aware of is that the image can be dark. This is because when the program tries to capture an image less then the number of seconds specified in the WaitBeforeTakingPicture setting before you request a captue it will turn the flashlight off before your request has finished.

wilfredktlr avatar Jun 23 '23 19:06 wilfredktlr