This guide covers how to run and interact with Carousel in different environments.
Carousel supports two operational modes:
Hardware-based operation using physical components:
- Input: GPIO hardware (tilt switch, rotary encoder)
- Display: LED matrix via rgbmatrix library
- Requirements: pigpio, gpiozero, rpi-rgb-led-matrix
- Permissions: Requires sudo for GPIO access
Software simulation for testing without hardware:
- Input: Keyboard simulation
- Display: Browser-based emulator
- Requirements: pynput, RGBMatrixEmulator
- Permissions: Regular user permissions
When running in emulator mode with --emulator flag:
| Key | Hardware Equivalent | Action | Timing |
|---|---|---|---|
| Space | Tilt Switch | Toggle orientation | Instant |
| Left Arrow | Encoder CCW | Rotate counter-clockwise | Per press |
| Right Arrow | Encoder CW | Rotate clockwise | Per press |
| Down Arrow (tap) | Encoder Button | Single press | Quick tap |
| Down Arrow (2x tap) | Encoder Button | Double press | Within 0.3 seconds |
| Down Arrow (hold) | Encoder Button | Long press | Hold for 0.5 seconds |
# Standard run
make run
# Run with debug logging
make dev# Run emulator with keyboard controls
make dev-emulatorThe emulator will:
- Start a web server on http://localhost:8000
- Open a browser window displaying the LED matrix
- Accept keyboard inputs for interaction
Note: You may see RuntimeError: This event loop is already running in the console. This is expected behavior with the emulator and can be safely ignored.
# Start containers
make docker-up
# View logs
make docker-logs
# Stop containers
make docker-down
# Restart containers
make docker-restartInitial environment setup for different deployment targets:
make setup-prod # Production: install dependencies + build hardware library
make setup-dev # Development: install emulator and keyboard input
make setup-docker # Docker: pull images and prepare environmentHardware-based execution on Raspberry Pi:
make install # Install production dependencies (GPIO libraries)
make build # Build rpi-rgb-led-matrix library (takes several minutes)
make example # Run LED matrix demo to test wiring
make run # Run Carousel on hardware
make dev # Run with debug-level console loggingDesktop testing without hardware:
make install-dev # Install emulator and keyboard input libraries
make dev-emulator # Run in browser emulator with keyboard controlsContainer-based deployment and management:
make docker-pull # Pull latest images from registry
make docker-up # Start containers in detached mode
make docker-down # Stop and remove containers
make docker-restart # Stop and restart containers
make docker-logs # View Carousel container logs (Ctrl+C to exit)
make docker-ps # List running containers
make docker-deploy # Pull images and start containers (initial deployment)
make docker-update # Pull latest images and recreate containers
make docker-clean # Remove containers and volumesCleanup and update operations:
make clean-python # Remove Python cache and bytecode files
make clean-library # Remove rpi-rgb-led-matrix build artifacts
make clean # Clean both Python and library artifacts
make clean-all # Clean everything including Docker resources
make update # Update repository and reinstall dependencies
make help # Display all available commandsCarousel stores configuration in YAML format:
- Location:
configs/directory - Active config: Determined by generation ID tracking
- Format: YAML with sections for System, Apps, and Modules
# Edit the active configuration
nano configs/example.config.yamlConfiguration changes for apps like Weather, Notion, or Spotify require API keys. Refer to the configuration guide for details.
Application logs are stored in the logs/ directory:
# View recent logs
tail -f logs/carousel.log
# View logs with timestamps
cat logs/carousel.log- Verify the browser window has focus
- Check pynput installation:
pip list | grep pynput - Look for "Keyboard input controller initialized" in logs
- Verify RGBMatrixEmulator installation:
pip list | grep RGBMatrixEmulator - Check that
--emulatorflag is being used - Review initialization logs for errors
- Ensure port 8000 is not in use:
lsof -i :8000
- This occurs when trying to run production mode on desktop
- Solution: Use
make dev-emulatorinstead ofmake run
- Development dependencies not installed
- Solution: Run
make install-dev
- Verify wiring connections against wiring guide
- Check power supply (5V 4A minimum recommended)
- Try adding
--led-no-hardware-pulseflag in Makefile - Ensure proper grounding connections
- Verify pigpiod service is running:
sudo systemctl status pigpiod - Restart pigpiod:
sudo systemctl restart pigpiod - Check GPIO permissions: run with sudo
- Test individual components with
make example - Verify GPIO pin assignments in configuration
- Check physical connections and solder joints
- Check Docker daemon:
sudo systemctl status docker - Verify images pulled:
docker images | grep carousel - Check logs:
make docker-logs - Restart Docker:
sudo systemctl restart docker
- Verify container is running:
make docker-ps - Check if ports are already in use
- Review Docker logs for errors
- Check Watchtower logs:
docker logs watchtower - Verify internet connectivity
- Ensure correct image tags in compose.yml
Quick reference for development mode:
| Action | Key Combination |
|---|---|
| Horizontal/Vertical | Space |
| Previous | Left Arrow |
| Next | Right Arrow |
| Select | Down (tap) |
| Quick Action | Down (double tap) |
| Menu | Down (hold) |
- Test locally first: Use
make dev-emulatorto verify changes - Use debug mode: Add
--debugflag for verbose logging - Incremental testing: Test each feature before moving to hardware
- Clean restarts: If behavior is unexpected, restart the application
- Initial setup: Use
make setup-prodfor first-time configuration - Test display: Run
make examplebefore full deployment - Monitor logs: Check logs regularly for errors
- Regular updates: Run
make updateperiodically
- Use Watchtower: Automatic updates check daily
- Monitor resources: Check container health with
make docker-ps - Backup configs: Keep configuration files backed up
- Review logs: Use
make docker-logsto monitor application health
To add custom applications:
- Create a new app in
src/apps/ - Extend
Applicationbase class - Implement
generate(tilt_state, encoder_input)method - Register in
AppManager._load_apps() - Add configuration in YAML config file
Refer to existing apps like gif_viewer.py for examples.
Docker supports running multiple isolated instances:
# Modify compose.yml to use different ports
# Run with custom compose file
docker compose -f docker/custom-compose.yml up -dSeveral apps support external API integration:
- Weather: OpenWeatherMap or AccuWeather API
- Notion: Notion API for todo lists
- Spotify: Spotify API for music control
Configure API keys in the YAML configuration file under the respective app's config section.
- Documentation: Browse the
docs/directory - Configuration: See configuration.md
- Wiring: See wiring.md
- Issues: Report bugs at GitHub Issues