Integrate ESP32-CAM Webserver with Domoticz|Arduino Ide


Integrate ESP32-CAm with Domoticz


ESP32-Cam

ESP32 cam is a ESP32-S2 series based camera supporting module. Generally the ESP32-Cam modules available modules are developed by I-Thinker which is china based company. The ESP32-Cam module comes with camera OV2640 module which is 2Mpixel resolution. The Tasmota ESP32-CAM resolution is 2Mpixel.The board comes with connector to the camera. The board has some free IO ports which are mode available for the user on the headers lying on the either side. The Board has LED which is very bright and connected GPIO pin 4.It has got the SD card slot which is provision for SD card for saving the captured images.


ESP32-CAM Module


Preparing ESP32-Cam Board for Flashing the code

As it can be seen from the images above, the ESP32-Cam board does not have any usb port to flash the code.So flash the coe or hex file is flashed using the serial port.The image given below shows the connections for putting ESP32-Cam board into programming mode..Note that, for programming mode, the GPIO0 pin of ESP32 is connected to the Ground pin. After flashing of the code is over, the GPIO0 pin should be disconnected from the Ground pin.


ESP32 -cam Ckt


ESP32-CAM Programming mode.

In the image above ,note that 5V is supplied from external 5V DC Source.


DomoTicz

Domoticz is a open Source Platform for Home Automation System. It is browser based UI where the home Automation devices are integrated, configured monitored and controlled.The Data from various sensors,like Humidty,Tempearture,Gas,Pressure ,Wind etc can be monitored and alerts  or notifications can be generated with this Utility.The user interface is scalable WebFront End.The Domoticz is a platform which can be installed and operated on the OS like Windows,Linux ADnroid etc.Domoticz can be operated from the Desktops or Mobile Phones etc and it is compatible with most of  the browsers.


How to Install Domoticz

To Download the Domoticz Setup File follow the steps as given below.

1. Visit the download page on Domoticz Website. 

2. Choose the setup file as per the OS and download it on the PC or your Device like Raspberry-PI.

3. Run the Set up file and Install the the the Application.

4. Start the Application by clicking on the Domoticz icon. When the Application starts, then windows OS can pop-up the Warning Message which should be accepted by pressing the Allow access button.


Firewall Warning


Finally the User can see the UI like this in the browser.


Domoticz Dashboard


Arduino Platform

Arduino is a open source platform. It is very useful learning the embedded based coding. Anybody with lesser knowledge can start using this platform to get acquainted with coding skills required for embedded based projects. The code can be written in c and C++ laguages.The Arduino ide supports good libraries for supporting the various protocol interface. It has also released the hardware board dedicated for the Arduino platform which are mainly based on AVR ATMega 328 core. The various types of versions of the boards like Arduino Uno,Arduino Nano,Arduino Mega are released in the market. The Arduino has support for ESP microcontrollers like ESP32,ESP8266 etc. 

To install the Arduino platform visit this page. Download the latest setup file as per the OS of the choice and get it installed on the PC.

To setup the ESP32 boards on Arduino IDE follow the steps as given below

1.Go to file ->Preferences

2. Add ths URL https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json to the Additional Boards Manager URL textbox as shown below.


preference Page



3. Press Close Button,

4. Go to tools -> Boards ->Boards Manager.Enter ESP32 in the search window and press Enter.

    Install the latest version of ESP32 Board.and click on close Button.


ESP32 Board  library



Setup Arduino IDE for ESP32-CAM example

1. Go to tools and select the Board as ESP32 Wrover Module and Partition Scheme as Huge APP

as shown in the image below.

2. Connect the ESP32-CAM board to the SUB port of the PC and select the appropriate com Port.


ESP32-CAM selection




Once these settings are done then go to File->Examples->ESP32->ESPWebcam->CameraWebServer.

In the coding part select the AI-THINKER CAM module and set the WIFI Credentials of your network as shown in the image below.



select board


All is set,put the ESP32-CAM board in Programming mode and press Reset button on Cam board. Go to Sketch and upload the code.in ESP32-CAM board. Once the code is uploaded, Start the serial Terminal and check the IP printed by the  ESP32-CAM Board as per your network.


UART Monitor



Copy this IP and Paste in the Browser. The Web Page will be visible as shown below


ESP32-Cam Webserver



The Brightness,Resolution,Saturation of the image can be changed from this web page.

The Click on Get Still button to capture the image or click on Get stream button to getting stream of images from the web cam camera.


ESP32-Cam Webserver-Stream



Integrate ESP32-Cam with Domoticz

To integrate ESP32_CAM with Domoticz follow the steps as given below.

1. Go to Setup->More Options -> Camera. Click on Camera.


Domoticz Setting


3. In the new Window Click on Add Camera button to get Pop Window as shown below.



Domoticz-Capture



4. Enter the Name as esp32-cam
    
    a. Enter the IP address of the ES32 Web-Cam Server
    b. Enter port no as 80
    c. Under Image URL enter Capture.

 5. Press Test connection Button to check whether input is available for CAM Board.
  
 6.Click on Add button to Add device to the  Domoticz UI.


Domoticz UI


The user can see the stream from ESP32-Web Cam by clicking on Stream Video and take a snapshot by clicking on Take snapshot icon.

For Further details watch this youtube Video

Other Blogs:




 

Post a Comment

Previous Post Next Post