# `mix bb_so101.setup_servos`
[🔗](https://github.com/beam-bots/bb_so101/blob/main/lib/mix/tasks/bb_so101.setup_servos.ex#L6)

Interactive wizard to configure servo IDs for the SO-101 robot arm.

This task guides you through connecting each servo one at a time and
assigns the correct ID for each joint position. Servos typically ship
with a default ID of 1, so this process ensures each servo gets a unique
ID matching its position in the kinematic chain.

## Usage

    mix bb_so101.setup_servos PORT [OPTIONS]

## Arguments

  * `PORT` - Serial port (e.g., /dev/ttyUSB0 or /dev/ttyACM0)

## Options

  * `--baud-rate`, `-b` - Baud rate (default: 1000000)

## Joint Configuration

The SO-101 arm has 6 joints, each requiring a unique servo ID:

| Joint          | Servo ID | Description                    |
|----------------|----------|--------------------------------|
| shoulder_pan   | 1        | Base rotation                  |
| shoulder_lift  | 2        | Shoulder up/down               |
| elbow_flex     | 3        | Elbow bend                     |
| wrist_flex     | 4        | Wrist up/down                  |
| wrist_roll     | 5        | Wrist rotation                 |
| gripper        | 6        | Gripper open/close             |

## Process

The wizard will:

1. Ask you to connect only ONE servo at a time to the controller board
2. Scan using broadcast ID to find the connected servo
3. Set its ID to the correct value for that joint
4. Verify the new ID works
5. Repeat for each of the 6 joints

## Example

    mix bb_so101.setup_servos /dev/ttyUSB0

## Tips

- Start with all servos disconnected from the bus
- Connect servos one at a time as prompted
- Ensure the power supply is connected to the controller board
- You can skip already-configured servos by pressing 's'

---

*Consult [api-reference.md](api-reference.md) for complete listing*
