4f574fb65cd5e629bb40dafcf77593057a9d53f2
- rename printer protocol helpers to driver-centric names\n- remove image download coex preference code and config\n- drop esp_coex dependency from domain\n- remove unused set_black helper to keep build warning-free
ESP32-S3 TQ Thermal Printer Firmware (No Business HTTP Server)
This firmware now runs in printer mode and does not expose the previous
business REST endpoints (/v1/*).
Features
- Thermal printer driver (single printer path)
- Auto-initialize printer driver during startup
- Async print queue and worker lifecycle management
- Printer precheck (paper / battery / temperature)
- MIC key push-to-talk voice flow (button-triggered, no HTTP trigger)
- Wi-Fi STA with SoftAP provisioning fallback
- Provisioning portal page at
http://192.168.4.1(unchanged) - Optional DashScope Z-Image integration for image generation
What Was Removed
- Business HTTP server in
control_plane(including previous/,/v1/health,/v1/printer/*,/v1/print/*,/v1/jobs*,/v1/voice/*endpoints) - Related Kconfig items:
TQ_HTTP_PORTTQ_API_KEY
Build
Prerequisites:
- ESP-IDF v5.x
- ESP32-S3 board
cd ai_printer
idf.py set-target esp32s3
idf.py menuconfig
idf.py build
Flash
cd ai_printer
idf.py -p /dev/tty.usbmodemXXXX flash monitor
Config
In menuconfig -> TQ Printer Config:
- Wi-Fi provisioning:
TQ_WIFI_PROV_SOFTAP_SSIDTQ_WIFI_PROV_SOFTAP_PASSWORDTQ_WIFI_PROV_SOFTAP_CHANNELTQ_WIFI_PROV_SOFTAP_MAX_CONN
- Thermal printer runtime and safety policy:
TQ_PRINTER_*
- Z-Image HTTP fields:
TQ_Z_IMAGE_API_KEY(optional, empty means fallback toTQ_VOICE_API_KEY)TQ_Z_IMAGE_API_ENDPOINTTQ_Z_IMAGE_MODELTQ_Z_IMAGE_DEFAULT_SIZETQ_Z_IMAGE_TIMEOUT_MSTQ_Z_IMAGE_DOWNLOAD_TIMEOUT_MS
- Voice and audio fields (used by MIC key push-to-talk flow):
TQ_VOICE_*
- Board GPIO map:
TQ_POWER_*,TQ_LED_*,TQ_SCREEN_*,TQ_PRINT_*,TQ_SPI_*TQ_KEY_PRINT_BOOST_ENABLE_ON_BOOT/TQ_KEY_PRINT_BOOST_ACTIVE_HIGH
- ST7789 screen fields:
TQ_SCREEN_ENABLETQ_SCREEN_TEST_PATTERN_ON_BOOTTQ_SCREEN_PIXEL_CLOCK_HZTQ_SCREEN_SPI_MODETQ_SCREEN_H_RES/TQ_SCREEN_V_RESTQ_SCREEN_DRAW_LINESTQ_SCREEN_COLOR_ORDER_BGRTQ_SCREEN_BACKLIGHT_ACTIVE_HIGHTQ_SCREEN_MIRROR_*/TQ_SCREEN_SWAP_XYTQ_SCREEN_X_GAP/TQ_SCREEN_Y_GAPTQ_SCREEN_RESET_PIN
Board pin assignment reference:
Wi-Fi Provisioning Behavior
- Device first tries saved STA credentials from NVS (
wifi_cfgnamespace) - If credentials are invalid or STA connect fails, device starts SoftAP portal
- Open
http://192.168.4.1and submit credentials from the provisioning page - Provisioning page supports Chinese/English switching and local language cache
- Credentials are written to NVS only after STA connect succeeds
Notes
- This project no longer provides business HTTP API endpoints for print/voice/job control.
- SoftAP provisioning HTTP service remains enabled by design.
- UTF-8 Chinese text rendering uses embedded 16x16 GB2312 glyphs.
- Large image buffers prefer PSRAM, then fall back to internal RAM.
- Partition table uses
partitions.csvwith a 4MBfactoryapp partition on 16MB flash modules.
Font Assets
Embedded files:
components/domain/assets/fonts/cn16_index.bincomponents/domain/assets/fonts/cn16_glyphs.bin
Regenerate from your own CJK font:
cd ai_printer
python3 -m pip install --user pillow
python3 tools/gen_cn16_font.py \
--font app/src/main/assets/fonts/msyh.ttc \
--font-index 0
Description
Languages
C
67.4%
Python
29.2%
HTML
2.9%
CMake
0.5%