Maker ยท Active Project ยท Session Log

First Recording Attempt on the Pi 4

First test of lerobot-record โ€” full pipeline validation (arm + camera + dataset saving)

Goal: validate the full lerobot-record pipeline end-to-end on the Pi 4 โ€” arm control, camera capture, and dataset saving together.

Result: โœ… Pipeline proven to work end-to-end, despite a stressful session with several hiccups along the way.

1. A quick camera-preview workflow

Before recording, a lightweight way to check camera framing/lighting without repeated scp round-trips: capture a frame with OpenCV, serve it over a simple local web server, and view it from a browser on another machine.

mkdir -p ~/camera_test
cd ~/camera_test
python3 -c "
import cv2
cam = cv2.VideoCapture('/dev/video0')
ret, frame = cam.read()
if ret:
    cv2.imwrite('frame.jpg', frame)
    print('Saved')
else:
    print('Failed')
cam.release()
"
python3 -m http.server 8080

Then viewed at http://lerobot-vision.local:8080/frame.jpg from another machine's browser. Re-running the capture command and hard-refreshing (browsers cache images aggressively by filename) turns this into a fast adjust โ†’ capture โ†’ refresh loop for dialing in camera position and lighting.

2. Missing package: datasets

lerobot-record requires the optional datasets package from Hugging Face, not included in the original [feetech] install (which only covered what the arm/motors needed):

mkdir -p ~/pip-tmp
TMPDIR=~/pip-tmp pip install 'lerobot[dataset]'
rm -rf ~/pip-tmp

Same TMPDIR redirect as the original torch install, to keep pip's temp files off the small RAM-backed /tmp. Much lighter install than torch โ€” the datasets library itself is small.

3. Port mixup, carried over from last session

Resolved by reconnecting via the stable by-path USB identifiers established previously (follower on port 1.4, leader on port 1.3) rather than the OS-assigned /dev/ttyUSB0/1, which aren't guaranteed stable across reconnects.

4. First lerobot-record command

What the command needs: a Hugging Face-style repo_id (a placeholder like username/dataset-name works fine for a local-only test โ€” nothing needs to actually be pushed), a short task description, and an episode count/length for the first pipeline test (kept small: 2 episodes, 15s each).

lerobot-record \
    --robot.type=so101_follower \
    --robot.port=/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0-port0 \
    --robot.id=my_follower_arm \
    --robot.cameras='{"main": {"type": "opencv", "index_or_path": "/dev/video0", "width": 640, "height": 480, "fps": 30}}' \
    --teleop.type=so101_leader \
    --teleop.port=/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0-port0 \
    --teleop.id=my_leader_arm \
    --dataset.repo_id=iliya-radulov/so101-test-pickplace \
    --dataset.single_task="Pick up the object and place it in the bowl" \
    --dataset.num_episodes=2 \
    --dataset.episode_time_s=15 \
    --dataset.reset_time_s=10

episode_time_s is how long each recording runs; reset_time_s is a pause between episodes to reset the object's position before the next one.

5. Lighting and framing

Repositioned the camera for a wider view of the workspace. Lighting was still too dim, causing motion blur โ€” a physics issue (low light forces a slower shutter, which blurs any motion), not a software problem. Flagged for improvement next session.

6. Camera timeout on first connect

Same known quirk as earlier sessions โ€” resolved with a retry, and by adding warmup_s: 5 to the camera config to address the root cause rather than just retrying each time.

7. Two recording attempts

8. Hub push error โ€” expected, harmless

A 401 Unauthorized error appeared when the recording tried to push to the Hugging Face Hub โ€” expected, since this session wasn't logged in. Harmless: it happens only after local saving already completes. Two ways to handle it going forward:

What you have now

Two local datasets saved at ~/.cache/huggingface/lerobot/iliya-radulov/:

DatasetStatus
so101-test-pickplace_20260801_223539No movement captured โ€” safe to delete
so101-test-pickplace_20260801_224341โœ… First real recorded demonstration

Notes / open items for next time

Continues from the Pi 4 teleoperation setup log. Continued in the Mac migration and training session, once the Pi's recording performance ceiling became clear.