Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
so101 serve boots with the arm unplugged: /status says "arm: not connected", cameras and the grow box keep serving #617
Merged 39d 19h ago
so101 serve now starts and listens when the arm is unplugged. When the port is missing or can't be opened, it logs arm not connected ( : ) and keeps serving. That covers --port, SO101PORT and detection.
-
Reviews
ApprovedApproved. The change does what #581 asks:
so101 servelogs one line and keeps serving with the arm unplugged. Arm routes answer 503 in JSON, STOP answers 200,/followcloses with 1013, and no write reaches a wire. The test that forces everycaseroute into exactly one list is the strongest part. I read the diff and the preview. The preview is the hosted app with the arm offline:/answers 200 and/statusreports the arm offline. I did not exerciseso101 serveitself or read the screenshots, because the sandbox denies /data/looks. This change has no UI of its own.Two things to do next:
- Fix the README contradiction. It says plugging the arm in brings its card back with no restart, then says the service needs a restart. Say that the card returns once
serveis restarted, until the reconnect issue lands. - Remove
waitForArminarm-wait.ts, which only a test uses now, or use it. Also makeabsentBusreturnundefinedforthen. Todayawait buswould hang forever, because the Proxy returns a rejecting function for every key.
- Fix the README contradiction. It says plugging the arm in brings its card back with no restart, then says the service needs a restart. Say that the card returns once
-
Checks
shipped merged
-
History
- so101 serve: boots with the arm unplugged; /status says not connected, arm routes answer 503 71f4293
- Arm server: /grow/dosing (and /grow/light, /grow/pump) answer anyone who reaches the arm's port (#612) 21cb2b4
- Dosing: real peristaltic and top-off pump drivers with ml/s calibration, replacing the fake pumps (#610) fa0051d
- Dosing: pH/EC probes via ADS1115 with guided calibration and monthly reminder (#609) f8a7543
- Dosing: temperature and level sensor drivers (DS18B20, SHT31/BME280, float switches) as Reading sources (#608) d2bae2e
- Grow care: a plant profile (spinach first), reminders from it, a log book, and metrics with target bands; manual now, sensors later (#598) 13887dd
- Grow stills at 1920×1080, cropped to the camera's region and colour-corrected (split from #584) (#603) d2bd69c
- so101 server: hang up after answering 413 at the body cap (#602) f5a7213
- Grow box: a still every 10 min, a scrubbable timelapse, a grow log and a canopy chart (#601) d623239
- Grow light schedule: a switch driver (smart plug, GPIO relay, or uhubctl only when it switches the light alone) with a photoperiod that runs on the Pi (#599) 0ea35e6
- Grow card: "Camera can't see the plants" hint when the camera's region is mostly blown out or black (split from #584) (#597) 315c1ae
- Pump: an interval-cycle schedule on the Switch interface (with #585) (#596) 82337a2
- The workshop: one Pi, several stations (the arm and the grow box), each with cameras and controls; works with the arm unplugged (#592) 37b3b00
- The identity line on /story and /admin/data (#594) 568b0ea
- Grow cameras: a saved camera profile per Pi camera, re-applied at every start, and a Tune panel with the box drawn once and colour correction under grow light (#591) 17c46ef
- Sign out, and every page shows who you are, even when the arm is off (#587) 1873f3c
- Closing the arm locks its owner out: keep sign-in and /admin working while closed, an Open now button on the resting card, and so101 open/close (#579) fba1312
- setup: find LeRobot calibration in its nested folders (calibration/robots/so_follower/*.json) (#577) 6da7fb9
- `so101 setup` finds both arms, asks you to wiggle the leader, reuses existing calibration, then starts teleop (#575) f44d21f
- `so101 teleop` drives the follower from the leader in one process at 60 Hz, with a joint table, lag and space to STOP (#574) 43e37d1
so101 serve now starts and listens when the arm is unplugged. When the port is missing or can't be opened, it logs arm not connected (<path>: <reason>) and keeps serving. That covers --port, SO101_PORT and detection.
I ran the new test, server.test.ts, stations.test.ts, readme.test.ts, cli-node.test.ts and fake-serve.test.ts, and they pass. tsc --noEmit reports errors in other files, but none in the three I changed.
- Without an arm:
GET /statusanswers 200 witharm: "not connected"and no joints./version,/camera-profileand/grow/*answer as before.- Every route that needs the servos answers 503
{"error":"arm not connected"}before touching anything. - STOP, resume and E-stop still answer 200, and E-stop skips the bus hold.
- The gain-sync timer doesn't start.
- Code:
startServernow takes the bus ornull. The route lists and the stand-in bus are in the newsrc/absent-bus.ts;openArminsrc/cli.tsdoes the opening. - Test:
src/absent-arm.test.tsstarts the server with no bus. It reads thecaselines ofserver.tsand requires each route to be in exactly one of the arm-route or free-route lists. A new route must therefore be classified, or the test fails. It then checks every arm route answers 503. - README: the Pi section now says the arm server runs unplugged.
- Drive stream is not a 503:
/followis accepted and closed at once with code 1013 and the reasonarm not connected. Bun here never delivered a 503 written to an upgrade socket, so I used the same close-after-connect route the E-stop and hold already take. - Detection no longer waits:
servewith no port set used to block until a servo board appeared (waitForArm). It now starts without one. I removed that import fromcli.tsand left the helper in place, sincestations.test.tsstill uses it. I also rewrote the README line that described the wait. - Restart needed to connect: plugging the arm in needs a service restart, as the issue says (reconnecting is the next issue).
- Test teardown: the new test doesn't await
server.close(). In this Bun,http.closenever finishes after the server has closed a WebSocket. An E-stop close does the same on the armed server, so it isn't new.
so101 servenow starts and listens when the arm is unplugged. When the port is missing or can't be opened, it logsarm not connected (<path>: <reason>)and keeps serving. That covers--port,SO101_PORTand detection.I ran the new test,
server.test.ts,stations.test.ts,readme.test.ts,cli-node.test.tsandfake-serve.test.ts, and they pass.tsc --noEmitreports errors in other files, but none in the three I changed.GET /statusanswers 200 witharm: "not connected"and no joints./version,/camera-profileand/grow/*answer as before.{"error":"arm not connected"}before touching anything.startServernow takes the bus ornull. The route lists and the stand-in bus are in the newsrc/absent-bus.ts;openArminsrc/cli.tsdoes the opening.src/absent-arm.test.tsstarts the server with no bus. It reads thecaselines ofserver.tsand requires each route to be in exactly one of the arm-route or free-route lists. A new route must therefore be classified, or the test fails. It then checks every arm route answers 503./followis accepted and closed at once with code 1013 and the reasonarm not connected. Bun here never delivered a 503 written to an upgrade socket, so I used the same close-after-connect route the E-stop and hold already take.servewith no port set used to block until a servo board appeared (waitForArm). It now starts without one. I removed that import fromcli.tsand left the helper in place, sincestations.test.tsstill uses it. I also rewrote the README line that described the wait.server.close(). In this Bun,http.closenever finishes after the server has closed a WebSocket. An E-stop close does the same on the armed server, so it isn't new.Closes #615