This is a solution for communicating dirctly with Bluetooth/WIFI components through the web interfaces.
- Dev Board:blue、wifi(ESP32-C3)、board(CPU、USB、RGB、some basic meta electric unit)、data line
- MacOS:13.2 (22D49)
- Driver for the dev board(USB to serial port)
- Document for thr OTA‘s dev(esp-idf-v5.0.1)
- Package:Tool‘s chains for the OTA‘s dev(esp-idf-v5.0.1)
- bluetooth scan tool(chrome://bluetooth-internals/#devices)
-
Install CH340 development board serial port driver,download from development board manufacturer official website:Driver for the dev board(USB to serial port)
-
Looking at the equipment center, you can see that the development board is recognized normally, so as to confirm that the drive works normally
-
Install the dependencies needed to develop OTA:cmake、ninja、dfu-util、ccache、XCode command line tool, refer to the document provided by the chip manufacturer
-
Install the IDE required for OTA development, namely development tool chain esp-idf-v5.0.1,document provided by the chip manufacturer.Because of some reasons, "git clone" will be incomplete, so download it directly through the previous link, and finally ESP-IDF will be downloaded to ~/esp/esp-idf
-
Set up the tools,document provided by the chip manufacturer,Aside from the ESP-IDF, we also need to install the tools used by ESP-IDF, such as the compiler, debugger, Python packages, etc, for projects supporting ESP32-C3:
cd ~/esp/esp-idf
./install.sh esp32c3
- Set up the environment variables,document provided by the chip manufacturer, The installed tools are not yet added to the PATH environment variable. To make the tools usable from the command line, some environment variables must be set. ESP-IDF provides another script which does that:
. $HOME/esp/esp-idf/export.sh
Note the space between the leading dot and the path!
- OTA burning test,document provided by the chip manufacturer, we can start with get-started/hello_world project from examples directory in ESP-IDF, copy the project get-started/hello_world to ~/esp directory:
cd ~/esp
cp -r $IDF_PATH/examples/get-started/hello_world .
- Query the interface name of the dev board,document provided by the chip manufacturer, the dev board is connected to the mac, and the command line is input:
ls /dev/cu.*
The dev board name at this time: /dev/cu.usbserial-1450 /dev/cu.wchusbserial1450
- Configure OTA project, document provided by the chip manufacturer, Navigate to your hello_world directory, set ESP32-C3 as the target, and run the project configuration utility menuconfig
cd ~/esp/hello_world
idf.py set-target esp32c3
idf.py menuconfig
- Build&Compile OTA project, document provided by the chip manufacturer, Run command below will compile the application and all ESP-IDF components, then it will generate the bootloader, partition table, and application binaries
idf.py build
OTA Compiling... OTA Compiled!
- Flash OTA onto the device, document provided by the chip manufacturer, flash the binaries that you just built (bootloader.bin, partition-table.bin and hello_world.bin) onto your ESP32-C3 board by running:
idf.py -p /dev/cu.usbserial1450 flash
- Restart the dev board, Monitor the Output, document provided by the chip manufacturer, 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):
idf.py -p /dev/cu.usbserial-1450 monitor
You will see the warn prompt here. Just set the Flash Size to 4MB according to step 11. To exit IDF monitor use the shortcut Ctrl+].