Neutrino
The Nucleus hub firmware compiled to WebAssembly and built into Phosphor. It acts like a real machine over Valence, with no PCB and no motor.
Lives in the Nucleus repo. Apache-2.0.
Status
In every Phosphor pre-release build for Windows, macOS and Linux. Android is in development.
What it's for
- Try Phosphor
Build a Dash, run patterns and play funscripts before you own a machine.
- Build clients
Write a Valence app or plugin against a hub that answers like the real one.
- Test every build
Phosphor's checks boot Neutrino and run the protocol suite against it before CI builds the app.
The same code as the PCB
Neutrino compiles the firmware's own source files: the Valence hub, the catalog, the motion arbiter with every safety gate, the pattern generators and the Kinetic² planner. Only the parts that touch hardware are swapped for stand-ins, and the firmware is never changed to suit Neutrino.
With the PCB
- Phosphoron your computer
- Wi-Fi
- Nucleushub and Kinetic² on the ESP32-P4
- quadrature
- Servo driveand the motor
With Neutrino
- Phosphorthe same app
- inside the app
- Neutrinothe same hub and Kinetic² code, as WebAssembly
- ideal steps
- A step countno drive, no motor
| Part | On the PCB | In Neutrino |
|---|---|---|
| Hub, catalog, patterns, planner | Nucleus firmware | The same source files. The catalog has the same etag as the board's. |
| Motor output | The LP core sends quadrature to the servo drive | An ideal emitter that hits every step on time. Position is its step count. |
| Link | WebSocket over Wi-Fi | Messages between Phosphor and a worker thread, one Valence frame each. No network socket. |
| Settings and presets | Flash | Phosphor's app storage, kept between runs. |
| Wi-Fi | The ESP32-C6 radio | One saved network and a made-up scan list. Joining does nothing. |
How it runs in Phosphor
- Phosphor carries the WebAssembly build inside the app, about 660 KB.
- When you press Connect, it starts Neutrino in a worker thread, at its home position with its pairing window open, so Phosphor pairs with it the way it pairs with a real machine.
- The worker runs the hub on its own clock: a motion pass every 1 ms, the same tick as the PCB's, and a hub pass every 5 ms.
- Phosphor talks to it through the same connection code it uses for a real hub. Nothing goes out on the network.
- Disconnecting stops Neutrino. Its settings, presets and pairings are saved for the next run.
Try it
- Install Phosphor from Downloads and open the Hubs page.
- Under Saved hubs, find the row named Neutrino with the
νbadge. Hover the badge to read "Virtual machine: real Nucleus firmware, emulated in the app". - Press Connect.
Neutrino is never saved as a hub and never connects on its own. The getting started guide walks through the first session.

For developers
A native build of the same code runs as a standalone hub on your desktop, for client tests and the bench. Check out Valence and Kinetic beside Nucleus, then from the Nucleus folder:
cmake -S sim/neutrino -B sim/neutrino/build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build sim/neutrino/build
sim/neutrino/build/neutrino-sim --homed --pairing-window
It listens for Valence sessions over WebSocket on port 82 and answers discovery on the LAN. --pairing-window lets the first client that connects pair with configure access, as a PAIR press does on the PCB. On Windows, build with WinLibs MinGW-w64 and add -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc. The README lists every flag.
The WebAssembly build uses Emscripten:
emcmake cmake -S sim/neutrino/wasm -B sim/neutrino/wasm/build -G Ninja
cmake --build sim/neutrino/wasm/build
node sim/neutrino/wasm/check.mjs
Phosphor's Neutrino cluster runs many Neutrino hubs at once on worker threads to soak-test the hub and the client, about 1,500 of them in real time on a 16-core PC.
Limits
- Motion is ideal. There is no drive, motor or encoder, so following error and drive alarms never show up.
- No HOME button and no E-stop input. Phosphor's Halt and Pause work.
- The Wi-Fi networks are made up, and memory and TCP figures read 0.
