# ESP32-S3 USB serial devices (bd-wim1)
#
# ESP32-S3 BALANCE (Waveshare LCD 1.28) — USB CDC via CH343 USB-UART chip
#   Appears as /dev/ttyACM0, symlinked to /dev/esp32-balance
#   idVendor  = 1a86  (QinHeng Electronics / WCH)
#   idProduct = 55d4  (CH343 USB-UART)
#
# ESP32-S3 IO (bare board JTAG USB) — native USB CDC
#   Appears as /dev/ttyACM1, symlinked to /dev/esp32-io
#   idVendor  = 303a  (Espressif)
#   idProduct = 1001  (ESP32-S3 USB CDC)
#
# Install:
#   sudo cp 80-esp32.rules /etc/udev/rules.d/
#   sudo udevadm control --reload && sudo udevadm trigger
#
# Verify:
#   ls -la /dev/esp32-*
#   python3 -c "import serial; s=serial.Serial('/dev/esp32-balance', 460800); s.close(); print('OK')"

# ESP32-S3 BALANCE — CH343 USB-UART (bd-wim1 UART serial bridge)
SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="55d4", \
    SYMLINK+="esp32-balance", \
    TAG+="systemd", \
    MODE="0660", GROUP="dialout"

# ESP32-S3 IO — Espressif native USB CDC
SUBSYSTEM=="tty", ATTRS{idVendor}=="303a", ATTRS{idProduct}=="1001", \
    SYMLINK+="esp32-io", \
    TAG+="systemd", \
    MODE="0660", GROUP="dialout"
