# IR Controller Setup Guide ## Overview This guide will help you set up your IR remote controller for use with the video player system. The setup process will map each button on your remote to specific functions. ## Quick Start ### Option 1: Automated Setup (Recommended) ```bash cd /home/tulivision/rpi-tulivision ./setup_controller.sh ``` This script will: 1. Integrate the custom protocol decoder into your IR system 2. Guide you through mapping all remote buttons 3. Save the mappings for use by other services ### Option 2: Manual Setup ```bash cd /home/tulivision/rpi-tulivision python3 quick_controller_setup.py ``` ## Setup Process The setup will ask you to press buttons in this order: 1. **Power Toggle** - Power on/off button 2. **Channel 1-9, 0** - Channel selection buttons 3. **Volume Up/Down** - Volume control buttons 4. **Mute** - Mute button 5. **Play/Pause** - Play/pause button 6. **Stop** - Stop button 7. **Next/Previous Channel** - Channel navigation 8. **Menu** - Menu button 9. **Back** - Back button 10. **OK** - OK/Enter button 11. **Arrow Keys** - Up, Down, Left, Right navigation ## Instructions 1. **Point your remote** at the IR receiver on the Raspberry Pi 2. **When prompted**, press the corresponding button on your remote 3. **Wait for confirmation** that the command was recorded 4. **Continue** with the next button 5. **Skip or retry** if a button doesn't work ## Output Format The mappings will be saved in `ir_mapping.json` in the format expected by other services: ```json { "CUSTOM_BF00_AD52": { "command": "power_toggle", "description": "Power on/off button", "repeatable": false }, "CUSTOM_BF00_AF50": { "command": "channel_1", "description": "Channel 1 button", "repeatable": false } } ``` ## Testing After setup, test your mappings: ```bash # Test IR listener with verbose output python3 simple_ir_listener_polling.py --verbose # Test with video player python3 video_player.py ``` ## Troubleshooting ### No IR Commands Detected - Check IR receiver connection - Ensure remote has batteries - Point remote directly at receiver - Try different buttons ### Setup Interrupted - Run the setup script again - You can skip buttons you don't have - Press Ctrl+C to exit anytime ### Mappings Not Working - Check that `ir_mapping.json` was created - Verify the custom protocol decoder is integrated - Test with verbose IR listener ## Files Created - `ir_mapping.json` - Command mappings for other services - `backup_ir_system/` - Backup of original IR system files ## Integration The mappings are automatically integrated into your IR system and will work with: - Video player control - Channel switching - Volume control - Menu navigation ## Support If you encounter issues: 1. Check the troubleshooting section above 2. Verify IR receiver hardware is working 3. Test with known working remotes first 4. Check system logs for errors --- **Ready to start?** Run `./setup_controller.sh` to begin! 🎯