Claude 64475dbf5e Fix install.sh and setup.sh for macOS compatibility
install.sh:
- Add SCRIPT_DIR so .env is written to the repo root regardless of cwd
- Detect OS (macOS/Linux) and show platform-appropriate missing-tool hints
- Check for Xcode Command Line Tools on macOS (required by IDF install.sh)
- Handle pip3 absence by falling back to python3 -m pip
- Remove ninja from hard prerequisite list (IDF bundles its own)

setup.sh:
- Show macOS serial port hint (/dev/cu.usbserial-*) vs Linux (/dev/ttyUSB0)
- Show macOS SD card mount hint (/Volumes/) vs Linux (/media/$USER/)

https://claude.ai/code/session_01MhAnh68DPNnTjcKqjNYDmk
2026-06-13 07:34:36 +00:00
2021-12-26 14:05:02 +01:00
2021-12-30 23:43:44 +01:00

Kidsbox

A battery-powered, RFID/NFC-tag-controlled audio player for kids. Place an NFC tag on the box — the mapped audio file or stream plays automatically. Tags are programmed from a smartphone using any NFC writing app (e.g. NFC Tools). The box streams from the URL written to the tag, caches it locally for offline play, and exposes a web interface for playback control and storage management.

Front Side
Frontal View Side View

Quick Start

1. Install the development environment

./install.sh

This installs ESP-IDF v5.2 and ESP-ADF v2.7 into ~/esp/ and writes a .env file. Existing installations are detected automatically (via $IDF_PATH / $ADF_PATH).

2. Configure and build

source .env && source $IDF_PATH/export.sh
./setup.sh

setup.sh will:

  • Prompt for your WiFi SSID and password
  • Build the firmware (idf.py build)
  • Optionally flash to the device
  • Optionally prepare an SD card (create directories, copy web UI)

How It Works

  1. Write an audio URL to an NFC tag with a smartphone app (e.g. NFC Tools).
  2. Place the tag on the box → the box reads the URL, streams the audio, and caches it.
  3. Subsequent plays of the same tag use the local cache (no internet needed).
  4. Removing the tag pauses playback; replacing it resumes.

Without an NDEF URL on a tag, the box falls back to a local mapping file at /sdcard/internal/<tag-id> (plain text, one URL or file path per file).


Web Interface

Once connected to WiFi, open http://<device-ip> in a browser.

Section What it does
Now Playing Track URI, play/pause/stop, volume slider
Device Info IP address, playback status, cache size, free heap
Storage List and delete cached files
Bluetooth Toggle BT speaker mode (stub — in progress)

Hardware

Parts

Part Links
ESP32-LyraT 4.3 Mouser
RC522 RFID/NFC module —
SD card (FAT32, any size) —

DIP-Switch (LyraT 4.3)

Switch Position Purpose
1 OFF Disconnects GPIO 12 from SD-D2
2 OFF Disconnects GPIO 13 from SD-D3
3 OFF Connects GPIO 15 to SD CMD
4 ON Connects GPIO 13 to JTAG header
5 ON Connects GPIO 12 to JTAG header
6 OFF Connects GPIO 13 to SD CLK
7 OFF Disconnects GPIO 12 from AUX-in detection
8 OFF —

RC522 Wiring

MISO/MOSI pin names are not inverted between host and chip on this board.

RC522 Pin LyraT v4.3 Pin GPIO
3.3V 3.3V —
RST 3.3V —
GND GND —
SDA I2C SDA 18
SCK I2C SCL 23
MOSI JTAG MTCK 13
MISO JTAG MTDI 12

SD Card Layout

/sdcard/
  www/          ← web interface files (copied by setup.sh)
  internal/     ← tag-id → URL/path mapping files (manual)
  cache/        ← downloaded audio files (managed automatically)

Roadmap

  • RFID/NFC tag detection
  • NDEF URL reading from NFC tags
  • HTTP audio streaming
  • Local file cache
  • WiFi (native ESP-IDF, no Arduino dependency)
  • Web interface — playback controls, storage, device info
  • Volume buttons (hardware)
  • Playlists
  • Bluetooth speaker mode (A2DP sink)
S
Description
A free and open audioplayer for kids, based on the ESP-Lyrat audio board
Readme
3.9 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 61.4%
C++ 33.8%
CMake 1.9%
JavaScript 1%
HTML 1%
Other 0.9%