{"id":83379,"date":"2019-12-10T08:59:00","date_gmt":"2019-12-10T08:59:00","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=83379"},"modified":"2024-06-16T15:13:26","modified_gmt":"2024-06-16T15:13:26","slug":"esp32-cam-video-streaming-web-server-camera-home-assistant","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-web-server-camera-home-assistant\/","title":{"rendered":"ESP32-CAM Video Streaming Web Server (works with Home Assistant)"},"content":{"rendered":"\n<p>In this project we\u2019re going to build an IP surveillance camera with the ESP32-CAM board. The ESP32 camera is going to host a video streaming web server that you can access with any device in your network. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/featured-image-esp32-cam-video-streaming-web-server-s.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM Video Streaming Web Server works with Home Assistant Node-RED\" class=\"wp-image-83380\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/featured-image-esp32-cam-video-streaming-web-server-s.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/featured-image-esp32-cam-video-streaming-web-server-s.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/featured-image-esp32-cam-video-streaming-web-server-s.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/featured-image-esp32-cam-video-streaming-web-server-s.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p class=\"rntbox rntclgreen\">You can integrate this video streaming web server with popular home automation platforms like <strong>Home Assistant<\/strong> or <strong>Node-RED<\/strong>. In this tutorial, we\u2019ll show you how to integrate it with Home Assistant and Node-RED.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Watch the Video Tutorial<\/h2>\n\n\n\n<p>You can watch the video tutorial or keep reading this page for the written instructions.<\/p>\n\n\n<p style=\"text-align:center\"><iframe width=\"720\" height=\"405\" src=\"https:\/\/www.youtube.com\/embed\/36p9To2hfak?rel=0\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Parts Required<\/h2>\n\n\n\n<p>To follow this tutorial you need the following components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><a aria-label=\" (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/esp32-cam\/\" target=\"_blank\" rel=\"noreferrer noopener\">ESP32-CAM with OV2640<\/a><\/strong> &#8211; read <a aria-label=\"Best ESP32-CAM Dev Boards (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/esp32-camera-cam-boards-review-comparison\/\" target=\"_blank\" rel=\"noreferrer noopener\">Best ESP32-CAM Dev Boards<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/ftdi-programmer-board\/\" target=\"_blank\" rel=\"noreferrer noopener\">FTDI programmer<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/jumper-wires-kit-120-pieces\/\" target=\"_blank\" rel=\"noreferrer noopener\">Female-to-female jumper wires<\/a><\/li>\n\n\n\n<li><a aria-label=\"Fake\/dummy dome security camera (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/dummy-fake-dome-security-camera\/\" target=\"_blank\" rel=\"noreferrer noopener\">Fake\/dummy dome security camera<\/a><\/li>\n\n\n\n<li><a aria-label=\"5V power supply for ESP32-CAM (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/raspberry-pi-power-supply\/\" target=\"_blank\" rel=\"noreferrer noopener\">5V power supply for ESP32-CAM<\/a><\/li>\n\n\n\n<li>Optional &#8211; Home Assistant on Raspberry Pi:\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/raspberry-pi-board\/\" target=\"_blank\" rel=\"noreferrer noopener\">Raspberry Pi Board<\/a>\u00a0\u00a0\u2013 read\u00a0<a href=\"https:\/\/makeradvisor.com\/best-raspberry-pi-3-starter-kits\/\" target=\"_blank\" rel=\"noreferrer noopener\">Best Raspberry Pi Starter Kits<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/microsd-card-raspberry-pi-16gb-class-10\/\" target=\"_blank\" rel=\"noreferrer noopener\">MicroSD Card \u2013 32GB Class10<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/makeradvisor.com\/tools\/raspberry-pi-power-supply\/\" target=\"_blank\" rel=\"noreferrer noopener\">Raspberry Pi Power Supply (5V 2.5A)<\/a> <\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n<p>You can use the preceding links or go directly to <a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\">MakerAdvisor.com\/tools<\/a> to find all the parts for your projects at the best price!<\/p><p style=\"text-align:center;\"><a href=\"https:\/\/makeradvisor.com\/tools\/?utm_source=rnt&utm_medium=post&utm_campaign=post\" target=\"_blank\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2017\/10\/header-200.png?w=1200&#038;quality=100&#038;strip=all&#038;ssl=1\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introducing the ESP32-CAM<\/h2>\n\n\n\n<p>The <a rel=\"noreferrer noopener\" aria-label=\"ESP32-CAM (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/esp32-cam\/\" target=\"_blank\">ESP32-CAM<\/a> is a very small camera module with the ESP32-S chip that costs less than $10. You can read our <a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-face-recognition-arduino-ide\/\">getting started guide for the ESP32-CAM<\/a> and learn how to use the <a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-face-recognition-arduino-ide\/\">Video Streaming and Face Recognition example<\/a>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-camera.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Introducing the ESP32-CAM camera board AI Thinker module\" class=\"wp-image-82440\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-camera.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/ESP32-CAM-camera.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Video Streaming Server<\/h2>\n\n\n\n<p>Follow the next steps to build a video streaming web server with the ESP32-CAM that you can access on your local network.&nbsp;<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. Install the ESP32 add-on<\/h3>\n\n\n\n<p>In this example, we use Arduino IDE to program the ESP32-CAM board. So, you need to have Arduino IDE installed as well as the ESP32 add-on. Follow one of the next tutorials to install the ESP32 add-on, if you haven\u2019t already:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/installing-the-esp32-board-in-arduino-ide-windows-instructions\/\">Installing the ESP32 Board in Arduino IDE (Windows instructions)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/installing-the-esp32-board-in-arduino-ide-mac-and-linux-instructions\/\">Installing the ESP32 Board in Arduino IDE (Mac and Linux instructions)<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">2. Video Streaming Web Server Code<\/h3>\n\n\n\n<p>After that, copy the code below to your Arduino IDE.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*********\n  Rui Santos\n  Complete project details at https:\/\/RandomNerdTutorials.com\/esp32-cam-video-streaming-web-server-camera-home-assistant\/\n  \n  IMPORTANT!!! \n   - Select Board &quot;AI Thinker ESP32-CAM&quot;\n   - GPIO 0 must be connected to GND to upload a sketch\n   - After connecting GPIO 0 to GND, press the ESP32-CAM on-board RESET button to put your board in flashing mode\n  \n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files.\n\n  The above copyright notice and this permission notice shall be included in all\n  copies or substantial portions of the Software.\n*********\/\n\n#include &quot;esp_camera.h&quot;\n#include &lt;WiFi.h&gt;\n#include &quot;esp_timer.h&quot;\n#include &quot;img_converters.h&quot;\n#include &quot;Arduino.h&quot;\n#include &quot;fb_gfx.h&quot;\n#include &quot;soc\/soc.h&quot; \/\/disable brownout problems\n#include &quot;soc\/rtc_cntl_reg.h&quot;  \/\/disable brownout problems\n#include &quot;esp_http_server.h&quot;\n\n\/\/Replace with your network credentials\nconst char* ssid = &quot;REPLACE_WITH_YOUR_SSID&quot;;\nconst char* password = &quot;REPLACE_WITH_YOUR_PASSWORD&quot;;\n\n#define PART_BOUNDARY &quot;123456789000000000000987654321&quot;\n\n\/\/ This project was tested with the AI Thinker Model, M5STACK PSRAM Model and M5STACK WITHOUT PSRAM\n#define CAMERA_MODEL_AI_THINKER\n\/\/#define CAMERA_MODEL_M5STACK_PSRAM\n\/\/#define CAMERA_MODEL_M5STACK_WITHOUT_PSRAM\n\n\/\/ Not tested with this model\n\/\/#define CAMERA_MODEL_WROVER_KIT\n\n#if defined(CAMERA_MODEL_WROVER_KIT)\n  #define PWDN_GPIO_NUM    -1\n  #define RESET_GPIO_NUM   -1\n  #define XCLK_GPIO_NUM    21\n  #define SIOD_GPIO_NUM    26\n  #define SIOC_GPIO_NUM    27\n  \n  #define Y9_GPIO_NUM      35\n  #define Y8_GPIO_NUM      34\n  #define Y7_GPIO_NUM      39\n  #define Y6_GPIO_NUM      36\n  #define Y5_GPIO_NUM      19\n  #define Y4_GPIO_NUM      18\n  #define Y3_GPIO_NUM       5\n  #define Y2_GPIO_NUM       4\n  #define VSYNC_GPIO_NUM   25\n  #define HREF_GPIO_NUM    23\n  #define PCLK_GPIO_NUM    22\n\n#elif defined(CAMERA_MODEL_M5STACK_PSRAM)\n  #define PWDN_GPIO_NUM     -1\n  #define RESET_GPIO_NUM    15\n  #define XCLK_GPIO_NUM     27\n  #define SIOD_GPIO_NUM     25\n  #define SIOC_GPIO_NUM     23\n  \n  #define Y9_GPIO_NUM       19\n  #define Y8_GPIO_NUM       36\n  #define Y7_GPIO_NUM       18\n  #define Y6_GPIO_NUM       39\n  #define Y5_GPIO_NUM        5\n  #define Y4_GPIO_NUM       34\n  #define Y3_GPIO_NUM       35\n  #define Y2_GPIO_NUM       32\n  #define VSYNC_GPIO_NUM    22\n  #define HREF_GPIO_NUM     26\n  #define PCLK_GPIO_NUM     21\n\n#elif defined(CAMERA_MODEL_M5STACK_WITHOUT_PSRAM)\n  #define PWDN_GPIO_NUM     -1\n  #define RESET_GPIO_NUM    15\n  #define XCLK_GPIO_NUM     27\n  #define SIOD_GPIO_NUM     25\n  #define SIOC_GPIO_NUM     23\n  \n  #define Y9_GPIO_NUM       19\n  #define Y8_GPIO_NUM       36\n  #define Y7_GPIO_NUM       18\n  #define Y6_GPIO_NUM       39\n  #define Y5_GPIO_NUM        5\n  #define Y4_GPIO_NUM       34\n  #define Y3_GPIO_NUM       35\n  #define Y2_GPIO_NUM       17\n  #define VSYNC_GPIO_NUM    22\n  #define HREF_GPIO_NUM     26\n  #define PCLK_GPIO_NUM     21\n\n#elif defined(CAMERA_MODEL_AI_THINKER)\n  #define PWDN_GPIO_NUM     32\n  #define RESET_GPIO_NUM    -1\n  #define XCLK_GPIO_NUM      0\n  #define SIOD_GPIO_NUM     26\n  #define SIOC_GPIO_NUM     27\n  \n  #define Y9_GPIO_NUM       35\n  #define Y8_GPIO_NUM       34\n  #define Y7_GPIO_NUM       39\n  #define Y6_GPIO_NUM       36\n  #define Y5_GPIO_NUM       21\n  #define Y4_GPIO_NUM       19\n  #define Y3_GPIO_NUM       18\n  #define Y2_GPIO_NUM        5\n  #define VSYNC_GPIO_NUM    25\n  #define HREF_GPIO_NUM     23\n  #define PCLK_GPIO_NUM     22\n#else\n  #error &quot;Camera model not selected&quot;\n#endif\n\nstatic const char* _STREAM_CONTENT_TYPE = &quot;multipart\/x-mixed-replace;boundary=&quot; PART_BOUNDARY;\nstatic const char* _STREAM_BOUNDARY = &quot;\\r\\n--&quot; PART_BOUNDARY &quot;\\r\\n&quot;;\nstatic const char* _STREAM_PART = &quot;Content-Type: image\/jpeg\\r\\nContent-Length: %u\\r\\n\\r\\n&quot;;\n\nhttpd_handle_t stream_httpd = NULL;\n\nstatic esp_err_t stream_handler(httpd_req_t *req){\n  camera_fb_t * fb = NULL;\n  esp_err_t res = ESP_OK;\n  size_t _jpg_buf_len = 0;\n  uint8_t * _jpg_buf = NULL;\n  char * part_buf[64];\n\n  res = httpd_resp_set_type(req, _STREAM_CONTENT_TYPE);\n  if(res != ESP_OK){\n    return res;\n  }\n\n  while(true){\n    fb = esp_camera_fb_get();\n    if (!fb) {\n      Serial.println(&quot;Camera capture failed&quot;);\n      res = ESP_FAIL;\n    } else {\n      if(fb-&gt;width &gt; 400){\n        if(fb-&gt;format != PIXFORMAT_JPEG){\n          bool jpeg_converted = frame2jpg(fb, 80, &amp;_jpg_buf, &amp;_jpg_buf_len);\n          esp_camera_fb_return(fb);\n          fb = NULL;\n          if(!jpeg_converted){\n            Serial.println(&quot;JPEG compression failed&quot;);\n            res = ESP_FAIL;\n          }\n        } else {\n          _jpg_buf_len = fb-&gt;len;\n          _jpg_buf = fb-&gt;buf;\n        }\n      }\n    }\n    if(res == ESP_OK){\n      size_t hlen = snprintf((char *)part_buf, 64, _STREAM_PART, _jpg_buf_len);\n      res = httpd_resp_send_chunk(req, (const char *)part_buf, hlen);\n    }\n    if(res == ESP_OK){\n      res = httpd_resp_send_chunk(req, (const char *)_jpg_buf, _jpg_buf_len);\n    }\n    if(res == ESP_OK){\n      res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY));\n    }\n    if(fb){\n      esp_camera_fb_return(fb);\n      fb = NULL;\n      _jpg_buf = NULL;\n    } else if(_jpg_buf){\n      free(_jpg_buf);\n      _jpg_buf = NULL;\n    }\n    if(res != ESP_OK){\n      break;\n    }\n    \/\/Serial.printf(&quot;MJPG: %uB\\n&quot;,(uint32_t)(_jpg_buf_len));\n  }\n  return res;\n}\n\nvoid startCameraServer(){\n  httpd_config_t config = HTTPD_DEFAULT_CONFIG();\n  config.server_port = 80;\n\n  httpd_uri_t index_uri = {\n    .uri       = &quot;\/&quot;,\n    .method    = HTTP_GET,\n    .handler   = stream_handler,\n    .user_ctx  = NULL\n  };\n  \n  \/\/Serial.printf(&quot;Starting web server on port: '%d'\\n&quot;, config.server_port);\n  if (httpd_start(&amp;stream_httpd, &amp;config) == ESP_OK) {\n    httpd_register_uri_handler(stream_httpd, &amp;index_uri);\n  }\n}\n\nvoid setup() {\n  WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); \/\/disable brownout detector\n \n  Serial.begin(115200);\n  Serial.setDebugOutput(false);\n  \n  camera_config_t config;\n  config.ledc_channel = LEDC_CHANNEL_0;\n  config.ledc_timer = LEDC_TIMER_0;\n  config.pin_d0 = Y2_GPIO_NUM;\n  config.pin_d1 = Y3_GPIO_NUM;\n  config.pin_d2 = Y4_GPIO_NUM;\n  config.pin_d3 = Y5_GPIO_NUM;\n  config.pin_d4 = Y6_GPIO_NUM;\n  config.pin_d5 = Y7_GPIO_NUM;\n  config.pin_d6 = Y8_GPIO_NUM;\n  config.pin_d7 = Y9_GPIO_NUM;\n  config.pin_xclk = XCLK_GPIO_NUM;\n  config.pin_pclk = PCLK_GPIO_NUM;\n  config.pin_vsync = VSYNC_GPIO_NUM;\n  config.pin_href = HREF_GPIO_NUM;\n  config.pin_sccb_sda = SIOD_GPIO_NUM;\n  config.pin_sccb_scl = SIOC_GPIO_NUM;\n  config.pin_pwdn = PWDN_GPIO_NUM;\n  config.pin_reset = RESET_GPIO_NUM;\n  config.xclk_freq_hz = 20000000;\n  config.pixel_format = PIXFORMAT_JPEG; \n  \n  if(psramFound()){\n    config.frame_size = FRAMESIZE_UXGA;\n    config.jpeg_quality = 10;\n    config.fb_count = 2;\n  } else {\n    config.frame_size = FRAMESIZE_SVGA;\n    config.jpeg_quality = 12;\n    config.fb_count = 1;\n  }\n  \n  \/\/ Camera init\n  esp_err_t err = esp_camera_init(&amp;config);\n  if (err != ESP_OK) {\n    Serial.printf(&quot;Camera init failed with error 0x%x&quot;, err);\n    return;\n  }\n  \/\/ Wi-Fi connection\n  WiFi.begin(ssid, password);\n  while (WiFi.status() != WL_CONNECTED) {\n    delay(500);\n    Serial.print(&quot;.&quot;);\n  }\n  Serial.println(&quot;&quot;);\n  Serial.println(&quot;WiFi connected&quot;);\n  \n  Serial.print(&quot;Camera Stream Ready! Go to: http:\/\/&quot;);\n  Serial.print(WiFi.localIP());\n  \n  \/\/ Start streaming web server\n  startCameraServer();\n}\n\nvoid loop() {\n  delay(1);\n}\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/ESP32-CAM-Arduino-IDE\/raw\/master\/ESP32-CAM-Video-Streaming\/ESP32-CAM-Video-Streaming.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<p>Before uploading the code, you need to insert your network credentials in the following variables:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>const char* ssid = \"REPLACE_WITH_YOUR_SSID\";\nconst char* password = \"REPLACE_WITH_YOUR_PASSWORD\";<\/code><\/pre>\n\n\n\n<p>Then, make sure you select the right camera module. In this case, we\u2019re using the AI-THINKER Model. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/AI-Thinker-ESP32CAM.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board AI Thinker module CAMERA_MODEL_AI_THINKER\" class=\"wp-image-82445\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/AI-Thinker-ESP32CAM.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/AI-Thinker-ESP32CAM.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>If you&#8217;re using the same camera module, you don&#8217;t need to change anything on the code.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>#define CAMERA_MODEL_AI_THINKER<\/code><\/pre>\n\n\n\n<p>Now, you can upload the code to your ESP32-CAM board.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Uploading the Code<\/h3>\n\n\n\n<p>Connect the ESP32-CAM board to your computer using an <a aria-label=\"FTDI programmer (opens in a new tab)\" href=\"https:\/\/makeradvisor.com\/tools\/ftdi-programmer-board\/\" target=\"_blank\" rel=\"noreferrer noopener\">FTDI programmer<\/a>. Follow the next schematic diagram:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"877\" height=\"532\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/ESP32-CAM-FTDI-programmer.png?resize=877%2C532&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM connected to an FTDI Programmer to upload program using Arduino IDE\" class=\"wp-image-159060\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/ESP32-CAM-FTDI-programmer.png?w=877&amp;quality=100&amp;strip=all&amp;ssl=1 877w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/ESP32-CAM-FTDI-programmer.png?resize=300%2C182&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2024\/06\/ESP32-CAM-FTDI-programmer.png?resize=768%2C466&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 877px) 100vw, 877px\" \/><\/figure><\/div>\n\n\n<p>Many FTDI programmers have a jumper that allows you to select 3.3V or 5V. Make sure the jumper is in the right place to select 5V.<\/p>\n\n\n\n<p class=\"rntbox rntcred\"><strong>Important: <\/strong> <span class=\"rnthl rntclgray\">GPIO 0<\/span> needs to be connected to <span class=\"rnthl rntcblack\">GND<\/span> so that you\u2019re able to upload code.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>ESP32-CAM<\/strong><\/td><td><strong>FTDI Programmer<\/strong><\/td><\/tr><tr><td>GND<\/td><td>GND<\/td><\/tr><tr><td>5V<\/td><td>VCC (5V)<\/td><\/tr><tr><td>U0R<\/td><td>TX<\/td><\/tr><tr><td>U0T<\/td><td>RX<\/td><\/tr><tr><td>GPIO 0<\/td><td>GND<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>To upload the code, follow the next steps:<\/p>\n\n\n\n<p>1) Go to <strong>Tools <\/strong>&gt; <strong>Board <\/strong>and select <strong>AI-Thinker ESP32-CAM<\/strong>.<\/p>\n\n\n\n<p>2) Go to <strong>Tools <\/strong>&gt; <strong>Port <\/strong>and select the COM port the ESP32 is connected to.<\/p>\n\n\n\n<p>3) Then, click the upload button to upload the code.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"32\" height=\"32\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/12\/upload-button-arduino-ide.png?resize=32%2C32&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-91745\"\/><\/figure><\/div>\n\n\n<p>4) When you start to see these dots on the debugging window as shown below, press the ESP32-CAM on-board RST button.   <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1009\" height=\"91\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/12\/dots-uploading-code.png?resize=1009%2C91&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board upload new Arduino IDE sketch press RESET button\" class=\"wp-image-91746\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/12\/dots-uploading-code.png?w=1009&amp;quality=100&amp;strip=all&amp;ssl=1 1009w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/12\/dots-uploading-code.png?resize=300%2C27&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/12\/dots-uploading-code.png?resize=768%2C69&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1009px) 100vw, 1009px\" \/><\/figure><\/div>\n\n\n<p>After a few seconds, the code should be successfully uploaded to your board.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Getting the IP address<\/h2>\n\n\n\n<p>After uploading the code, disconnect <span class=\"rnthl rntclgray\"> GPIO 0<\/span> from <span class=\"rnthl rntcblack\">GND<\/span>. Open the Serial Monitor at a baud rate of 115200. Press the ESP32-CAM on-board Reset button.<\/p>\n\n\n\n<p>The ESP32 IP address should be printed in the Serial Monitor.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"455\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-arduino-ide-serial-monitor-ip-address.png?resize=707%2C455&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board IP address Arduino IDE Serial Monitor\" class=\"wp-image-83383\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-arduino-ide-serial-monitor-ip-address.png?w=707&amp;quality=100&amp;strip=all&amp;ssl=1 707w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-arduino-ide-serial-monitor-ip-address.png?resize=300%2C193&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 707px) 100vw, 707px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Accessing the Video Streaming Server<\/h2>\n\n\n\n<p>Now, you can access your camera streaming server on your local network. Open a browser and type the ESP32-CAM IP address. A page with the current video streaming should load.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-video-streaming-web-server.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board IP address web Server IP CAM demonstration\" class=\"wp-image-83416\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-video-streaming-web-server.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-video-streaming-web-server.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Home Assistant Integration<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"100\" height=\"100\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/home-assistant-logo.png?resize=100%2C100&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"\" class=\"wp-image-83418\"\/><\/figure><\/div>\n\n\n<p>Having just the ESP32-CAM working via IP might be useful for most people, but you can integrate this project with Home Assistant (or with other home automation platforms). Continue reading to learn how to integrate with Home Assistant.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Prerequisites<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You should be familiar with the Raspberry Pi \u2013\u00a0<a href=\"https:\/\/randomnerdtutorials.com\/getting-started-with-raspberry-pi\/\" target=\"_blank\" rel=\"noreferrer noopener\">read Getting Started with Raspberry Pi<\/a>.<\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/getting-started-with-home-assistant-on-raspberry-pi\/\">Getting Started with Home Assistant on Raspberry Pi<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Adding ESP32-CAM to Home Assistant<\/h3>\n\n\n\n<p>Open your Home Assistant dashboard and go to the more <strong>Settings <\/strong>menu.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1012\" height=\"572\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-1.png?resize=1012%2C572&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board IP address web Server IP CAM home assistant integration\" class=\"wp-image-83385\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-1.png?w=1012&amp;quality=100&amp;strip=all&amp;ssl=1 1012w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-1.png?resize=300%2C170&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-1.png?resize=768%2C434&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1012px) 100vw, 1012px\" \/><\/figure><\/div>\n\n\n<p>Open <strong>Configure UI<\/strong>:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"570\" height=\"317\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-2.png?resize=570%2C317&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board IP address web Server IP CAM configure UI\" class=\"wp-image-83386\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-2.png?w=570&amp;quality=100&amp;strip=all&amp;ssl=1 570w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-2.png?resize=300%2C167&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 570px) 100vw, 570px\" \/><\/figure><\/div>\n\n\n<p>Add a new card to your Dashboard:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"803\" height=\"391\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-3.png?resize=803%2C391&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board home assistant add new element\" class=\"wp-image-83387\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-3.png?w=803&amp;quality=100&amp;strip=all&amp;ssl=1 803w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-3.png?resize=300%2C146&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-3.png?resize=768%2C374&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 803px) 100vw, 803px\" \/><\/figure><\/div>\n\n\n<p>Pick a card of the type <strong>Picture<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"697\" height=\"592\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-4.png?resize=697%2C592&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board home assistant Picture card\" class=\"wp-image-83388\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-4.png?w=697&amp;quality=100&amp;strip=all&amp;ssl=1 697w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-4.png?resize=300%2C255&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 697px) 100vw, 697px\" \/><\/figure><\/div>\n\n\n<p>In the <strong>Image URL field<\/strong>, enter your ESP32-CAM IP address. Then, click the &#8220;<strong>SAVE<\/strong>&#8221; button and return to the main dashboard.  <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"998\" height=\"479\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-6.jpg?resize=998%2C479&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board home assistant IP Address\" class=\"wp-image-83389\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-6.jpg?w=998&amp;quality=100&amp;strip=all&amp;ssl=1 998w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-6.jpg?resize=300%2C144&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-6.jpg?resize=768%2C369&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 998px) 100vw, 998px\" \/><\/figure><\/div>\n\n\n<p>If you\u2019re using the configuration file, this is what you need to add.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"482\" height=\"206\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-7.png?resize=482%2C206&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board home assistant card configuration\" class=\"wp-image-83390\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-7.png?w=482&amp;quality=100&amp;strip=all&amp;ssl=1 482w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-7.png?resize=300%2C128&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 482px) 100vw, 482px\" \/><\/figure><\/div>\n\n\n<p>After that, Home Assistant can display the ESP32-CAM video streaming.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1101\" height=\"834\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-8.jpg?resize=1101%2C834&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board home assistant demonstration\" class=\"wp-image-83392\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-8.jpg?w=1101&amp;quality=100&amp;strip=all&amp;ssl=1 1101w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-8.jpg?resize=300%2C227&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-8.jpg?resize=768%2C582&amp;quality=100&amp;strip=all&amp;ssl=1 768w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-cam-home-assistant-8.jpg?resize=1024%2C776&amp;quality=100&amp;strip=all&amp;ssl=1 1024w\" sizes=\"(max-width: 1101px) 100vw, 1101px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Taking It Further<\/h2>\n\n\n\n<p>To take this project further, you can use one <a href=\"https:\/\/makeradvisor.com\/dummy-fake-dome-security-camera\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"fake dummy camera (opens in a new tab)\">fake dummy camera<\/a> and place the ESP32-CAM inside. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/dummy-camera-fake.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board fake camera\" class=\"wp-image-83406\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/dummy-camera-fake.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/dummy-camera-fake.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>The ESP32-CAM board fits perfectly into the dummy camera enclosure.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-dummy-camera.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Fake dummy camera with ESP32-CAM AI Thinker Module Inside IP Camera CAM web server\" class=\"wp-image-83408\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-dummy-camera.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/esp32-dummy-camera.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>You can power it using a 5V power adapter through the ESP32-CAM <span class=\"rnthl rntcblack\">GND<\/span> and <span class=\"rnthl rntcred\">5V<\/span>  pins.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/5V-power-supply-ESP32-CAM.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Fake dummy camera with ESP32-CAM AI Thinker Module Inside powering\" class=\"wp-image-83409\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/5V-power-supply-ESP32-CAM.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/5V-power-supply-ESP32-CAM.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>Place the surveillance camera in a suitable place. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/install-surveillance-camera-esp32-cam.jpg?resize=750%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board surveillance IP Cam\" class=\"wp-image-83436\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/install-surveillance-camera-esp32-cam.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/install-surveillance-camera-esp32-cam.jpg?resize=300%2C168&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>After that, go to the camera IP address or to your Home Assistant dashboard and see in real time what\u2019s happening. The following image shows us testing the video streaming camera. Sara is taking a screenshot while I&#8217;m filming the camera.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"1397\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/testing-camera-home-assistant.jpg?resize=750%2C1397&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board surveillance IP Cam home assistant\" class=\"wp-image-83413\" style=\"width:392px;height:729px\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/testing-camera-home-assistant.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/testing-camera-home-assistant.jpg?resize=161%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 161w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/testing-camera-home-assistant.jpg?resize=550%2C1024&amp;quality=100&amp;strip=all&amp;ssl=1 550w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<p>It\u2019s impressive what this little $9 <a href=\"https:\/\/makeradvisor.com\/tools\/esp32-cam\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"ESP32 camera module (opens in a new tab)\">ESP32 camera module<\/a> can do and it\u2019s been working reliably. Now, we can use the surveillance camera to see in real time what&#8217;s happening in my front entrance.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"457\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/main-entrance-home-assistant-esp32-cam.jpg?resize=750%2C457&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32-CAM camera board surveillance IP Cam home assistant\" class=\"wp-image-83414\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/main-entrance-home-assistant-esp32-cam.jpg?w=750&amp;quality=100&amp;strip=all&amp;ssl=1 750w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/main-entrance-home-assistant-esp32-cam.jpg?resize=300%2C183&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 750px) 100vw, 750px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Tip: Node-RED Integration<\/h2>\n\n\n\n<p>The video streaming web server also integrates with <a href=\"https:\/\/randomnerdtutorials.com\/getting-started-with-node-red-on-raspberry-pi\/\">Node-RED<\/a> and <a href=\"https:\/\/randomnerdtutorials.com\/getting-started-with-node-red-dashboard\/\">Node-RED Dashboard<\/a>. You just need to create a Template node and add the following:<\/p>\n\n\n\n<pre class=\"wp-block-code language-html\"><code>&lt;div style=\"margin-bottom: 10px;\"&gt;\n&lt;img src=\"http:\/\/YOUR-ESP32-CAM-IP-ADDRESS\" width=\"650px\"&gt;\n&lt;\/div&gt;<\/code><\/pre>\n\n\n\n<p>In the <em>src<\/em> attribute, you need to type your ESP32-CAM IP address:<\/p>\n\n\n\n<pre class=\"wp-block-code language-html\"><code>&lt;div style=\"margin-bottom: 10px;\"&gt;\n&lt;img src=\"http:\/\/192.168.1.91\" width=\"650px\"&gt;\n&lt;\/div&gt;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<p>If you&#8217;re getting any of the following errors, read our <a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-troubleshooting-guide\/\"><strong>ESP32-CAM Troubleshooting Guide: Most Common Problems Fixed<\/strong><\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Failed to connect to ESP32: Timed out waiting for packet header<\/li>\n\n\n\n<li>Camera init failed with error 0x20001 or similar<\/li>\n\n\n\n<li>Brownout detector or Guru meditation error<\/li>\n\n\n\n<li>Sketch too big error \u2013 Wrong partition scheme selected<\/li>\n\n\n\n<li>Board at COMX is not available \u2013 COM Port Not Selected<\/li>\n\n\n\n<li>Psram error: GPIO isr service is not installed<\/li>\n\n\n\n<li>Weak Wi-Fi Signal<\/li>\n\n\n\n<li>No IP Address in Arduino IDE Serial Monitor<\/li>\n\n\n\n<li>Can\u2019t open web server<\/li>\n\n\n\n<li>The image lags\/shows lots of latency<\/li>\n<\/ul>\n\n\n\t\t<div data-elementor-type=\"section\" data-elementor-id=\"94673\" class=\"elementor elementor-94673\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2689e44b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2689e44b\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7490d123\" data-id=\"7490d123\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-35934f78 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"35934f78\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-3de108d9\" data-id=\"3de108d9\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5aca63ab elementor-widget elementor-widget-image\" data-id=\"5aca63ab\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\">\n\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"334\" height=\"334\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/03\/ESP32-CAM-eBook-334.jpg?fit=334%2C334&amp;quality=100&amp;strip=all&amp;ssl=1\" class=\"attachment-full size-full wp-image-94555\" alt=\"\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/03\/ESP32-CAM-eBook-334.jpg?w=334&amp;quality=100&amp;strip=all&amp;ssl=1 334w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/03\/ESP32-CAM-eBook-334.jpg?resize=300%2C300&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/03\/ESP32-CAM-eBook-334.jpg?resize=150%2C150&amp;quality=100&amp;strip=all&amp;ssl=1 150w\" sizes=\"(max-width: 334px) 100vw, 334px\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-inner-column elementor-element elementor-element-4bd084e0\" data-id=\"4bd084e0\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-517cf0fa elementor-widget elementor-widget-heading\" data-id=\"517cf0fa\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\">[eBook] Build ESP32-CAM Projects using Arduino IDE<\/a><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3438ea70 elementor-hidden-phone elementor-widget elementor-widget-text-editor\" data-id=\"3438ea70\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Learn how to program and build 17 projects with the ESP32-CAM using Arduino IDE\u00a0<strong><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\" rel=\"noopener\">DOWNLOAD \u00bb<\/a><\/strong><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<div class=\"elementor-element elementor-element-674524a5 elementor-hidden-desktop elementor-hidden-tablet elementor-widget elementor-widget-text-editor\" data-id=\"674524a5\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Learn how to program and build 17 projects with the ESP32-CAM using Arduino IDE <strong><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\" rel=\"noopener\">DOWNLOAD \u00bb<\/a><\/strong><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>In this tutorial, we&#8217;ve shown you how to build a simple video streaming web server with the ESP32-CAM board to build an IP camera. The web server we&#8217;ve built can be easily integrated with your home automation platform like Node-RED or Home Assistant.<\/p>\n\n\n\n<p>We hope you\u2019ve find this tutorial useful. If you don\u2019t have an ESP32-CAM yet, you can <a rel=\"noreferrer noopener\" href=\"https:\/\/makeradvisor.com\/tools\/esp32-cam\/\" target=\"_blank\">grab it here<\/a>. <\/p>\n\n\n\n<p>If you like this project, you may also like other projects with the ESP32-CAM:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-face-recognition-arduino-ide\/\">ESP32-CAM Video Streaming and Face Recognition with Arduino IDE<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-take-photo-save-microsd-card\/\">ESP32-CAM Take Photo and Save to MicroSD Card<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-take-photo-save-microsd-card\/\">ESP32-CAM PIR Motion Detector with Photo Capture (saves to microSD card)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-take-photo-display-web-server\/\">ESP32-CAM Take Photo and Display in Web Server<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-projects-ebook\/\"><strong>Build ESP32-CAM Projects (eBook)<\/strong><\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/randomnerdtutorials.com\/projects-esp32-cam\/\"><strong>Read all our ESP32-CAM Projects, Tutorials and Guides<\/strong><\/a><\/li>\n<\/ul>\n\n\n\n<p>Thanks for reading!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this project we\u2019re going to build an IP surveillance camera with the ESP32-CAM board. The ESP32 camera is going to host a video streaming web server that you can &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"ESP32-CAM Video Streaming Web Server (works with Home Assistant)\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/esp32-cam-video-streaming-web-server-camera-home-assistant\/#more-83379\" aria-label=\"Read more about ESP32-CAM Video Streaming Web Server (works with Home Assistant)\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":83380,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[281,276,277,319,294,264,268],"tags":[],"class_list":["post-83379","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32-project","category-esp32","category-esp32-arduino-ide","category-esp32-cam","category-home-assistant","category-project","category-raspberry-pi-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2019\/03\/featured-image-esp32-cam-video-streaming-web-server-s.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/83379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=83379"}],"version-history":[{"count":1,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/83379\/revisions"}],"predecessor-version":[{"id":159116,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/83379\/revisions\/159116"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/83380"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=83379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=83379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=83379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}