This is a small ESP32 application displaying real-time temperature and relative humidity information on a 4-digit 7 segment display. The applied temperature and humidity sensor is DHT22, The 4-digit 7 segment display is TM1637. The application is based on ESP32Basic lightweight framework (i.e., it does not depend on ESP-IDF).
Note, both projects (esp32basic and this one) are in development phase, and the version-dependency is not set yet.
The required components, wiring, etc. are described in src/README.md.
Either clone the git source or download and extract the zip. Cloning git source is preferred. It is easier to update.
First, you need to run aclocal.
Next, run autoheader and autoconf.
Finally, run automake --add-missing.
aclocal
autoheader
autoconf
automake --add-missingThe INSTALL file describes the general way of the installation of an automake project.
Here, we present the specialities, so the
./configure
make
make installcommand sequence is slightly modified.
-
Usually, it is a good idea to do VPATH Builds. We encourage you to create at least a performance build in
dist/perf(with-O2compiler option) and a debug build indist/debug(with-O0 -gcompiler options). -
As the target platform is ESP32, we have to use the
xtensa-elf-esptoolchain. In order to use thextensa-esp-elftoolchain, you have to call the configure script with option--host=xtensa-esp32-elf. Also set optionhost_alias=xtensa-esp32-elf. Further reading: online manual. -
This project depends on
esp32basic(libs and headers). You have to specify the installation location ofesp32basic:--with-e32bdir=PATH_TO_ESP32BASIC_INSTALLATION. -
Currently, some commonly used compiler options are not configured automatically. Thus you have to configure them manually (define in
CFLAGSfor theconfigurescript):-Werror -nostdlib -mlongcalls -std=c11 -flto
My performance VPATH build configuration 'script' looks like this:
mkdir -p dist/perf
cd dist/perf
../../configure --host=xtensa-esp32-elf 'CFLAGS=-O2 -Wall -Werror -nostdlib -mlongcalls -std=c11 -flto' host_alias=xtensa-esp32-elf --with-e32bdir=/home/szigeti/local/esp32
Build is started by command
make
within dist/perf. If everything goes well, it produces src/temphum.bin relative to dist/perf.
If your ESP32 is bound with UART ↔ USB adapter, e.g., CP2102, like in NodeMCU-ESP32S, installation is simple via USB port.
To install (i.e., write the binary to the ESP32 board) via USB, you can use scripts/flash.sh:
../../scripts/flash.sh src/temphum.bin