Project was designed for XIAO ESP32C3 and Waveshare ESP32C3-Zero.
Compilable with Arduino and ESP-IDF.
docker build -t led_driver_idf -f Idf.Dockerfile . && docker run -it -p 8000:8000 led_driver_idf
# or
# docker build -t led_driver_arduino -f Arduino.Dockerfile . && docker run -it -p 8000:8000 led_driver_arduino
then open http://0.0.0.0:8000 in your browser and download a binary file.
You can aslo run a script which builds the image, runs the container, downloads this file automatically and removes the container:
./compile_with_docker.sh
The file iot-led-driver.bin can be uploaded on Configuration page in Update tab.
Before the compilation, it is required to compile resources to .cpp and .h files. It is also required after any modification of any file in the resources directory.
To compile resources, execute in the project directory:
python3 ./compilation_utils/compile_resources.py
On the first usage of microcontroller you should run idf.py erase_flash to ensure that flash partitions will be initialized properly.
Run idf.py build in the project directory.
Open the file main/main.ino in Arduino. Set the following parameters:
- board: ESP32C3 - Dev module (requires additional installation)
- CPU Frequency: 160MHz (default)
- Flash size: 4MB
- Partition scheme: Minimal SPIFFS (1.9MB APP with OTA / 190kB SPIFFS)
The runtime statistics are available on /statistics.txt endpoint.
The last system statistics:
=== Tasks info ===
Name | Ticks | CPU % | Free stack | Stack ptr
-----------------+--------------+-------+------------+------------
IDLE | 390961538 | 85% | 1240 | 0x3fca6ef8
loopTask | 34119316 | 7% | 3992 | 0x3fca87a8
knobs | 20251982 | 4% | 1488 | 0x3fcb55d0
wifi | 2405020 | 0% | 2128 | 0x3fcaedb0
tiT | 1366588 | 0% | 2744 | 0x3fcaad80
animations | 790686 | 0% | 1568 | 0x3fcb68a0
esp_timer | 786223 | 0% | 3672 | 0x3fca4be8
shutdown | 472535 | 0% | 1720 | 0x3fcb5f38
sys_evt | 8169 | 0% | 2152 | 0x3fcac204
mdns | 5225 | 0% | 3116 | 0x3fcb0fe4
arduino_events | 4456 | 0% | 2836 | 0x3fcad03c
Tmr Svc | 8 | 0% | 1792 | 0x3fca7660
=== Heap info ===
Total size: 247524
Minimum free heap: 111860 ( 45% )
Total free bytes: 155624 ( 62% )
Total allocated bytes: 91900 ( 37% )
Largest free block: 114688 ( 46% )
Blocks free: 10
Blocks allocated: 405
- Scan networks and find network with SSID
LedDriverand connect to them withledDriverpassword. Then type in browserhttp://192.168.1.1. - If you do not see any network with SSID
LedDriver, create it (as a Hotspot) on your phone with passwordledDriverand restart the driver. The Hotspot must work with WiFi 5 or an older version.
Unfortunately, there is no way to predetermine driver's IP address in a network other than its own AccessPoint.
The driver supports mDNS technology. After connecting to your network, try to enter the driver's hostname with suffix .local (f.e.: http://led-driver.local) in an address bar of a browser. Sometimes this technology requires a while to be detected by other devices in the network.
In case of using https protocol you may be warned about danger of self signed or untrusted certificate.
Skip it and/or add this certificate to exceptions.
Select one of four possible configurations:
- Multiplexer #1
- Multiplexer #2
- Multiplexer #3
- simple #1
- simple #2
- unconnected
Each configuration might be modified by disconnecting potentiometers or removing thermistors. The software matches pins automatically.
...and possible hardware configurations
| Pin | Name | XIAO | Waveshare | Multiplexer #1 | Multiplexer #2 | Multiplexer #3 | Simple #1 | Simple1 #2 | Comment |
|---|---|---|---|---|---|---|---|---|---|
| 1 | LNA_IN | ANT | ANT | ANT | ANT | ANT | ANT | ANT | |
| 2 | VDD3P3 | VCC 3,3 | VCC 3,3 | VCC 3,3 | VCC 3,3 | VCC 3,3 | VCC 3,3 | VCC 3,3 | |
| 3 | VDD3P3 | VCC 3,3 | VCC 3,3 | ||||||
| 4 | XTAL_32K_P | internal | GP0 | Cannot be connected during the booting (H/Z) | |||||
| 5 | XTAL_32K_N | internal | GP1 | Cannot be connected during the booting (H/Z) | |||||
| 6 | GPIO2 | D0 | GP2 | Mult COM | Mult COM | Mult COM | Potentiometer 0 | Potentiometer 0 | |
| 7 | EN | EN | |||||||
| 8 | GPIO3 | D1 | GP3 | H/Z | GND | UP | Potentiometer 1 | Potentiometer 1 | |
| 9 | MTMS | D2 | GP4 | FAN | FAN | FAN | Potentiometer 2 | Potentiometer 2 | |
| 10 | MTDI | D3 | GP5 | FLASH RST | FLASH RST | FLASH RST | FLASH RST | LED OUT 0 | |
| 11 | VDD3P3_RTC | VCC 3,3 | VCC 3,3 | ||||||
| 12 | MTCK | D4 | GP6 | Mult. SEL0 | Mult. SEL0 | Mult. SEL0 | FAN (short them all) | LED OUT 1 | |
| 13 | MTDO | D5 | GP7 | Mult. SEL1 | Mult. SEL1 | Mult. SEL1 | FAN (short them all) | LED OUT 2 | |
| 14 | GPIO8 | D8 | GP8 | LED OUT 1 | LED OUT 1 | LED OUT 1 | LED OUT 1 | LED OUT 3 | |
| 15 | GPIO9 | D9 | GP9 | LED OUT 2 | LED OUT 2 | LED OUT 2 | LED OUT 2 | FLASH RST | Pulled-up during the booting (internal) |
| 16 | GPIO10 | D10 | GP10 | LED OUT 3 | LED OUT 3 | LED OUT 3 | LED OUT 3 | FAN (short them all) | |
| 17 | VDD3P3_CPU | VCC 3,3 | VCC 3,3 | ||||||
| 18 | VDD_SPI | VDD SPI | VDD SPI | ||||||
| 19 | SPIHD | internal | internal | ||||||
| 20 | SPIWP | internal | internal | ||||||
| 21 | SPICS0 | internal | internal | ||||||
| 22 | SPICLK | internal | internal | ||||||
| 23 | SPID | internal | internal | ||||||
| 24 | SPIQ | internal | internal | ||||||
| 25 | GPIO18 | internal | ESP_USB_DP | ||||||
| 26 | GPIO19 | internal | ESP_USB_DM | ||||||
| 27 | U0RXD | D7 | GP20 | LED OUT 0 | LED OUT 0 | LED OUT 0 | LED OUT 0 | ||
| 28 | U0TXD | D6 | GP21 | Mult. SEL2 | Mult. SEL2 | Mult. SEL2 | FAN (short them all) | FAN (short them all) | |
| 29 | XTAL_N | internal | internal | ||||||
| 30 | XTAL_P | internal | internal | ||||||
| 31 | VDDA | internal | internal | ||||||
| 32 | VDDA | internal | internal | ||||||
| 33 | GND | GND | GND | ||||||
| Mult. Ch0 | Thermistor 0 | Potentiometer 0 | Thermistor 0 | ||||||
| Mult. Ch1 | Thermistor 1 | Potentiometer 1 | Thermistor 1 | ||||||
| Mult. Ch2 | Thermistor 2 | Potentiometer 2 | Thermistor 2 | ||||||
| Mult. Ch3 | Thermistor 3 | Potentiometer 3 | Thermistor 3 | ||||||
| Mult. Ch4 | Potentiometer 0 | ||||||||
| Mult. Ch5 | Potentiometer 1 | ||||||||
| Mult. Ch6 | Potentiometer 2 | ||||||||
| Mult. Ch7 | Potentiometer 3 |









