Channel Unit Status Codes

Table: Status codes of the channel units

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

  2. Startup & CLI Flags

  3. HTTP Endpoints

  4. JSON-RPC Method Changes

  5. Settings / Configuration Structure

  6. Data Download & Recording

  7. WebSocket & SSE Events


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

websq/config/settings.json

/tmp/nerve/config/config.json

Simulation flag

enabled by default, disable with -nosim

disabled by default, enable with -sim


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

POST /api

POST /api

unchanged

WebSocket /counts

WebSocket /counts

unchanged

WebSocket /updates

WebSocket /updates

unchanged

GET /heartbeat

GET /heartbeat

unchanged (SSE)

POST /upload_update

POST /upload/firmware

renamed; see File Upload

GET /licenses.json

—

removed

—

GET /download/:fileType

new; see Data Download

—

POST /upload/:fileType

new generic upload; see File Upload

—

GET /terminal_output

new SSE stream for firmware upgrade progress

File Upload

WebSQ had a single firmware upload endpoint. Nerve uses a generic /upload/:fileType route:

fileType

Description

firmware

Firmware upgrade image (replaces POST /upload_update)

config

Configuration JSON file

calibration

Temperature calibration file

cameraMap

Camera map JSON

File Download

All data that was previously returned as RPC response payloads is now served as file downloads:

fileType

Description

config

Current configuration as JSON

calibration

Temperature calibration data

recordings

HDF5 recording file

ivsweep

IV sweep data

logs

Server log file

cameraMap

Camera map JSON


4. JSON-RPC Method Changes

Renamed Methods

WebSQ method

Nerve method

Notes

rebootSystem

reboot

params unchanged

getDevices

getChannels

structure changed; see Channel Structure

startRecording

setRecord

params changed; see below

stopRecording

setRecord

params changed; see below

Removed Methods

These WebSQ methods no longer exist in Nerve. Use the indicated replacement.

Removed method

Replacement

shutdownSystem

Not supported on Retina hardware

getSettingsNoData

Use getSettings

setSettingsFromFile

Upload via POST /upload/config then call restoreSettings

updateTemperatureCalibration

Upload via POST /upload/calibration

getTempData

Use getTemperature (RPC) or subscribe to updateTemperatures events on /updates

clearTemperatureData

Not available

getIvData

GET /download/ivsweep

getRecordData

GET /download/recordings

getIvFile

GET /download/ivsweep

New Methods

These methods are available in Nerve but did not exist in WebSQ.

New method

Description

resetAllMcus

Reset all MCUs (complement to turnOnAllMcus / turnOffAllMcus)

getTemperature

Returns full temperature sensor data (replaces getTempData)

getCalibrationFileNames

Returns loaded calibration filenames for sensor 1 and sensor 2

getPlotSettings

Returns current plotting configuration

getSecondSensorEnabled

Returns whether the second temperature sensor is active

setSecondSensorEnabled

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

backend

backend

fields changed; see below

devices

channels

structure changed; see below

frontend

frontend

largely unchanged

calibration

temperature

renamed

autocool

autocool

unchanged

locations

—

removed (paths are now CLI flags)

—

plotting

new section for plot configuration

Backend Fields

WebSQ field

Nerve field

Notes

mac_address

mac

renamed, shortened

serial_number

serialNumber

renamed to camelCase

intTime

intTime

range extended to 1,000,000 ms (was 60,000 ms)

SERVE

—

removed

IVREADY

—

removed

addresses

—

removed (use -port CLI flag)

—

ivIntTime

new: separate integration time for IV sweeps

commitId

commitId

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

setSettings broadcast

setSettings broadcast

unchanged

updateTemperatures

updateTemperatures

unchanged format

updateMcuStatus

updateMcuStatus

unchanged

updateMcuPLLLock

updateMcuPLLLock

unchanged

resetIv

resetIv

unchanged

updateIv

updateIv

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

getSettings

✓

✓

unchanged

setSettings

✓

✓

unchanged

backupSettings

✓

✓

unchanged

restoreSettings

✓

✓

unchanged

loadDefaults

✓

✓

unchanged

jsonSchema

✓

✓

unchanged

getBackend

✓

✓

unchanged

getDevices

✓

—

→ getChannels

getChannels

—

✓

new name

getSettingsNoData

✓

—

removed

setSettingsFromFile

✓

—

use config upload

rebootSystem

✓

—

→ reboot

reboot

—

✓

new name

shutdownSystem

✓

—

removed

getLog

✓

✓

unchanged

getDiskUsage

✓

✓

unchanged

setNetworkSettings

✓

✓

unchanged

getNetworkSettings

✓

✓

unchanged

updateTimezone

✓

✓

unchanged

updateDriverSetup

✓

✓

unchanged

updateTemperatureCalibration

✓

—

use calibration upload

getTemperature

—

✓

replaces getTempData

getTempData

✓

—

→ getTemperature

clearTemperatureData

✓

—

removed

getCalibrationFileNames

—

✓

new

getSecondSensorEnabled

—

✓

new

setSecondSensorEnabled

—

✓

new

startIV

✓

✓

params renamed

stopIV

✓

✓

unchanged

IVStatus

✓

✓

unchanged

getIvData

✓

—

→ GET /download/ivsweep

getRecordData

✓

—

→ GET /download/recordings

getIvFile

✓

—

→ GET /download/ivsweep

startRecording

✓

—

→ setRecord {"value":true}

stopRecording

✓

—

→ setRecord {"value":false}

setRecord

—

✓

replaces start/stop recording

setBiasCurrent

✓

✓

unchanged (μA)

getBiasCurrent

✓

✓

unchanged (μA)

setTriggerVoltage

✓

✓

unchanged (mV)

getTriggerVoltage

✓

✓

unchanged (mV)

setLatchingVoltage

✓

✓

unchanged (mV)

getLatchingVoltage

✓

✓

unchanged (mV)

setUnlatchSequences

✓

✓

unchanged

getUnlatchSequences

✓

✓

unchanged

setLatchFrequencyLowerLimit

✓

✓

unchanged

getLatchFrequencyLowerLimit

✓

✓

unchanged

setLatchFrequencyUpperLimit

✓

✓

unchanged

getLatchFrequencyUpperLimit

✓

✓

unchanged

setPgaGain

✓

✓

unchanged

getPgaGain

✓

✓

unchanged

setPrescale

✓

✓

unchanged

getPrescale

✓

✓

unchanged

turnOnAllMcus

✓

✓

unchanged

turnOffAllMcus

✓

✓

unchanged

resetAllMcus

—

✓

new

setMcuStatus

✓

✓

unchanged

setChannelLog

✓

✓

unchanged params

setSerialNumber

✓

✓

unchanged

getSerialNumber

✓

✓

unchanged

startAutoCool

✓

✓

unchanged

stopAutoCool

✓

✓

unchanged

getAutoCoolStatus

✓

✓

unchanged

getAutoCoolDevices

✓

✓

unchanged

getPlotSettings

—

✓

new