About This Guide This document is intended to help users set up the basic software development environment for developing applications using hardware based on the ESP32- WATG-32D module. Release Notes Date Version Release notes 2019.12 V0.1 Preliminary release.
1.2. Pin Description 2 2. Hardware Preparation 2.1. Hardware Preparation 5 2.2. Hardware Connection 5 3. Getting Started with ESP32-WATG-32D 7 3.1. ESP-IDF 7 3.2. Set up the Tools 3.2.1. Standard Setup of Toolchain for Windows 7 3.2.2. Standard Setup of Toolchain for Linux 3.2.3.
Introduction to ESP32- WATG-32D 1.1. ESP32-WATG-32D ESP32-WATG-32D is a custom WiFi-BT-BLE MCU module for giving the “Connectivity Function” to customer’s different products, including Water Heater and Comfort Heating Systems. Table provides the specifications of ESP32-WATG-32D. Table 1: ESP32-WATG-32D Specifications Categories Items Specifications...
ESP32-WATG-32D has 35 pins which are described in Table2. 1.2. Pin Description Figure 1: Pin Layout Table 2: Pin Definitions Name Function RESET Module enable signal(Internal pull-up by default). Active high. GPIO36, ADC1_CH0, RTC_GPIO0 GPIO37, ADC1_CH1, RTC_GPIO1 GPI38, ADC1_CH2, RTC_GPIO2...
6. Download firmware into flash using the ESP32 DOWNLOAD TOOL. 7. After download, remove the jumper on IO0 and GND. 8. Power up the carrier board again. ESP32-WATG-32D will switch to working mode. The chip will read programs from flash upon initialization.
Aside from the ESP-IDF, you also need to install the tools used by ESP-IDF, such as the compiler, debugger, Python packages, etc. 3.2.1. Standard Setup of Toolchain for Windows The quickest way is to download the toolchain and MSYS2 zip from dl.espressif.com: https://dl.espressif.com/dl/ esp32_win32_msys2_environment_and_toolchain-20181001.zip Checking out Run C:\msys32\mingw32.exe to open an MSYS2 terminal.
Page 11
Arch: sudo pacman -S --needed gcc git make ncurses flex bison gperf python2-pyserial python2- cryptography python2-future python2-pyparsing python2-pyelftools Set up The Toolchain 64-bit Linux: https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-esp32-2019r1-8.2.0.tar.gz 32-bit Linux: https://dl.espressif.com/dl/xtensa-esp32-elf-linux32-esp32-2019r1-8.2.0.tar.gz 1. Unzip the file to ~/esp directory: 64-bit Linux: mkdir -p ~/esp cd ~/esp tar -xzf ~/Downloads/xtensa-esp32-elf-linux64-esp32-2019r1-8.2.0.tar.gz 32-bit Linux: mkdir -p ~/esp cd ~/esp tar -xzf ~/Downloads/xtensa-esp32-elf-linux32-esp32-2019r1-8.2.0.tar.gz 2. The toolchain will be unzipped to ~/esp/xtensa-esp32-elf/ directory. ...
Once you have the toolchain (that contains programs to compile and build the application) installed, you also need ESP32 specific API / libraries. They are provided by Espressif in repository. To get it, open terminal, navigate to the directory ESP-IDF you want to put ESP-IDF, and clone it using git clone command: git clone --recursive https://github.com/espressif/esp-idf.git...
3.4.1. Windows Search for "Edit Environment Variables" on Windows 10. Click New... and add a new system variable IDF_PATH. The configuration should include an ESP-IDF directory, such as C:\Users\user-name\esp\esp-idf. Add ;%IDF_PATH%\tools to the Path variable to run idf.py and other tools. 3.4.2.
WATG-32D and PC. 4.1. Connect ESP32-WATG-32D to PC Solder ESP32-WATG-32D module to the carrier board and connect carrier board to the PC using the USB-to-UART dongle. If device driver does not install automatically, identify USB to serial converter chip on your external USB-to-UART dongle, search for drivers in internet and install them.
Figure 4-2. Two USB Serial Ports of USB-to-UART dongle in Windows Device Manager 4.3. Check Port on Linux and MacOS To check the device name for the serial port of your USB-to-UART dongle, run this command two times, first with the dongle unplugged, then with plugged in. The port which appears the second time is the one you need: Linux ls /dev/tty*...
Page 16
Run terminal, set identified serial port, baud rate = 115200, data bits = 8, stop bits = 1, and parity = N. Below are example screen shots of setting the port and such transmission parameters (in short described as 115200-8-1-N) on Windows and Linux.
Page 17
ESP32 will boot and produce serial output. This depends on the hardware itself, most development boards (including all Espressif boards) do not have this issue. The issue is present if RTS & DTR are wired directly to the EN & GPIO0 pins. See the esptool documentation for more details.
Configure Enter hello_world directory and run menuconfig. Linux and MacOS cd ~/esp/hello_world idf.py -DIDF_TARGET=esp32 menuconfig You may need to run python2 idf.py on Python 3.0. Windows cd %userprofile%\esp\hello_world idf.py -DIDF_TARGET=esp32 menuconfig The Python 2.7 installer will attempt to configure Windows to associate a .py file with Python 2.
Build and Flash Now you can build and flash the application. Run: idf.py build This will compile the application and all the ESP-IDF components, generate bootloader, partition table, and application binaries, and flash these binaries to your ESP32 board. $ idf.py build Running cmake in directory /path/to/hello_world/build Executing "cmake -G Ninja --warn-uninitialized /path/to/hello_world"...
Flash onto the Device Flash the binaries that you just built onto your ESP32 board by running: idf.py -p PORT [-b BAUD] flash Replace PORT with your ESP32 board's serial port name. You can also change the flasher baud rate by replacing BAUD with the baud rate you need. The default baud rate is 460800.
IDF Monitor To check if "hello_world" is indeed running, type idf.py -p PORT monitor (Do not forget to replace PORT with your serial port name). This command launches the monitor application: $ idf.py -p /dev/ttyUSB0 monitor Running idf_monitor in directory [...]/esp/hello_world/build Executing "python [...]/esp-idf/tools/idf_monitor.py -b 115200 [...]/esp/hello_world/ build/hello-world.elf"... --- idf_monitor on /dev/ttyUSB0 115200 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- ets Jun 8 2016 00:22:57 rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) ets Jun 8 2016 00:22:57 ... After startup and diagnostic logs scroll up, you should see "Hello world!" printed out by the application.
Need help?
Do you have a question about the ESP32-WATG-32D and is the answer not in the manual?
Questions and answers