Getting started
From a Stackchan robot on your desk to your own program (or AI agent) driving it: about ten minutes. You need the robot, a computer with Chrome (for the USB setup), and a phone or the same computer for this site.
1. The robot gets Dev as one of its apps
Dev is an app like Pet or Focus: the robot connects to it, one app at a time.
- Online (m.i41.eu): sign in at m.i41.eu, plug the robot into the computer over USB and set it up (one button: the official firmware and the apps you pick). Pick Dev among its apps. A robot already set up: add Dev on its card on m.i41.eu (the robot gets the new app list at once over its connection to the manager).
- At home: run Dev yourself (the readme: one Go binary or the container) and add it with your home manager, or over USB without one:
i41eu-usb provision -url ws://<your computer>:8785 -name Dev -token-file ~/.config/stackchan-server/robot-token
On the robot: swipe up from the bottom edge, tap QR, then Next until it shows Dev, and Connect. The robot shows Dev's QR code.
2. Your browser gets the robot
- Signed in at the manager (m.i41.eu): open Your robots in the same browser. It signs you in through the manager and shows every robot you set up with Dev, without a QR code. (Sign in at the top if it does not.)
- Or by the robot's QR code: scan it with your phone, or open the link under it on your computer. Your robots now shows your robot: Try it runs every action by hand, Events shows what people do at the robot.
3. A key for your program
On Your robots, New key (name it after where it will live: "laptop", "ci", "claude"). The key is shown once, with the three lines for your shell:
export SDEV_URL=https://dev.q41.eu # where Dev runs
export SDEV_ROBOT=stackchan-0a1b2c3d4e50 # your robot
export SDEV_KEY=sdev_… # the key: keep it like a password
Put them in your shell's profile, or in a file you source (never in a repository). The key works for this robot only. You see it, with when it was last used, on Your robots and on the robot's card on m.i41.eu, and delete it in either place.
4. Your first program
In a clone of the repository (git clone https://github.com/i41-eu/q41eu-dev && cd q41eu-dev), the hello example: a card, green LEDs, a nod, a chime.
sh examples/curl/hello.sh
python3 examples/python/hello.py
node examples/js/hello.mjs
go run ./examples/go/hello
claude mcp add --transport http stackchan "$SDEV_URL/mcp" --header "Authorization: Bearer $SDEV_KEY"
# then ask the agent:
# Say hello on the robot: a green card "Hello", green LEDs, a nod and the tada chime.
Each example stands alone: copy one file, or run the Go ones without a clone (go run github.com/i41-eu/q41eu-dev/examples/go/hello@latest). Python needs only its standard library, JavaScript only Node 18 or newer.
- hello: a card, green LEDs, a nod, a chime
- ask: a question with buttons on the robot; the answer tapped there comes back
- build status: around any command (your tests): blue while it runs, then green and a chime, or red and a shake
- menu: a snack menu of four tiles on the robot; prints the one tapped, and the robot says it
- picture: a picture of yours on the robot (or four numbered quarters); prints the quarter tapped
- events: what people do at the robot; a pat makes it chirp and smile, a tag shows its text
Examples has them all in every language, each with a Run button that does the same from the page.
5. An AI agent
The same actions are MCP tools (robot_show, robot_ask, robot_events, …) at $SDEV_URL/mcp. For Claude Code:
claude mcp add --transport http stackchan "$SDEV_URL/mcp" --header "Authorization: Bearer $SDEV_KEY"
Then ask it, for example, "show on the robot what you are working on, and ask me there before you push". Any MCP client that speaks Streamable HTTP works the same way. Every action on the API page has its MCP tool call next to the other languages.
6. Your own program
- The API: every action is
POST $SDEV_URL/v1/robots/$SDEV_ROBOT/<action>with a JSON object: the API by part has every action, its arguments and a call in each language; /v1/openapi.json is the same as an OpenAPI 3.1 document (load it into any OpenAPI tool, or a generator for your language). - Go: client (
client.FromEnv(), thenShow,Ask,Events, …). - Limits: 10 actions a second per key (bursts of 30). The robot shows one card at a time: a new one replaces the last. It blanks its screen after a minute without use; a card wakes it.
- What a person did comes as events (
tap,pat,pet,stroke,shaken,picked_up,near,away,tag,remote,button, …): ask for the ones after the lastseqyou saw, waiting up to a minute (?after=<seq>&seconds=30).
Lower level
Dev is the robot's higher-level API. Underneath, the robot speaks the device wire protocol (every sensor raw, every command, video and audio): the Raw data app shows all of it, and an app of your own can speak it directly, with Dev's Go kit (robothub for the connection) or on its own.