Docs /
... / Managing Applications / Connect a Device

🔌 Connect a Device

This command allows you to map hardware devices (e.g., USB serial ports for Arduino) from your host machine directly into your application container.

Interactive Usage

odac app device add

After running the command, you will be prompted for:

  • App ID or Name: The application you want to connect the device to.
  • Host Device Path: The path to the device on your server (e.g., /dev/ttyACM0).

Single-Line Usage

# Connect /dev/ttyACM0 to 'my-arduino-app'
odac app device add my-arduino-app /dev/ttyACM0

# Or use flags
odac app device add -a my-arduino-app -d /dev/ttyACM0

Disconnecting a Device

To remove a device mapping, use the delete sub-command:

odac app device delete my-arduino-app /dev/ttyACM0

Available Prefixes

  • -a, --app: The App ID or Name
  • -d, --device: The host device path

⚠️ Important: After adding or removing a device, you must restart the application for the changes to take effect:

odac app restart my-arduino-app

📝 Note: For security reasons, devices are mapped with read-write-mknod (rwm) permissions by default. Ensure your application has the necessary internal permissions (e.g., user groups) to access the device.

🔐 Permission denied? If your app still can't access the mapped device (the device node is typically owned by root with a group like dialout), it likely needs to run as root. Instead of manually chmod-ing the device on every restart, grant elevated access — see Privileged Access:

odac app privileged my-arduino-app   # run as root
odac app restart my-arduino-app