Title: Learning Signals Description: Capture IR buttons and remotes with GhostESP URL: /latest/infrared/learning/ Version: latest Section: Infrared Search index: /search-index.json # Learning Signals > Capture IR buttons and remotes with GhostESP ## On this page - [Before You Start](#before-you-start) - [Learn a Remote or Button](#learn-a-remote-or-button) - [Storage Layout](#storage-layout) - [Tips](#tips) - [CLI Support](#cli-support) - [Manual File Creation](#manual-file-creation) --- ## Before You Start - Hardware: Board with IR RX support (see [hardware requirements](/latest/infrared/hardware/)). - SD card: Inserted and mounted so GhostESP can save .ir files under /mnt/ghostesp/infrared/. - Easy Learn: Optional assistant that suggests button names. Toggle via settings. ## Learn a Remote or Button - Open Infrared and choose Learn Remote to learn a new remote. To add a button to an existing remote, open the remote file and choose Add Signal. - Align the source remote with the IR receiver window, hold it steady within a few centimeters, then press the button once. - Confirm the button name. Easy Learn provides a suggested label during learning, otherwise use the on-screen keyboard. - Watch the preview popup for protocol name and decoded address/command details. If a known protocol decodes as RAW, cancel and retry. - Confirm to save. GhostESP will create a new .ir file for fresh remotes or append the button to the currently open file automatically. ### Storage Layout - New remotes are written to /mnt/ghostesp/infrared/remotes/<name>.ir. - Adding to an existing remote appends another named button block inside the same .ir file. ### Tips - Keep the remote within a few centimeters of the receiver and avoid direct sunlight. - If learning fails, exit and re-open the Infrared learning popup to try to reinitialize the IR RX channel (uses GPIO interrupts, not RMT). ## CLI Support You can learn signals via the CLI using ir learn. # Learn a signal and auto-save to a new file under /mnt/ghostesp/infrared/remotes ir learn # Learn and append to a specific file ir learn /mnt/ghostesp/infrared/remotes/my_remote.ir - Without a path, GhostESP generates a new .ir file named Learned_<protocol>_<address>_<command>.ir (or Learned_RAW_<timestamp>.ir for RAW captures) in /mnt/ghostesp/infrared/remotes/. - With a path, the learned signal is appended to the given .ir file. ### Manual File Creation You can manually create .ir files if you know the protocol details. Save them as text files with the .ir extension in /mnt/ghostesp/infrared/remotes/. Example .ir file content: Filetype: IR signals file Version: 1 name: Power type: parsed protocol: NEC address: 00 FF command: 00 FF