Integrate Tasmota based ESP32-CAM with Node-Red and Home Assistant
byTechKnowSurfBlog•
0
Tasmota
Tasmota is a opensource platform.The Tasmota created the readymade binary files or firmware for the ESP based products like sonoff devices. The Tasmota is very easy to operate. If someone does not have any experience of coding, he can also create the Esp chip Based product very easily. The pre-compiled and pre-built code can be flashed into ESP device.The device can be configured using webUI.The tasmota has support for various sensor like temperature sensor like DH11 or humidity sensors etc. Further the device can be controlled through HTTP,MQTT,Webui and serially.So creating the product for the Home Automation is very easy. To start working with it ,visit Tasmota Getting started webpage.
Node-Red
Node-Red is a open source platform. It is based on node.js. It is a web based visual application which uses the nodes palette. It is very easy to use. The user has to drag the nodes from the nodes pallete and place it in the editor window and wire them and put some logic to implement the functionality of the project With this the IOT based project UI can be easily created.
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 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.
Flash the code in ESP32-CAM with Tasmota Web Installer
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 code 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.
Visit the Tasmota Getting Started Page, Select the Appropriate Binary file and flash it using the Tasmota Web Installer.
After the installation is complete remove jumper between GND pin ,
The ESP32-cam will act as tasmota server ,Check the wifi network of your PC to check tasmota device is available for connecting. Connect with the Tasmota device.
Enter the IP 192.168.4.1 in the browser to get the page as shown below. Set the wi-fi SSID and password of your network and click on save..
After this visit the main menu page of the Tasmota. The Camerra streaming input is available on Main Menu Page
Configure the LED pin(GPIO 4) of ESP32-CAM as Relay by entering configure module sub menu of Tasmota Menu Page.
Configure Node-Red
Start the Node-Red from the command prompt(windows) or terminal(Ubuntu). When Editor window is opened then drag the Template node from Dashboard into editor.
Click on the template node and do the following settings.
1. Create new Dash board Group
2. Keep the name as default. Add new Dashboard tab.
3. Set the name as Node-RedCam and click Add Button again cilck on Add Button.
4. Add some code as shown in the figure below. I have used IP assigned to ESP32-CAM .You use the IP of your network.
Add code as
<div>
<img src="http://IP of your network:81/stream" width = "600" height ="400">
</div>
Click on Done Button. The template node is configured. Click on Deploy Button and then go to the Dashboard.
Now the ESP32-CAM image stream is available on the Dashboard.
If the image stream is not available on dashboard. then try the following steps.
1. Go to the console Menu on Tasmota Menu Page. and type the following command as shown in the image and press Enter
Rule1 ON System#Boot DO Wcinit ENDON
2. By setting the rule1.Run this Rule1 by typing the command Rule1 1 and press Enter.
3.Reboot the Tasmota Device by running the command Restart.
When the device gets restarted, check the image available on the Node-Red Dashboard .
The Flow for the integrating Tasmota Based ESP32-Cam with Node- Red is as given below.
Please set the IP of your network in Template and Function Nodes.