esp32-cam flashes into esphome and how to use it

Data download: wiki.ai-thinker.com/esp32-cam

ESP32 pin definition

ESP32 pin definition

Notice

1. Please ensure that the module input power supply is at least 5V 2A, otherwise there is a chance that water marks will appear on the picture.

2. The ESP32 GPIO32 pin controls the power of the camera. When the camera is working, please pull GPIO32 low.

3. Since IO0 is connected to the camera XCLK, please leave IO0 floating when using it, and do not connect high and low levels.

4. The default firmware is shipped from the factory and is not available for download. If you need to re-burn other firmware, please operate with caution.

Required hardware

● ESP32-CAM with OV2640

● FTDI controller

●Female to female jumper

● 3.3V battery

Hardware connection

Before uploading the code, please connect all components as shown in the image below, then use the FTDI controller to connect the ESP32-CAM to your computer.

--------------------------------------

Install python 2.7
briefly.
Install pip
https://pypi.python.org/pypi/pip#downloads
python setup.py install

Install esphome
pip install esphome
pip install homeassistant

After the installation is complete, enter: esphome esphome_config/ dashboard to start the ESPHome web setup wizard.

Configure esphome

  • In the page that opens, enter the name of the firmware here in the Name of node , and you can choose whatever you want. After filling in the name, click CONTINUE .

Edit configuration file

  • The configuration module we just set will appear in the middle of the page. Click EDIT below to enter the editing interface.

    It supports some commonly used sensors on the market, just configure the interface information of DHT11 directly.
    The pin is the pin number of your DHT11 connected to the esp module. You can use D3 or GPIO14. The model is the DHT module model you are using.
    After editing the configuration file, click SAVE in the lower right corner to save it and then click CLOSE to exit the editing interface.

DHT11 configuration information

sensor:
 - platform: dht
 pin: GPIO0
 temperature:
 name: "Home Temperature"
 humidity:
 name: "Home Humidity"
 update_interval: 60s
 model: DHT11

Click  VALIDATE to check whether there are any errors in the configuration file we just edited. If there are errors, a red message will be displayed. If there are no errors, you can click UPLOAD to start compiling and uploading the firmware.

Verify configuration file

You have to wait a little longer for the first compilation, because you need to download the required files from the Internet according to the sensors you configured. It will be uploaded automatically after compilation is completed. If you are not using a complete module like NodeMcu, you need to ground GPIO0 before powering on the esp module to put the module into programming mode. After the firmware upload is completed, disconnect the GPIO ground and then restart the esp module to put the module into working mode.

Compile firmware

After the firmware upload is completed, the esp module will automatically scan surrounding WiFi hotspots and connect to the hotspot we just set. After the connection is successful, the IP address obtained by the module will be returned.

Connected to hotspot successfully

  • After the firmware upload is completed, you can use Ctrl+C to close the esphome configuration program on Python2.7.

homeassistant configuration

Our sensor has been successfully connected to the network, now we need to connect it to the homeassistant. Open HomeAssistant by entering the IP address of HomeAssistant in the browser, select the configuration option, and click Integrate .

Configure homeassistant

Click on the ESPHome configuration option in the newly appeared interface .

Configure homeassistant

Fill in the IP address obtained by the esp module. The default port number is sufficient. Click SUBMIT to proceed to the next step.

Fill in the IP address of esp

Fill in the password of the access module just set and click SUBMIT to proceed to the next step.

Fill in the access password

Click CLOSE to complete the access settings of the esp module.

Complete access

Now you can see our temperature and humidity sensor.

Newly added sensor

Just like when adding a card last time, go back to the overview of the home page , click on the three dots in the upper right corner, and select Configure UI .

add card

Select the yellow plus sign on the right to add a new card.
Select the ENTITIES card, select the two names filled in our ESPHome configuration file , and click Save to complete the configuration.

Configure card

Now you can see our newly added temperature and humidity card.

 

 

--------------------------------

Reference:
https://www.shangyouw.cn/wenjian/arc48716.html

Guess you like

Origin blog.csdn.net/wailaizhu/article/details/107337088