Channel Unit Status Codes¶
Status Code |
Meaning |
|---|---|
0 |
Normal Operation |
1 |
Latching detected on this Channel unit |
2 |
Channel unit is performing an IV Sweep |
3 |
Channel unit is stopping an IV Sweep |
4 |
Channel unit is performing an delayed IV Sweep |
100 |
Channel unit timed out |
200 |
Channel unit is turned off |
Nerve Migration Guide¶
This document covers the changes needed when migrating integrations or scripts from WebSQ to Nerve. The core protocol is the same (JSON-RPC 2.0 over HTTP POST /api, WebSocket /counts and /updates), but there are renamed methods, removed methods, parameter changes, and configuration structure changes.
Table of Contents¶
1. Overview¶
Aspect |
WebSQ |
Nerve |
|---|---|---|
Language / framework |
Python 3 + Tornado |
Go + Fiber |
Protocol |
JSON-RPC 2.0 (same) |
JSON-RPC 2.0 (same) |
Default port |
80 (production), 8080 (dev) |
8080 |
Config file location |
|
|
Simulation flag |
enabled by default, disable with |
disabled by default, enable with |
2. Startup & CLI Flags¶
WebSQ¶
python -m websq # run with simulation and frontend serving
python -m websq -noserv # disable frontend serving
python -m websq -nosim # disable simulation
python -m websq --port 9000 # custom port
Nerve¶
./nerve # production mode (serves built frontend)
./nerve -sim # enable simulation (was default in WebSQ)
./nerve -dev # disable built frontend serving (use npm dev server)
./nerve -port 9000 # custom port
./nerve -cfgdir /etc/nerve # custom config directory
./nerve -logdir /var/log/nerve # custom log directory
./nerve -tmpdir /data/tmp # custom temp directory
Key change: Simulation is now opt-in (-sim) instead of opt-out.
3. HTTP Endpoints¶
WebSQ |
Nerve |
Notes |
|---|---|---|
|
|
unchanged |
|
|
unchanged |
|
|
unchanged |
|
|
unchanged (SSE) |
|
|
renamed; see File Upload |
|
— |
removed |
— |
|
new; see Data Download |
— |
|
new generic upload; see File Upload |
— |
|
new SSE stream for firmware upgrade progress |
File Upload¶
WebSQ had a single firmware upload endpoint. Nerve uses a generic /upload/:fileType route:
|
Description |
|---|---|
|
Firmware upgrade image (replaces |
|
Configuration JSON file |
|
Temperature calibration file |
|
Camera map JSON |
File Download¶
All data that was previously returned as RPC response payloads is now served as file downloads:
|
Description |
|---|---|
|
Current configuration as JSON |
|
Temperature calibration data |
|
HDF5 recording file |
|
IV sweep data |
|
Server log file |
|
Camera map JSON |
4. JSON-RPC Method Changes¶
Renamed Methods¶
WebSQ method |
Nerve method |
Notes |
|---|---|---|
|
|
params unchanged |
|
|
structure changed; see Channel Structure |
|
|
params changed; see below |
|
|
params changed; see below |
Removed Methods¶
These WebSQ methods no longer exist in Nerve. Use the indicated replacement.
Removed method |
Replacement |
|---|---|
|
Not supported on Retina hardware |
|
Use |
|
Upload via |
|
Upload via |
|
Use |
|
Not available |
|
|
|
|
|
|
New Methods¶
These methods are available in Nerve but did not exist in WebSQ.
New method |
Description |
|---|---|
|
Reset all MCUs (complement to |
|
Returns full temperature sensor data (replaces |
|
Returns loaded calibration filenames for sensor 1 and sensor 2 |
|
Returns current plotting configuration |
|
Returns whether the second temperature sensor is active |
|
Enables or disables the second temperature sensor |
Parameter Changes¶
setRecord (replaces startRecording / stopRecording)¶
Recording is now a single toggle method instead of separate start/stop methods. The channels parameter from startRecording is no longer accepted — all active channels are recorded automatically.
WebSQ start recording:
{"jsonrpc":"2.0","method":"startRecording","params":{"channels":[1,2,3]},"id":1}
Nerve start recording:
{"jsonrpc":"2.0","method":"setRecord","params":{"value":true},"id":1}
WebSQ stop recording:
{"jsonrpc":"2.0","method":"stopRecording","params":{},"id":1}
Nerve stop recording:
{"jsonrpc":"2.0","method":"setRecord","params":{"value":false},"id":1}
The response contains {"value": bool} reflecting the actual recording state after the call.
reboot¶
WebSQ used an optional delay field in milliseconds. Nerve accepts an optional delay parameter as well — the interface is compatible.
setChannelLog¶
The parameter names are the same (debug, rank), but rank is now a uint32 channel rank rather than a 1-based integer. When debug is false, the rank parameter is optional and all channel logging is disabled.
5. Settings / Configuration Structure¶
Top-Level Keys¶
The configuration JSON structure has changed at the top level:
WebSQ key |
Nerve key |
Notes |
|---|---|---|
|
|
fields changed; see below |
|
|
structure changed; see below |
|
|
largely unchanged |
|
|
renamed |
|
|
unchanged |
|
— |
removed (paths are now CLI flags) |
— |
|
new section for plot configuration |
Backend Fields¶
WebSQ field |
Nerve field |
Notes |
|---|---|---|
|
|
renamed, shortened |
|
|
renamed to camelCase |
|
|
range extended to 1,000,000 ms (was 60,000 ms) |
|
— |
removed |
|
— |
removed |
|
— |
removed (use |
— |
|
new: separate integration time for IV sweeps |
|
|
unchanged |
Channel Structure¶
This is the most significant structural change. WebSQ organized channels in a nested map by MCU ID then CU ID. Nerve uses a flat map keyed by a sequential rank number.
WebSQ devices structure:
{
"devices": {
"1": {
"configuration": { "mcuId": 1, "mcuStatus": 0 },
"channels": {
"1": { "mcuId": 1, "cuId": 1, "biasI": 1.5e-5, ... },
"2": { "mcuId": 1, "cuId": 2, "biasI": 1.2e-5, ... }
}
}
}
}
Nerve channels structure:
{
"channels": {
"1": { "mcuId": 1, "cuId": 1, "biasI": 1.5e-5, ... },
"2": { "mcuId": 1, "cuId": 2, "biasI": 1.2e-5, ... }
}
}
The rank key is a flat uint32 that uniquely identifies each channel across all MCUs.
biasI units are unchanged: Both WebSQ and Nerve store biasI in Amperes (e.g., 1.5e-5) in the settings file and in the API. The frontend converts to/from μA for display only.
New voltage-mode bias fields in Nerve: The Nerve channel unit gains biasV, biasVStart, biasVStop, and biasVStep for voltage-controlled bias sweeps. These have no WebSQ equivalent.
6. Data Download & Recording¶
In WebSQ, IV and recording data was returned directly in JSON-RPC responses (getIvData, getRecordData, getIvFile). In Nerve, all data export is done via HTTP downloads.
Downloading recorded data¶
# WebSQ (RPC call returning data in JSON)
POST /api {"method": "getRecordData", ...}
# Nerve (HTTP file download)
GET /download/recordings
Downloading IV sweep data¶
# WebSQ
POST /api {"method": "getIvData", ...}
POST /api {"method": "getIvFile", ...}
# Nerve
GET /download/ivsweep
Downloading configuration¶
# WebSQ (no equivalent — config was only readable via getSettings)
# Nerve
GET /download/config
7. WebSocket & SSE Events¶
The /updates WebSocket still carries JSON-RPC 2.0 notification objects ({"jsonrpc":"2.0","method":"...","params":{...}}). Most event names are unchanged.
WebSQ event |
Nerve equivalent |
Notes |
|---|---|---|
|
|
unchanged |
|
|
unchanged format |
|
|
unchanged |
|
|
unchanged |
|
|
unchanged |
|
|
unchanged |
New SSE endpoint¶
GET /terminal_output is a new Server-Sent Events stream that emits firmware upgrade output line by line. There is no WebSQ equivalent; upgrade progress was not streamed.
Quick Reference: Method Compatibility¶
Method |
WebSQ |
Nerve |
Status |
|---|---|---|---|
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
— |
→ |
|
— |
✓ |
new name |
|
✓ |
— |
removed |
|
✓ |
— |
use config upload |
|
✓ |
— |
→ |
|
— |
✓ |
new name |
|
✓ |
— |
removed |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
— |
use calibration upload |
|
— |
✓ |
replaces |
|
✓ |
— |
→ |
|
✓ |
— |
removed |
|
— |
✓ |
new |
|
— |
✓ |
new |
|
— |
✓ |
new |
|
✓ |
✓ |
params renamed |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
— |
→ |
|
✓ |
— |
→ |
|
✓ |
— |
→ |
|
✓ |
— |
→ |
|
✓ |
— |
→ |
|
— |
✓ |
replaces start/stop recording |
|
✓ |
✓ |
unchanged (μA) |
|
✓ |
✓ |
unchanged (μA) |
|
✓ |
✓ |
unchanged (mV) |
|
✓ |
✓ |
unchanged (mV) |
|
✓ |
✓ |
unchanged (mV) |
|
✓ |
✓ |
unchanged (mV) |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
— |
✓ |
new |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged params |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
✓ |
✓ |
unchanged |
|
— |
✓ |
new |