# Detecting objects using ESP32 CAM and NODE RED

**URL:** <https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165>\
**Category:** General\
**Created:** [15 June 2021 09:48 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165 "2021-06-15T09:48:36Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [19 June 2021 05:38 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/21 "2021-06-19T05:38:20Z")

</div>

Nice layout!! But with stills??

_EDIT (I think the media node can only play video from file, not directly from a stream)_

Yes multi-client streaming perfect, I took the rtos version, you see that camera view in the largest frame above, garden view through the window

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [19 June 2021 06:06 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/22 "2021-06-19T06:06:21Z")

</div>

What did you do to get the streaming working??

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [19 June 2021 06:21 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/23 "2021-06-19T06:21:55Z")

</div>

Here's my experimental layout if you want to try it out - stills only and no functionality apart from 'Reset'.  
I'll swap-over to using ui-template widgets later.

```auto
[{"id":"f42487a46c15b4bc","type":"ui_media","z":"e3edce5949dd214c","group":"0fd7d08c9c61cb70","name":"Monitor-A","width":"4","height":"3","order":1,"category":"","file":"","layout":"expand","showcontrols":false,"loop":false,"onstart":false,"scope":"local","tooltip":"","x":540,"y":280,"wires":[[]]},{"id":"0bde7fd67bf84512","type":"change","z":"e3edce5949dd214c","name":"","rules":[{"t":"set","p":"src","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":280,"wires":[["f42487a46c15b4bc"]]},{"id":"84306e2beb523ddb","type":"ui_dropdown","z":"e3edce5949dd214c","name":"","label":"","tooltip":"","place":"","group":"0fd7d08c9c61cb70","order":2,"width":0,"height":0,"passthru":true,"multiple":false,"options":[],"payload":"","topic":"","topicType":"str","x":140,"y":280,"wires":[["0bde7fd67bf84512"]]},{"id":"6f297ec336220e0d","type":"ui_media","z":"e3edce5949dd214c","group":"a6e187f499fb6408","name":"Monitor-B","width":"4","height":"3","order":1,"category":"","file":"","layout":"expand","showcontrols":false,"loop":false,"onstart":false,"scope":"local","tooltip":"","x":540,"y":360,"wires":[[]]},{"id":"a8da97f98572b392","type":"change","z":"e3edce5949dd214c","name":"","rules":[{"t":"set","p":"src","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":360,"wires":[["6f297ec336220e0d"]]},{"id":"05ae905980360849","type":"ui_template","z":"e3edce5949dd214c","group":"26d627a10c738a5d","name":"Limit screen width to 800 pix so the windows line up","order":2,"width":0,"height":0,"format":"<style>\n .masonry-container {\n width: 800px;\n }\n</style>\n\n<style>\n button {\n text-transform: none !important;\n }\n</style>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":230,"y":40,"wires":[[]]},{"id":"5ecaf347a8c0233d","type":"ui_media","z":"e3edce5949dd214c","group":"26d627a10c738a5d","name":"Main Display","width":"10","height":"8","order":1,"category":"","file":"","layout":"expand","showcontrols":false,"loop":false,"onstart":false,"scope":"local","tooltip":"","x":550,"y":460,"wires":[[]]},{"id":"81e95b14d7afc75f","type":"change","z":"e3edce5949dd214c","name":"","rules":[{"t":"set","p":"src","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":460,"wires":[["5ecaf347a8c0233d"]]},{"id":"90dc5c9e9d023d83","type":"comment","z":"e3edce5949dd214c","name":"Trial layout using ui-media nodes","info":"","x":970,"y":440,"wires":[]},{"id":"a33fb56c42bf8ae5","type":"inject","z":"e3edce5949dd214c","name":"Put spash image on all windows","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"3","topic":"","payload":"1","payloadType":"num","x":190,"y":80,"wires":[[]]},{"id":"dedb0d776d785d1c","type":"ui_button","z":"e3edce5949dd214c","name":"","group":"5b61ab19ec9e9093","order":1,"width":"2","height":"1","passthru":false,"label":"Reset system","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"num","topic":"topic","topicType":"msg","x":160,"y":580,"wires":[["c99ace32f85caf74"]]},{"id":"6f9b06df8634ceba","type":"ui_button","z":"e3edce5949dd214c","name":"","group":"5b61ab19ec9e9093","order":4,"width":"2","height":"1","passthru":false,"label":"Record","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":680,"y":580,"wires":[[]]},{"id":"4453c206d091e053","type":"ui_button","z":"e3edce5949dd214c","name":"","group":"5b61ab19ec9e9093","order":5,"width":"2","height":"1","passthru":false,"label":"Snapshot","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":840,"y":580,"wires":[[]]},{"id":"318b802b74bcec9d","type":"ui_button","z":"e3edce5949dd214c","name":"","group":"5b61ab19ec9e9093","order":6,"width":"2","height":"1","passthru":false,"label":"Telegram","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":1000,"y":580,"wires":[[]]},{"id":"a5f7bbd1f6dd99a9","type":"ui_button","z":"e3edce5949dd214c","name":"","group":"5b61ab19ec9e9093","order":7,"width":"2","height":"1","passthru":false,"label":"Email","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":1150,"y":580,"wires":[[]]},{"id":"935a935976fdbc76","type":"ui_dropdown","z":"e3edce5949dd214c","name":"","label":"","tooltip":"","place":"","group":"a6e187f499fb6408","order":2,"width":0,"height":0,"passthru":true,"multiple":false,"options":[],"payload":"","topic":"","topicType":"str","x":140,"y":360,"wires":[["a8da97f98572b392"]]},{"id":"e145a683bd7d2216","type":"ui_dropdown","z":"e3edce5949dd214c","name":"","label":"","tooltip":"","place":"","group":"26d627a10c738a5d","order":2,"width":0,"height":0,"passthru":true,"multiple":false,"options":[],"payload":"","topic":"","topicType":"str","x":140,"y":460,"wires":[["81e95b14d7afc75f"]]},{"id":"c99ace32f85caf74","type":"change","z":"e3edce5949dd214c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"http://resources-area.co.uk/pics_of_places/begin.jpg","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":180,"wires":[["0bde7fd67bf84512","a8da97f98572b392","81e95b14d7afc75f"]]},{"id":"bd4faca6a4bc0729","type":"ui_button","z":"e3edce5949dd214c","name":"","group":"5b61ab19ec9e9093","order":2,"width":"2","height":"1","passthru":false,"label":"Cycle","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":350,"y":580,"wires":[[]]},{"id":"f96c2d73a9568cc7","type":"ui_button","z":"e3edce5949dd214c","name":"","group":"5b61ab19ec9e9093","order":3,"width":"2","height":"1","passthru":false,"label":"- - spare - -","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":530,"y":580,"wires":[[]]},{"id":"4292aaa5d59344a9","type":"function","z":"e3edce5949dd214c","name":"Name / Value pairs to pre-populate the drop-down menu","func":"msg.payload = [\n { \"Camera-1\":\"http://resources-area.co.uk/pics_of_places/san_francisco.jpg\" },\n { \"Camera-2\": \"http://resources-area.co.uk/pics_of_places/castleton_castle.jpg\" },\n { \"Camera-3\": \"http://resources-area.co.uk/pics_of_places/castleton.jpg\" },\n { \"Camera-4\":\"http://resources-area.co.uk/pics_of_places/damgan.jpg\" }\n]\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":140,"wires":[["cb2b51b0.8fd79"]]},{"id":"cb2b51b0.8fd79","type":"change","z":"e3edce5949dd214c","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":140,"wires":[["84306e2beb523ddb","935a935976fdbc76","e145a683bd7d2216"]]},{"id":"b4a29e59090a9340","type":"ui_ui_control","z":"e3edce5949dd214c","name":"","events":"all","x":100,"y":140,"wires":[["c99ace32f85caf74","4292aaa5d59344a9"]]},{"id":"0fd7d08c9c61cb70","type":"ui_group","name":"Monitor-A","tab":"e1357e44f0a9abcf","order":1,"disp":true,"width":"4","collapse":false},{"id":"a6e187f499fb6408","type":"ui_group","name":"Monitor-B","tab":"e1357e44f0a9abcf","order":3,"disp":true,"width":"4","collapse":false},{"id":"26d627a10c738a5d","type":"ui_group","name":"Main Display Area","tab":"e1357e44f0a9abcf","order":2,"disp":true,"width":"10","collapse":false},{"id":"5b61ab19ec9e9093","type":"ui_group","name":"Controls","tab":"e1357e44f0a9abcf","order":4,"disp":false,"width":"14","collapse":false},{"id":"e1357e44f0a9abcf","type":"ui_tab","name":"Layout and navigation tests","icon":"dashboard","order":10,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [19 June 2021 06:44 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/24 "2021-06-19T06:44:29Z")

</div>

Hi Walter - to fix the layout issue, just increase the width to 900px in the 'template' node.  
 ![Screen Shot 06-19-21 at 07.41 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/2/725f2dc71dcb262c26af66939384e9b0ebf5399a.jpeg)

Walter - is this the version you used (that you have had success with) ??  
 ![Screen Shot 06-19-21 at 07.46 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/1/619e6cf9b65f1852d18c3a90fdb6ef7fac54d868.jpeg)  
I'll try it ASAP and see if it works for me.

EDIT:  
Yep tried that version and it does work across multiple windows - but very slowly.  
Only got one camera working, due to a slight technical problem - see below.

 ![Screen Shot 06-19-21 at 09.03 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/3/33e2decd1145934f64a1fab22a901f469ee64b14.jpeg)

EDIT:  
Just had a **major catastrophe**.......... micro USB socket has fallen off of daughter board.  
That will explain why the camera kept stop working the other day. Looking at it looks like a dry joint.

 ![major_catasrophe](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/f/dfb2c1d40ced1a8346b7ed4fb798d4ddd3dd4dd2.jpeg)

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [19 June 2021 08:13 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/25 "2021-06-19T08:13:35Z")

</div>

> [@dynamicdave](#):
>
> Walter - is this the version you used (that you have had success with) ??

Yes, I now have success with all versions, all are also very fast but I have the ESP32-EYE, don't know if that makes a difference (I bought them 2 years ago, then at 17 EUR each)  
What I did, I re-installed Arduino IDE and updated the board list with board manager. After that, it worked without problems. When I then tried to update to the latest drivers as described earlier, it did not compile, complaining about soc/\* files missing. But reverting back, everything now works perfect, even changed the resolution to get faster updates

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/a/9a179e4d3b28183cb42d5def0ef11868cb09c01c.jpeg)

[https://diyprojects.io/esp32-cam-which-model-choose-esp-eye-aithinker-ttgo-tcamera-m5stack/](https://diyprojects.io/esp32-cam-which-model-choose-esp-eye-aithinker-ttgo-tcamera-m5stack/)

> [@dynamicdave](#):
>
> Just had a **major catastrophe**

Ouch, bad luck, guess that could be the reason for bad performance etc

> [@dynamicdave](#):
>
> just increase the width to 900px

Thanks, will try that!!

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [19 June 2021 08:30 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/26 "2021-06-19T08:30:22Z")

</div>

Almost there, but still cam one and two are not in the left column, I have problems with the layout editor I guess, do you know??

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/6/46b0d67c0b1a14b3059cdac75c411cd65312edf6.jpeg)

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [19 June 2021 08:30 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/27 "2021-06-19T08:30:39Z")

</div>

Thanks for the update. I'll try doing a fresh install on another PC.  
My ESP32-CAM has a micro-SD card slot, but aprat from that looks very similar to the ESP-EYE.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [19 June 2021 08:33 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/28 "2021-06-19T08:33:55Z")

</div>

That's an easy one - just need to move things around in the Layout Editor.  
 ![Screen Shot 06-19-21 at 09.32 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/5/250612d39e334f586cc1117057272feddb7070c8.jpeg)

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [19 June 2021 08:36 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/29 "2021-06-19T08:36:45Z")

</div>

Thanks, got it now!!! All working well!

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [19 June 2021 08:39 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/30 "2021-06-19T08:39:23Z")

</div>

Hiss, boo - dead jealous. Only one camera working here, other one sitting on my desk in pieces.  
Next task is to contact Amazon for a replacement or a refund.

EDIT: My personal preference is to use the Dark Theme for the dashboard.  
Easier to read for my tired old eyes!!  
But again it's down to personal taste.

EDIT: The flow I posted above pre-populates the drop-down menus so is easier to manage.  
I need to put a fixed IP address in the sketch and multi-wifi details so it picks the strongest WiFi signal.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [19 June 2021 18:01 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/31 "2021-06-19T18:01:31Z")

</div>

Update to the Home Surveillance flow and dashboard layout using 'template' widgets.

```auto
[{"id":"1f25a30f35ee2aab","type":"comment","z":"773de2f199fc6dc7","name":"Start of a project to create a home surveillance system","info":"","x":740,"y":60,"wires":[]},{"id":"0b80df98cb437bf8","type":"ui_template","z":"773de2f199fc6dc7","group":"380498f.f287668","name":"View of a camera on the top panel","order":1,"width":4,"height":3,"format":"<!DOCTYPE html>\n<html>\n<style>\n img {\n border: 1px solid #ddd;\n border-radius: 8px;\n padding: 2px;\n width: 160px;\n }\n</style>\n\n<center>\n <table>\n <tr>\n <!-- Row 1 -->\n <td style=\"text-align: center\"><img src={{msg.payload}} /></td>\n </tr>\n </table>\n</center>\n</html>\n","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":760,"y":220,"wires":[[]]},{"id":"32cdbcf576a5b0b0","type":"ui_dropdown","z":"773de2f199fc6dc7","name":"","label":"","tooltip":"","place":"Select camera source>>","group":"380498f.f287668","order":2,"width":0,"height":0,"passthru":true,"multiple":false,"options":[],"payload":"","topic":"","topicType":"str","x":480,"y":220,"wires":[["0b80df98cb437bf8"]]},{"id":"296cc28892705a5a","type":"ui_template","z":"773de2f199fc6dc7","group":"885b473b9d25c85b","name":"View of a camera on the second panel","order":1,"width":4,"height":3,"format":"<!DOCTYPE html>\n<html>\n<style>\n img {\n border: 1px solid #ddd;\n border-radius: 8px;\n padding: 2px;\n width: 160px;\n }\n</style>\n\n<center>\n <table>\n <tr>\n <!-- Row 1 -->\n <td style=\"text-align: center\"><img src={{msg.payload}} /></td>\n </tr>\n </table>\n</center>\n</html>\n","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":770,"y":280,"wires":[[]]},{"id":"f72a3b5f93fc1a8c","type":"ui_dropdown","z":"773de2f199fc6dc7","name":"","label":"","tooltip":"","place":"Select camera source>>","group":"885b473b9d25c85b","order":2,"width":0,"height":0,"passthru":true,"multiple":false,"options":[],"payload":"","topic":"","topicType":"str","x":480,"y":280,"wires":[["296cc28892705a5a"]]},{"id":"a5387437bda6742b","type":"ui_dropdown","z":"773de2f199fc6dc7","name":"","label":"","tooltip":"","place":"Select camera source>>","group":"f32afdcff901090e","order":2,"width":0,"height":0,"passthru":true,"multiple":false,"options":[],"payload":"","topic":"","topicType":"str","x":480,"y":340,"wires":[["9aa0349346ecc9c3"]]},{"id":"9aa0349346ecc9c3","type":"ui_template","z":"773de2f199fc6dc7","group":"f32afdcff901090e","name":"Selected camera on the Main Display","order":1,"width":"12","height":"8","format":"<!DOCTYPE html>\n<html>\n<style>\n .img {\n border: 10px solid #ddd;\n border-radius: 8px;\n padding: 2px;\n width: 500px;\n }\n</style>\n\n<center>\n <table>\n <tr>\n <!-- Row 1 -->\n <td style=\"text-align: center\"><img src={{msg.payload}} class=img /></td>\n </tr>\n </table>\n</center>\n</html>\n","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":770,"y":340,"wires":[[]]},{"id":"60d76a88a635f4d8","type":"ui_template","z":"773de2f199fc6dc7","group":"f32afdcff901090e","name":"Limit screen width to 900 pix so the windows line up","order":3,"width":0,"height":0,"format":"<style>\n .masonry-container {\n width: 900px;\n }\n</style>\n\n<style>\n button {\n text-transform: none !important;\n }\n</style>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":250,"y":60,"wires":[[]]},{"id":"a9f2da73b78ef7c1","type":"function","z":"773de2f199fc6dc7","name":"Name / Value pairs to pre-populate the drop-down menu","func":"// Edit the following name/value pairs to match your camera streams\n\nmsg.payload = [\n { \"Camera-1\": \"http://192.168.1.223/mjpeg/1\" },\n { \"Camera-2\": \"http://resources-area.co.uk/pics_of_places/castleton_castle.jpg\" },\n { \"Camera-3\": \"http://resources-area.co.uk/pics_of_places/castleton.jpg\" },\n { \"Camera-4\": \"http://resources-area.co.uk/pics_of_places/damgan.jpg\" }\n]\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":120,"wires":[["ef64d347e73c3fdd"]]},{"id":"ef64d347e73c3fdd","type":"change","z":"773de2f199fc6dc7","name":"","rules":[{"t":"set","p":"options","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":120,"wires":[["32cdbcf576a5b0b0","f72a3b5f93fc1a8c","a5387437bda6742b"]]},{"id":"6184c3f7a1b135ac","type":"ui_ui_control","z":"773de2f199fc6dc7","name":"","events":"all","x":120,"y":120,"wires":[["a9f2da73b78ef7c1","42cab0ae95f5bdb5"]]},{"id":"42cab0ae95f5bdb5","type":"change","z":"773de2f199fc6dc7","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"http://resources-area.co.uk/pics_of_places/begin.jpg","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":320,"y":160,"wires":[["0b80df98cb437bf8","296cc28892705a5a","9aa0349346ecc9c3"]]},{"id":"1792148d015f332c","type":"ui_button","z":"773de2f199fc6dc7","name":"","group":"637196ccbe9d082b","order":2,"width":"2","height":"1","passthru":false,"label":"Cycle","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":270,"y":440,"wires":[[]]},{"id":"c8681bddf86cb6eb","type":"ui_button","z":"773de2f199fc6dc7","name":"","group":"637196ccbe9d082b","order":3,"width":"2","height":"1","passthru":false,"label":"- - spare - -","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":490,"y":440,"wires":[[]]},{"id":"e505ee27446c2919","type":"ui_button","z":"773de2f199fc6dc7","name":"","group":"637196ccbe9d082b","order":4,"width":"2","height":"1","passthru":false,"label":"Record","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":680,"y":440,"wires":[[]]},{"id":"c21831a352ed6f6e","type":"ui_button","z":"773de2f199fc6dc7","name":"","group":"637196ccbe9d082b","order":5,"width":"2","height":"1","passthru":false,"label":"Snapshot","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":860,"y":440,"wires":[[]]},{"id":"0536944625dcb1bc","type":"ui_button","z":"773de2f199fc6dc7","name":"","group":"637196ccbe9d082b","order":6,"width":"2","height":"1","passthru":false,"label":"Telegram","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":1040,"y":440,"wires":[[]]},{"id":"67ee4c2a509729c1","type":"ui_button","z":"773de2f199fc6dc7","name":"","group":"637196ccbe9d082b","order":7,"width":"2","height":"1","passthru":false,"label":"Email","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":1210,"y":440,"wires":[[]]},{"id":"515a587838e7eec1","type":"ui_button","z":"773de2f199fc6dc7","name":"","group":"637196ccbe9d082b","order":8,"width":"2","height":"1","passthru":false,"label":"- - spare - -","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":1390,"y":440,"wires":[[]]},{"id":"52870d936988b52f","type":"ui_button","z":"773de2f199fc6dc7","name":"","group":"637196ccbe9d082b","order":1,"width":"2","height":"1","passthru":false,"label":"Reset","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"topic","topicType":"msg","x":110,"y":440,"wires":[["42cab0ae95f5bdb5"]]},{"id":"380498f.f287668","type":"ui_group","name":"Monitor_A","tab":"73890071.f55b","order":1,"disp":true,"width":"4","collapse":false},{"id":"885b473b9d25c85b","type":"ui_group","name":"Monitor_B","tab":"73890071.f55b","order":3,"disp":true,"width":"4","collapse":false},{"id":"f32afdcff901090e","type":"ui_group","name":"Main_Display_Area","tab":"73890071.f55b","order":2,"disp":true,"width":"12","collapse":false},{"id":"637196ccbe9d082b","type":"ui_group","name":"Controls","tab":"73890071.f55b","order":4,"disp":false,"width":"16","collapse":false},{"id":"73890071.f55b","type":"ui_tab","name":"Home Surveillance System","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

```

 ![Screen Shot 06-19-21 at 07.27 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/4/84d582792063996c2ec5c52f0495301410125cb2.jpeg)

Sorry - only got a single camera operational and functionality is restricted to just 'Reset' for now.

---

<div class="post-metadata">

**Author:** ![moisesStevend](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/moisesstevend/32/43579_2.png) [@moisesStevend](https://discourse.nodered.org/u/moisesStevend)\
**Post date:** [20 June 2021 01:39 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/32 "2021-06-20T01:39:29Z")

</div>

Guys, I tried this project and It worked very well:

[![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/10d07e0363bc01942e56a5d86d92b5f529bdeb16.jpeg "ESP32-CAM Teachable Machine (Use custom model)") ](https://www.youtube.com/watch?v=Sn7AwpGFXLw)

Enjoy!

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [20 June 2021 05:57 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/33 "2021-06-20T05:57:30Z")

</div>

> [@dynamicdave](#):
>
> Update to the Home Surveillance flow and dashboard layout using 'template' widgets.

Working so good!!! Impressive

ESP-EYE in the main view

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/2/52152ecf59e794e6332274293217462fecc39a11.jpeg)

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [20 June 2021 08:49 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/34 "2021-06-20T08:49:07Z")

</div>

I really like your dashboard layout - so neat and tidy and ergomomically friendly (ha, ha, ha).

---

<div class="post-metadata">

**Author:** ![fatima1999](https://avatars.discourse-cdn.com/v4/letter/f/f6c823/32.png) [@fatima1999](https://discourse.nodered.org/u/fatima1999)\
**Post date:** [22 June 2021 13:29 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/35 "2021-06-22T13:29:30Z")

</div>

Error: read ECONNRESET

Guys do you know what cause this problem ? and how I can fix it ?

---

<div class="post-metadata">

**Author:** ![SuperNinja](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/superninja/32/5761_2.png) [@SuperNinja](https://discourse.nodered.org/u/SuperNinja)\
**Post date:** [22 June 2021 17:35 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/36 "2021-06-22T17:35:57Z")

</div>

So if I understood correctly: the esp32-cam cards stream the video in mjpeg on the network on an http address, and you connect to it to read it on the NR dashboard, which runs on an RPI?  
I am trying to make a comparison between esp32-cam VS RTSP camera .  
For example: with my RTSP cameras they consume 40KB/s at 7fps with 1 to 2% processor overload. How much for an esp32-cam?

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [23 June 2021 05:30 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/37 "2021-06-23T05:30:30Z")

</div>

> [@fatima1999](#):
>
> Error: read ECONNRESET

It is a connection error... a little Googleing should show it seems to refer to a TCP disconnection made at the receiving end of a network link you are trying to make.

I ran into that error (and others) quite a bit yesterday while trying to find properly working URL's for my various cameras, while working with my own version of this topic.

Exactly what caused the error depends on what network connections you are trying. You should be able to track that back to the "problem" node via debug

---

<div class="post-metadata">

**Author:** ![Gunner](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gunner/32/43582_2.png) [@Gunner](https://discourse.nodered.org/u/Gunner)\
**Post date:** [23 June 2021 05:37 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/38 "2021-06-23T05:37:07Z")

</div>

> [@Gunner](#):
>
> while working with my own version of this topic.

And on that note... thanks to this and a few other topics...

Currently showing the HKV camera clip

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/2/9253d6bca18a5604485d3f6efbdaf40611296563.jpeg)

The real tricky one was the Amcrest as it is an RTSP stream, and had to be converted to a JPG image before it would run the detection.

```auto
[{"id":"ca053924.d79bf8","type":"tab","label":"Image recognition","disabled":false,"info":""},{"id":"3e623d1a.c9fd42","type":"tensorflowCoco","z":"ca053924.d79bf8","name":"","modelUrl":"http://localhost:1880/coco/model.json","scoreThreshold":0.5,"passthru":"bbox","lineColour":"magenta","x":550,"y":220,"wires":[["14fa8ce2.fc7043","4ec7b21f.c2d45c"]]},{"id":"14fa8ce2.fc7043","type":"debug","z":"ca053924.d79bf8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"classes","targetType":"msg","x":930,"y":420,"wires":[]},{"id":"4ec7b21f.c2d45c","type":"image","z":"ca053924.d79bf8","name":"","width":"400","data":"image","dataType":"msg","thumbnail":false,"active":true,"pass":false,"outputs":0,"x":740,"y":420,"wires":[]},{"id":"50b7a139.6f5af","type":"http request","z":"ca053924.d79bf8","name":"HKV Camera","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://<USER>:<PASS>@<IP>:80/streaming/channels/102/picture","tls":"","persist":false,"proxy":"","authType":"","x":330,"y":140,"wires":[["3e623d1a.c9fd42","9577277d.344928"]]},{"id":"47dca3a.8151a5c","type":"inject","z":"ca053924.d79bf8","name":"HKV Camera","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":140,"wires":[["50b7a139.6f5af"]]},{"id":"fcc43d48.a0833","type":"http request","z":"ca053924.d79bf8","name":"ESP32CAM","method":"GET","ret":"bin","paytoqs":"ignore","url":"http://<IP>/capture","tls":"","persist":false,"proxy":"","authType":"","x":330,"y":200,"wires":[["3e623d1a.c9fd42","9577277d.344928"]]},{"id":"483ef59d.93c65c","type":"inject","z":"ca053924.d79bf8","name":"ESP32CAM","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":200,"wires":[["fcc43d48.a0833"]]},{"id":"5d13506d.27388","type":"inject","z":"ca053924.d79bf8","name":"Amcrest Camera","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":260,"wires":[["b80bfd92.60c72","129e97e8.605698"]]},{"id":"9577277d.344928","type":"image","z":"ca053924.d79bf8","name":"","width":"400","data":"payload","dataType":"msg","thumbnail":false,"active":true,"pass":false,"outputs":0,"x":740,"y":60,"wires":[]},{"id":"b80bfd92.60c72","type":"change","z":"ca053924.d79bf8","name":"Set filename","rules":[{"t":"set","p":"payload","pt":"msg","to":"/home/pi/node-red-static/grab.jpg","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":330,"y":260,"wires":[["588cc119.1e3ed"]]},{"id":"588cc119.1e3ed","type":"exec","z":"ca053924.d79bf8","command":"ffmpeg -y -i \"rtsp://<USER>:<PASS>@<IP>:554/cam/realmonitor?channel=1&subtype=0\" -vframes 1 -qscale:v 2","addpay":"payload","append":"","useSpawn":"false","timer":"","oldrc":false,"name":"Grab a frame -> jpg","x":390,"y":320,"wires":[[],[],[]]},{"id":"c45f4aa0.dedb08","type":"file in","z":"ca053924.d79bf8","name":"","filename":"/home/pi/node-red-static/grab.jpg","format":"","chunk":false,"sendError":false,"encoding":"none","x":400,"y":380,"wires":[["3e623d1a.c9fd42","9577277d.344928"]]},{"id":"129e97e8.605698","type":"delay","z":"ca053924.d79bf8","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":160,"y":380,"wires":[["c45f4aa0.dedb08"]]},{"id":"7d2041a7.d6a5d","type":"comment","z":"ca053924.d79bf8","name":"IP Camera image grab and recognition","info":"","x":210,"y":60,"wires":[]}]

```

---

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [23 June 2021 06:05 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/39 "2021-06-23T06:05:11Z")

</div>

> [@SuperNinja](#):
>
> How much for an esp32-cam?

I have no idea how to measure that. From the esp32-cam is just a mjpeg stream via http as you say. The cpu load is not measurable, cant see any change if streaming to dashboard is on or off  
When I stream a playlist like the red-bull it is just adding a fraction on the cpu load, almost nothing  
I have no rtsp so cannot compare

---

<div class="post-metadata">

**Author:** ![fatima1999](https://avatars.discourse-cdn.com/v4/letter/f/f6c823/32.png) [@fatima1999](https://discourse.nodered.org/u/fatima1999)\
**Post date:** [30 June 2021 10:57 UTC](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165/40 "2021-06-30T10:57:14Z")

</div>

do you program your ESP32 CAM to stream or to take pictures each time you refresh the page ?  
I try to apply all these codes in node red but I always find errors :  
Error: ENOENT: no such file or directory, open 'Error: ESOCKETTIMEDOUT : [http://10.10.0.32/capture](http://10.10.0.32/capture) !!  
( I program my ESP32 CAM to do a stream ) I don't konw if this is the problem ???

[Previous page](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165.md?page=1)

[Next page](https://discourse.nodered.org/t/detecting-objects-using-esp32-cam-and-node-red/47165.md?page=3)
