USB를 Windows에 연결 후 Waveshare 보드가 COM 포트로 인식되는지 장치관리자에서 확인
1단계: usbipd-win으로 Waveshare 보드를 WSL2에 포워딩
*Follower 기준으로 직류전원과 모터, USB를 먼저 세팅한다.
Windows PowerShell을 장치관리자로 연다.
# usbipd 설치 (안 깔려있으면)
winget install --interactive --exact dorssel.usbipd-win
# 장치 목록에서 Waveshare 보드 busid 확인
usbipd list
# Waveshare 보드는 보통 "USB Serial Converter" 또는 "CH340" 계열로 잡힘
# 공유 가능 상태로 등록 (최초 1회)
usbipd bind --busid <X-Y>
# WSL2에 연결
usbipd attach --wsl --busid <X-Y>
WSL2에서 확인
ls /dev/ttyACM* /dev/ttyUSB* 2>/dev/null
# /dev/ttyACM0 또는 /dev/ttyUSB0 중 하나로 잡혀야 함
dmesg | tail -20
# "ch341-uart converter now attached to ttyUSB0" 같은 라인 있으면 OK
usbipd attach는 WSL2 재시작하면 풀려서 매번 다시 해야하는데 PowerShell에서 함수 등록해서 번거로움을 줄일 수 있다.
function Attach-UsbToWsl {
param(
[Parameter(Mandatory=$true)]
[string]$BusId,
[string]$Name = $BusId
)
$device = usbipd list | Select-String $BusId
if (-not $device) {
Write-Host "[$Name] Device $BusId not found. Is it plugged in?" -ForegroundColor Red
return
}
if ($device -match "Not shared") {
Write-Host "[$Name] Binding $BusId (one-time, requires admin)..." -ForegroundColor Yellow
usbipd bind --busid $BusId
}
if ($device -match "Attached") {
Write-Host "[$Name] $BusId is already attached to WSL." -ForegroundColor Green
return
}
usbipd attach --wsl --busid $BusId
Write-Host "[$Name] Attached $BusId to WSL." -ForegroundColor Green
}
function Attach-Follower { Attach-UsbToWsl -BusId "1-7" -Name "Follower" } # 실제 BUSID로 수정
function Attach-Leader { Attach-UsbToWsl -BusId "3-2" -Name "Leader" } # 실제 BUSID로 수정
function Attach-Both { Attach-Follower; Attach-Leader }
메모장 닫고 PowerShell에서 프로필 실행
. $PROFILE
이제 아래 명령어를 실행하면 연결되었다는 문구가 출력된다. (하나 또는 둘 다)
Attach-Follower
Attach-Leader
Attach-Both
2단계: WSL2에 LeRobot 설치
목표: WSL2의 conda 환경에 LeRobot + Feetech SDK를 깔아서 lerobot-setup-motors 같은 CLI를 쓸 수 있게 만드는 것.
먼저 conda(Miniforge)가 이미 깔려있는지 확인
(1) Miniforge 설치 여부 확인
WSL2 터미널에서
conda --version
설치가 안되어 있다면 설치
cd ~
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh
설치 끝나면 셸을 새로 시작
exec bash
프롬프트 앞에 (base)가 붙으면 성공
버전 확인 완료
(2) conda 환경 생성
conda create -y -n lerobot python=3.12
끝나면 활성화. 프롬프트 앞에 (base)였던 게 (lerobot)으로 바뀌면 성공.
conda activate lerobot
파이썬 버전 확인
python --version
(3) ffmpeg 설치 (conda-forge)
LeRobot은 데이터셋 비디오 인코딩에 ffmpeg + libsvtav1을 쓰는데, conda-forge 빌드가 libsvtav1 포함된 버전이라 가장 편하다. 모터 세팅 단계에서는 ffmpeg이 직접 필요하진 않지만, 나중에 텔레오퍼레이션/데이터 수집할 때 필요할 수 있음.
(lerobot) 환경 활성화된 상태에서
conda install -y ffmpeg -c conda-forge
설치 끝나면 확인. ffmpeg version 7.x 또는 8.x가 찍히면 성공.
ffmpeg -version | head -1
(4) LeRobot clone + Feetech extra 설치
SO-101은 Feetech STS3215 서보를 쓰니까 feetech extra가 필요함. editable 모드(-e)로 설치해두면 나중에 소스 수정할 일이 생겨도 재설치 없이 바로 반영된다.
(lerobot) 환경 활성화된 상태에서 설치
cd ~
git clone https://github.com/huggingface/lerobot.git
cd lerobot
pip install -e ".[feetech]"
오류 없이 잘 됐으면 넘어간다.
3단계: lerobot-find-port로 포트 확정
포트 찾기
lerobot-find-port
이 상태에서 USB를 뽑고 엔터를 누른다. 자동으로 없어진 포트를 찾아줌.
USB를 연결하면 WSL과 연결이 끊기기 때문에 다시 연결한다. 아까 함수를 만들어놨기 때문에 PowerShell에서 Attach-Follower를 실행한다.
WSL에서도 다시 연결 된 것 확인 완료.
포트 확정 완료. Follower 보드 = /dev/ttyACM0
4단계: lerobot-setup-motors로 Follower 모터 6개 ID/baudrate 설정 및 검증
공장 출고 상태의 STS3215 모터들은 전부 같은 기본 ID로 설정되어 있어서, 데이지 체인으로 연결하기 전에 하나씩 보드에 물리적으로 연결해가며 각각 ID 1~6을 지정해야 한다.
(1) 시작 전 준비
Follower 보드의 12V 어댑터 연결 상태 유지
Follower 보드의 USB 케이블 Windows 연결 상태 유지 (/dev/ttyACM0)
모터 6개는 아직 하나도 보드에 연결하지 마 — 스크립트가 "첫 번째 모터를 연결하라"고 할 때부터 시작
Windows PowerShell에서 wsl--shutdown 완전히 닫고 다시 WSL2 열기 1. WSL 터미널 다 닫기 2. PowerShell에서 wsl --shutdown 3. PowerShell에서 Attach-Follower (다시 attach, 경우에 따라서 detach 후 다시 attach) 4. WSL 터미널 새로 열기 5. conda activate lerobot 6. ls /dev/ttyACM0 확인 7. groups 확인 — dialout이 보여야 함 8. lerobot-setup-motors 재실행