joint_diagnostics (SUB)
Joint diagnostics stream: subscribe to per-joint status word, current, bus voltage, temperature, and error code. Frames are variable-length and contain only online joints — identify each entry by itsnid. This stream and joint_states ride the same device stream, so lowering the push rate of one lowers both — see joint_states (SUB).
error_code_current with the static method WujiHand2.describe_error(code). The returned object carries code, the error name, desc, cause, resolution, severity (Warning / DeferredStop / ImmediateStop / Fatal), and clear_policy (AutoClear / ManualClear / NonClearable). Use cause and resolution to identify and address the fault. Unknown codes return None. Printing a diagnostics entry object shows error codes in hex.
For joint angles, use
position from the joint_states stream — the diagnostics stream doesn’t carry joint angles.comm_diag (GET, 1 Hz)
Communication diagnostics: returns the throughput / error rate of the 5 fingers, once per second.Flash Log Export (Diagnostics)
flash_<serial>_<YYYY-MM-DD_HHMMSS>.jsonl file to out_dir. Omit out_dir to use ~/.wuji/logs.
The SDK writes to a temporary file and makes the JSONL file available only after the export finishes. If the export fails, the SDK removes the temporary file, so the output directory contains no partial export.
Starting with firmware v2.6.0, one device supports concurrent exports. On earlier firmware, export one at a time.When multiple sessions export logs from the same device, the SDK retries automatically. If the export still can’t finish, the call reports that the device is busy. The SDK removes the temporary files and doesn’t keep an unfinished log.
Data Types
JointDiagnosticsFrame / JointDiagnosticsEntry
Joint diagnostics frame: frame type of thehand.joint_diagnostics().subscribe() stream. Variable-length, online joints only.
HandCommunicationDiagnostics
Communication diagnostics data.StatusWord
Status word: the type of thestatus_word field on JointDiagnosticsEntry, the public status view exposed by the SDK.
Hand2CommSummary
Frame-level communication health summary: the type of thecomm field on JointDiagnosticsFrame, combining the device-internal bus view with the SDK-local end-to-end (Ethernet) view. The device-internal part comes from a snapshot the SDK refreshes automatically at 1 Hz — no polling required.
Reading the device-internal fields.
age_ms and the per-joint comm_* fields
all come from one snapshot the SDK refreshes at 1 Hz. The refresh is deliberately
skipped while a firmware upgrade is running, so a briefly stale snapshot is expected
rather than a fault. Tell the two cases apart with
comm_get_failures: a growing age_ms while comm_get_failures stays flat means the
refresh is being skipped on purpose, while comm_get_failures increasing means the refresh
itself is failing.Exception Handling
All SDK operation errors raise a unifiedWujiException whose message carries an error-type prefix (Disconnected, Timeout, PathNotFound, SchemaMismatch, SerializeError, …). Use try / except as needed.
Device Fault Codes
error_code_current in the joint diagnostics and error_code in the error history are both u16 device fault codes. Decode them with WujiHand2.describe_error().
Device fault codes lay their hex digits out as 0xSCNN, but don’t decode the digits yourself — the severity and clear_policy fields returned by describe_error() carry the same information as plain strings and stay correct if the layout ever changes. Treat the code as an opaque identifier: log it, show it to the user, quote it in a bug report. When decoding succeeds, use the returned severity and clear_policy to decide how to react. When describe_error() returns None (an unknown code), don’t access those fields — keep the original value for logging and bug reports.
- Python
- C
Python: See the Python API examples earlier on this page.