### Install emu Utilities on Comma.ai Device Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Installs the emu command-line utility on a comma.ai device via SSH. It downloads and executes an installation script, sources the bashrc to enable emu immediately, and provides a verification step. ```bash # Install emu utilities on your comma.ai device bash <(curl -fsSL install.emu.sh) # Source the bashrc to enable emu immediately source /data/community/.bashrc # Verify installation emu ``` -------------------------------- ### Install Emu-sh Utilities Source: https://github.com/emu-sh/.oh-my-comma/blob/master/README.md Installs the emu-sh utilities by downloading and executing a bash script. It then sources the .bashrc file to make the utilities available in the current session. Ensure you are SSH'd into your comma device running neos. ```bash bash <(curl -fsSL install.emu.sh) # the brain of the bird source /data/community/.bashrc ``` -------------------------------- ### List Installed Openpilot Forks and Branches Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Displays a list of all installed openpilot forks and their available branches. It indicates the currently active fork and branch. Users can also list branches for a specific fork. ```bash # List all installed forks emu fork list # Expected output: # Installed forks: # - commaai (current) # Branches: # - release2 (current) # - master # - sshane # Branches: # - devel # - ...see more branches: emu fork list sshane # List branches for a specific fork emu fork list sshane # Expected output: # Installed branches for sshane: # - devel # - stock-additions # - release2 ``` -------------------------------- ### Manage Installed Forks Source: https://github.com/emu-sh/.oh-my-comma/blob/master/README.md Provides tools for managing installed openpilot forks. This includes installing new forks, switching between them, and listing available forks and branches. The 'fork' command is an alias for 'emu fork switch'. ```bash emu fork ``` ```bash emu fork switch ``` ```bash emu fork list ``` ```bash fork ``` -------------------------------- ### ForkParams API for Fork Management Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt The ForkParams class provides persistent storage for fork management configuration, storing current fork, branch, installed forks, and setup state in a JSON file. ```python from commands.fork import ForkParams # Initialize fork parameters (loads from /data/community/forks.json) fork_params = ForkParams() # Get current fork and branch current_fork = fork_params.get('current_fork') # e.g., 'commaai' current_branch = fork_params.get('current_branch') # e.g., 'release2' # Get all installed forks installed_forks = fork_params.get('installed_forks') # Returns: {'commaai': {'installed_branches': ['release2', 'master']}, ...} # Check if setup is complete is_setup = fork_params.get('setup_complete') # True/False # Update a parameter fork_params.put('current_fork', 'sshane') fork_params.put('current_branch', 'devel') # Reset to defaults fork_params.reset() ``` -------------------------------- ### Log Controlsd Process Source: https://github.com/emu-sh/.oh-my-comma/blob/master/README.md Starts logging the controlsd process to a file named /data/output.log by default. This is a debugging tool to help diagnose issues with the controlsd service. ```bash emu debug controlsd ``` -------------------------------- ### Edit .bashrc Configuration Source: https://github.com/emu-sh/.oh-my-comma/blob/master/default-bashrcs/README.md This snippet shows the commands to navigate to the community directory and edit the .bashrc file using the vi editor. This is useful for customizing your shell environment after installation. ```bash cd /data/community/ ls -al vi .bashrc ``` -------------------------------- ### Update Emu-sh Utilities Source: https://github.com/emu-sh/.oh-my-comma/blob/master/README.md Updates the emu-sh tool to the latest version. This command performs a git pull in the installation directory and replaces existing files if an update is available. It also verifies the integrity of essential configuration files. ```bash emu update ``` -------------------------------- ### Uninstall emu from Comma Device Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Completely removes the emu utility from a comma device. It deletes configuration files like .bashrc and the oh-my-comma directory. Optionally, it can also uninstall the powerline-shell if it was installed. ```bash # Uninstall emu (prompts for confirmation) emu uninstall # Expected output: # Are you sure you want to uninstall emu? # [Y/n]: y # Deleting /data/community/.bashrc # Deleting /data/community/.oh-my-comma # Uninstalled! ``` -------------------------------- ### Open Device Settings App Source: https://github.com/emu-sh/.oh-my-comma/blob/master/README.md Launches the device's native Settings application. This provides quick access to system configurations and options. ```bash emu device settings ``` -------------------------------- ### Switch Between Openpilot Forks Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Allows switching between different openpilot forks by username, supporting specific branches and custom repositories. It utilizes git remotes for efficient management and offers a shorthand alias for convenience. Force checkout is available to discard local changes. ```bash # Switch to stock openpilot (commaai) emu fork switch stock # Switch to a specific user's fork emu fork switch sshane # Switch to a specific fork and branch emu fork switch dragonpilot-community -b devel-i18n # Switch branch on current fork (using -b flag only) emu fork switch -b release3 # Force checkout (discard local changes) emu fork switch commaai -b master -f # Use fork:branch syntax (from GitHub PR references) emu fork switch sshane:devel # Use custom repository name if fork isn't named "openpilot" emu fork switch myuser -r my-openpilot-fork -b main # Shorthand alias fork stock devel ``` -------------------------------- ### Configure Git for Pushing Changes Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Configures git credentials to push changes from a comma device to a fork. This process requires temporarily remounting the system partition as writable. ```bash # Mount system as writable mount -o rw,remount /system # Configure git user git config --global user.name "your_username" git config --global user.email "your_email@example.com" # Store credentials (will prompt on first push) git config --global credential.helper store # Remount system as read-only mount -o r,remount /system # Now you can push changes to your fork cd /data/openpilot git add . git commit -m "Your changes" git push ``` -------------------------------- ### Manage Emu Device Settings App Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Opens or closes the Android Settings app on EON devices. This is useful for accessing system settings during development. ```bash # Open the Settings app (EON only) ému device settings # Close the Settings app ému device settings -c ému device settings --close # Shorthand alias settings ``` -------------------------------- ### Flash Panda Hardware using Python Module Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Provides an alternative and often more reliable method for flashing panda hardware, especially on EON devices. This command utilizes the Python Panda module and ensures the boardd process is terminated before initiating the flash. ```bash # Flash panda using Panda Python module (recommended for EON) emu panda flash2 # This command: # 1. Kills the boardd process if running # 2. Uses the Panda Python module to flash firmware ``` -------------------------------- ### Emu Command Line Aliases Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Lists available shell aliases provided by emu for frequently used commands. These aliases are automatically loaded when the community bashrc is sourced. ```bash # Available aliases after installation ll # ls -lAh (detailed file listing) pf # emu panda flash controlsd # emu debug controlsd reload # emu debug reload battery # emu device battery shutdown # emu device shutdown settings # emu device settings fork # emu fork switch ``` -------------------------------- ### Configure Git for Pushing Changes Source: https://github.com/emu-sh/.oh-my-comma/blob/master/README.md Configures Git globally to allow pushing changes to repositories. This involves making the system filesystem writable, setting the user's name and email, configuring the credential helper, and then pulling any updates before remounting the filesystem as read-only. ```bash mount -o rw,remount /system git config --global user.name "your_username" git config --global user.email "your_email_address@example.com" git config --global credential.helper store git pull mount -o r,remount /system ``` -------------------------------- ### Flash Panda Hardware using Make Recover Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Flashes the panda hardware (CAN interface board) using the 'make recover' method, commonly used for Comma 2 devices. This command initiates the panda board recovery process directly from the openpilot source code. ```bash # Flash panda using make recover (recommended for Comma 2) emu panda flash # Shorthand alias pf ``` -------------------------------- ### Emu Utility Functions for Scripting Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Provides utility functions for running commands, displaying messages, and interacting with the user programmatically within emu scripts. ```python from py_utils.emu_utils import ( run, check_output, kill, is_affirmative, error, warning, success, info, most_similar ) # Run a command and get success status if run(['git', 'pull']): success('Git pull completed!') else: error('Git pull failed!') # Run a command and capture output result = check_output(['git', 'status']) if result.success: print(result.output) else: error(result.output) # Kill a process by name killed = kill('controlsd') if killed: info('Killed controlsd') elif killed is None: warning('Process not running') # Prompt user for confirmation info('Do you want to continue?') if is_affirmative(): # Accepts y, yes, sure, or empty input success('Continuing...') else: error('Cancelled!') # Find most similar string from options (fuzzy matching) branches = ['release2', 'release3', 'devel', 'master'] matches = most_similar('releas', branches) ``` -------------------------------- ### Flash Panda using Panda Module (EON) Source: https://github.com/emu-sh/.oh-my-comma/blob/master/README.md Flashes the Panda hardware using the Panda Python module, which is generally suitable for the EON device. This command is part of the emu panda interfacing tools. ```bash emu panda flash2 ``` -------------------------------- ### Log Controlsd Process Output for Debugging Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Logs the output of the controlsd process, the core control loop in openpilot, to a file for debugging. This command terminates the existing controlsd process and restarts it with logging enabled. A custom log file path can be specified. ```bash # Log controlsd to default location (/data/output.log) emu debug controlsd # Log to a custom file emu debug controlsd -o /data/controlsd_debug.log # Shorthand alias controlsd # View the log in real-time tail -f /data/output.log ``` -------------------------------- ### Safely Reboot Device Source: https://github.com/emu-sh/.oh-my-comma/blob/master/README.md Initiates a safe reboot sequence for the comma device. This ensures that all processes are shut down gracefully before the system restarts. ```bash emu device reboot ``` -------------------------------- ### Reload Openpilot Tmux Session Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Kills the current openpilot tmux session and restarts it without requiring a device reboot. This is a convenient command for quickly testing changes made to the openpilot code. Confirmation is required before proceeding. ```bash # Reload openpilot (prompts for confirmation) emu debug reload # Expected output: # This will kill the current openpilot tmux session, set up a new one, and relaunch openpilot. # Confirm you would like to continue # [Y/n]: y ``` -------------------------------- ### Shutdown or Reboot Emu Device Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Safely shuts down the comma device. An optional flag allows for rebooting instead of a full shutdown. ```bash # Shutdown the device ému device shutdown # Shutdown with reboot flag (alternative to device reboot) ému device shutdown --reboot # Shorthand alias shutdown ``` -------------------------------- ### Update emu Utility to Latest Version Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Updates the emu utility to its latest version from the git repository. This process replaces existing files and verifies the integrity of system files like bashrc and powerline configurations. A restart of the SSH session is recommended after updating. ```bash # Update emu to the latest version emu update # After updating, restart your SSH session for changes to take effect exit ssh comma # reconnect ``` -------------------------------- ### Safely Shutdown Device Source: https://github.com/emu-sh/.oh-my-comma/blob/master/README.md Initiates a safe shutdown sequence for the comma device. This ensures that all processes are terminated properly before the device powers off. ```bash emu device shutdown ``` -------------------------------- ### Reboot Emu Device Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Safely reboots the comma device. It utilizes the appropriate system command based on the platform, such as an Android intent for EON devices or 'sudo reboot' for TICI. ```bash # Reboot the device ému device reboot # Alternative using shutdown command with reboot flag ému device shutdown -r ``` -------------------------------- ### Flash Panda with Recovery (C2) Source: https://github.com/emu-sh/.oh-my-comma/blob/master/README.md Flashes the Panda hardware using the 'make recover' method, which is typically compatible with the Comma 2 device. This command is part of the emu panda interfacing tools. ```bash emu panda flash ``` -------------------------------- ### Display Device Battery Information Source: https://github.com/emu-sh/.oh-my-comma/blob/master/README.md Retrieves and displays information about the current state of the device's battery. This command is part of the device statistics tools. ```bash emu device battery ``` -------------------------------- ### Display Emu Device Battery Status Source: https://context7.com/emu-sh/.oh-my-comma/llms.txt Displays battery status information for EON devices, including charge level and temperature. This command is specific to Android-based EON devices. ```bash # Check battery status (EON only) ému device battery # Expected output: # Battery info: # - Level: 85% # - Temperature: 32.5°C # Shorthand alias battery ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.