Dual-mode NFC firmware for LilyGO T-Embed CC1101 and T-Embed CC1101 Plus (ESP32-S3 + PN532 + ST7789).
It toggles on-the-fly between:
- USB HID Keyboard: Standalone badge reader. Reads ISO14443A / MIFARE / NTAG cards and types the hexadecimal UID followed by
Enter. Single-shot capture prevents duplicate keystrokes while the tag remains on the antenna. - libnfc Serial Bridge (
pn532_uartover USB CDC): Transparent serial bridge for PC security auditing tools (nfc-list,mfoc,mfcuk,nfc-mfclassic) on Linux, Kali Linux, and VirtualBox VMs (/dev/ttyACM0at 115200 baud). Uses single-shot atomic I2C reads to prevent byte-shift checksum errors.
Features a Copland OS inspired interface on the 320x170 ST7789 IPS display with real-time RX/TX frame counters.
| Input | Action |
|---|---|
| Rotary Dial (CW) | Switch to LIBNFC BRIDGE mode |
| Rotary Dial (CCW) | Switch to HID KEYBOARD mode |
| Center Knob Click (<400ms) | Toggle operating mode |
| User Button Click (<400ms) | Toggle operating mode |
| Knob / Button Hold (>3s) | Deep Sleep power down |
- Copy
NAVI-Embed.binto your MicroSD card. - Boot into bmorcelli / Launcher.
- Select
NAVI-Embed.binand launch.
Windows (PowerShell):
python -m esptool --chip esp32s3 -p COMx -b 921600 write_flash 0x0 NAVI-Embed.binLinux / macOS:
esptool.py --chip esp32s3 -p /dev/ttyACM0 -b 921600 write_flash 0x0 NAVI-Embed.bin- Forward the USB device (
303a:1001) to the VM. - Disable ModemManager to prevent serial port lockouts:
sudo systemctl stop ModemManager sudo systemctl disable ModemManager
- Configure
/etc/nfc/libnfc.conf:device.name = "LilyGO T-Embed PN532" device.connstring = "pn532_uart:/dev/ttyACM0" allow_autoscan = false allow_intrusive_scan = false
- Switch T-Embed to
MODE:[LIBNFC BRIDGE]and run:sudo nfc-list sudo mfoc -O dump.mfd
| Function | Pin | Notes |
|---|---|---|
| PN532 I2C SDA / SCL | GPIO 18 / GPIO 8 | 100 kHz bus, Address 0x24 |
| PN532 IRQ / Reset | GPIO 1 / GPIO 3 | Active LOW IRQ |
| ST7789 MOSI / SCLK | GPIO 9 / GPIO 11 | 40 MHz SPI |
| ST7789 CS / DC / BL | GPIO 41 / GPIO 16 / GPIO 21 | Backlight active HIGH |
| Encoder A / B / Key | GPIO 4 / GPIO 5 / GPIO 0 | Pull-up enabled |
| User Button | GPIO 6 | Pull-up enabled |
| Power Enable | GPIO 15 / GPIO 46 | VDD enable (Standard & Plus) |
git clone https://github.com/your-username/NAVI-Embed.git
cd NAVI-Embed
pio runGenerate the unified binary:
python -m esptool --chip esp32s3 merge_bin -o bin/NAVI-Embed.bin --flash_mode qio --flash_size 16MB 0x0 .pio/build/lilygo-t-embed-cc1101/bootloader.bin 0x8000 .pio/build/lilygo-t-embed-cc1101/partitions.bin 0x10000 .pio/build/lilygo-t-embed-cc1101/firmware.binMIT License.