Skip to content

The solution for communicating with WebBluetooth/WIFI/etc between devices and web

Notifications You must be signed in to change notification settings

BlessedChild/TimeTree

Repository files navigation

Introduction

This is a solution for communicating dirctly with Bluetooth/WIFI components through the web interfaces.

Development environment

Background of the project

avatar

Development environment deployment

  1. Install CH340 development board serial port driver,download from development board manufacturer official website:Driver for the dev board(USB to serial port) avatar

  2. Connecting hardware(requires supportting by the data line) avatar

  3. Install the driver and "refresh" the equipment center avatar

  4. Looking at the equipment center, you can see that the development board is recognized normally, so as to confirm that the drive works normally avatar

  5. 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 avatar

  6. Install the IDE required for OTA development, namely development tool chain esp-idf-v5.0.1document 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 avatar avatar

  7. 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

avatar

  1. 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! avatar

  1. 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 .

avatar

  1. 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.*

avatar The dev board name at this time: /dev/cu.usbserial-1450 /dev/cu.wchusbserial1450

  1. 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

avatar Set Flash Size to 4MB avatar

  1. 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... avatar OTA Compiled! avatar

  1. 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

Flashing... avatar Flashed! avatar

  1. 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

avatar You will see the warn prompt here. Just set the Flash Size to 4MB according to step 11. avatar To exit IDF monitor use the shortcut Ctrl+].

Releases

No releases published

Packages

No packages published