Public: anyone can read this; the crew can change it.
Migrated from github.com/Trevato/SO-ARM100
Point the app at my real arm: a setting for the server with the camera and the SO-101, simulation when unset #4
Merged 44d 17h ago
The hosted app now has an ARMSERVER setting. Point it at your so101 serve (ws:// :8101, http://… or https://…) and the app relays the arm's controls, the /follow stream and the camera to it. With it unset, the app runs the simulated arm as before.
-
Reviews
No review yet.
-
Checks
shipped merged
-
History
- Point the hosted app at a real arm with ARM_SERVER (#3) 0056031
- Make arm run here (#2) abb2ad9
- docs: list Seeed Studio and WowRobo first in kits section (#188) a758567
- Point the Robonine kit link at the SO-ARM101 kit page (#180) ec5b424
- Add SO-101 leader arm URDF (#186) 5f6d2b8
- docs: Add guide for LeRobot WebUI 3-point calibration studio (#173) eecbe3e
- Add SO101 wrist camera mount + camera URDF and MJCF variants (#176) f555c6c
- Add RobotEd as Swiss supplier to Kits list (#177) 8f9f249
- Fix link path in README.md (#155) e9a60ec
- Add SO-101 STL files for BambuLabA1mini (#96) 9fa0146
- Add Robonine as worldwide supplier to Kits list (#164) 7629d2a
- Fix outdated STL paths and labels in 3DPRINT.md (#167) 05cc848
- Add ForgeMotion Labs to Kits list (#168) d6ad2d2
- Update README.md fda892c
- Update README.md 2ca36d9
- Update README.md 608122e
- Update actuator model params (#141) aec17bb
- Update CITATION.cff a75d8a5
- Update CITATION.cff e8d54f6
- Compliant soft finray gripper add-on (#124) 9a6f6d6
The hosted app now has an ARM_SERVER setting. Point it at your so101 serve (ws://<host>:8101, http://… or https://…) and the app relays the arm's controls, the /follow stream and the camera to it. With it unset, the app runs the simulated arm as before.
What changed
Software/so101/src/relay.ts(new): a relay in front of the simulated arm, using no new dependencies.- The page itself, the 3D model files and three.js always come from the app. Everything else goes to the real arm while it answers, or to the simulation when it doesn't.
- The cameras come through at
/camera/<1|2>/stream, so the browser never has to reach your network. By default they are on ports 8080 and 8081 of the same host;ARM_CAMERA_1andARM_CAMERA_2take full URLs if they live elsewhere. GET /linktells the page which arm it is on: live or simulated, the host, and why the real arm isn't in use.- The relay checks the real arm when it starts (giving up after 1.5 s) and again every 5 s. A failed read falls back to the simulation at once.
- A move or playback has no timeout, since it only answers when the arm arrives. It is cut only when the link drops, and then comes back as an error (502); it is not replayed on the simulation.
- Security:
POST/PUTrequests and the/followstream are only accepted from the app's own page. This uses the browser'sSec-Fetch-Siteheader, or failing thatOriginchecked againstX-Forwarded-Host/Host. Every response setsX-Content-Type-Options,Referrer-Policyand a small Content-Security-Policy. bench/fake-serve.ts: the simulated arm now listens on a private loopback port, and the relay takesPORT/HOST.forge.jsonis unchanged.viewer.html: the top bar shows "Live arm · host", "Simulated", or "Simulated · host unreachable (why)". Behind the relay the cameras load through the app. The page reloads when the arm switches between real and simulated (because the limits, poses and joints differ), but waits if the page itself is driving the arm.- README: a "Pointing the hosted app at your real arm" section: run
so101 serveon the arm machine, setARM_SERVER, and make sure the forge can reach that machine (for example, both on the same Tailscale network). It also warns not to exposeso101 serveto the internet, since it has no login.
What I chose not to do
- No login on
so101 serveitself. - No WebRTC: the existing setup serves MJPEG, and the relay passes that through as a stream.
- The Content-Security-Policy is limited to framing, base URL, plugins and form targets. A strict script/connect policy would have to account for the viewer's inline module and its
?stream=override, and I couldn't check that in a browser here.
How to try it
bun testinSoftware/so101passes (101 tests), and so doesbun x tsc --noEmit. The new tests insrc/relay.test.tscover status, saved poses and/followreaching the "real" arm, camera bytes and/statecoming through, the simulation when unset, a server that accepts connections but never answers falling back within 3 s, a server that disappears mid-session, a bad setting, and a request from another site being refused.- Locally:
ARM_SERVER=ws://<pi>:8101 PORT=8102 FORGE_APP_DATA=./data bun run Software/so101/bench/fake-serve.ts, then openhttp://127.0.0.1:8102/. - On the preview, set
ARM_SERVERon the app's settings page.
🤖 Generated with Claude Code
The hosted app now has an
ARM_SERVERsetting. Point it at yourso101 serve(ws://<host>:8101,http://…orhttps://…) and the app relays the arm's controls, the/followstream and the camera to it. With it unset, the app runs the simulated arm as before.What changed
Software/so101/src/relay.ts(new): a relay in front of the simulated arm, using no new dependencies./camera/<1|2>/stream, so the browser never has to reach your network. By default they are on ports 8080 and 8081 of the same host;ARM_CAMERA_1andARM_CAMERA_2take full URLs if they live elsewhere.GET /linktells the page which arm it is on: live or simulated, the host, and why the real arm isn't in use.POST/PUTrequests and the/followstream are only accepted from the app's own page. This uses the browser'sSec-Fetch-Siteheader, or failing thatOriginchecked againstX-Forwarded-Host/Host. Every response setsX-Content-Type-Options,Referrer-Policyand a small Content-Security-Policy.bench/fake-serve.ts: the simulated arm now listens on a private loopback port, and the relay takesPORT/HOST.forge.jsonis unchanged.viewer.html: the top bar shows "Live arm · host", "Simulated", or "Simulated · host unreachable (why)". Behind the relay the cameras load through the app. The page reloads when the arm switches between real and simulated (because the limits, poses and joints differ), but waits if the page itself is driving the arm.so101 serveon the arm machine, setARM_SERVER, and make sure the forge can reach that machine (for example, both on the same Tailscale network). It also warns not to exposeso101 serveto the internet, since it has no login.What I chose not to do
so101 serveitself.?stream=override, and I couldn't check that in a browser here.How to try it
bun testinSoftware/so101passes (101 tests), and so doesbun x tsc --noEmit. The new tests insrc/relay.test.tscover status, saved poses and/followreaching the "real" arm, camera bytes and/statecoming through, the simulation when unset, a server that accepts connections but never answers falling back within 3 s, a server that disappears mid-session, a bad setting, and a request from another site being refused.ARM_SERVER=ws://<pi>:8101 PORT=8102 FORGE_APP_DATA=./data bun run Software/so101/bench/fake-serve.ts, then openhttp://127.0.0.1:8102/.ARM_SERVERon the app's settings page.🤖 Generated with Claude Code
Closes #3