Place your clean.prn file (825KB) in the project root directory.
Windows (PowerShell - Recommended):
.\prepare_spiffs.ps1Windows (Command Prompt):
prepare_spiffs.batManual Method:
mkdir spiffs_data
copy clean.prn spiffs_data\
python %IDF_PATH%\components\spiffs\spiffsgen.py 1769472 spiffs_data spiffs_image.bin --page-size 256 --block-size 4096Replace COM3 with your actual COM port:
# Set target to ESP32-S3
idf.py set-target esp32s3
# Build the project
idf.py build
# Flash firmware and partitions
idf.py -p COM3 flash
# Flash SPIFFS image
esptool.py --chip esp32s3 --port COM3 --baud 460800 write_flash 0x150000 spiffs_image.bin
# Monitor output
idf.py -p COM3 monitorThe ESP32 will:
- Connect to printer WiFi Direct (your SSID from config.h)
- Send print job to printer on port 9100
- Print 4 colored squares
- Enter deep sleep for 3 days
- Wake up and repeat
- Copy config template:
cp main/config.h.example main/config.h - Edit
main/config.hwith your printer credentials:
#define WIFI_SSID "YOUR_PRINTER_SSID"
#define WIFI_PASS "YOUR_PRINTER_PASSWORD"
#define PRINTER_IP "192.168.114.1"
#define PRINTER_PORT 9100For testing, change sleep time to 1 minute in main/printer_cleaner_main.c:
#define SLEEP_TIME_SECONDS 60 // 1 minute instead of 3 daysThen rebuild and flash:
idf.py build flash| Problem | Solution |
|---|---|
| Can't find COM port | Use mode (Windows) or check Device Manager |
| SPIFFS mount failed | Re-flash SPIFFS image to 0x150000 |
| WiFi connection failed | Verify printer WiFi Direct is enabled |
| Print job fails | Test from PC first (see README) |
- USB Powered: Connect to USB power adapter
- Battery Powered: Use 3.7V LiPo battery with voltage regulator
- Estimated battery life: 10+ years with 1000mAh battery
For detailed information, see README.md