Skip to main content

HMI (Screen, Button, and Sound)

The AT1000 provides a simple yet functional Human-Machine Interface (HMI) that allows engineers to provide user feedback and interaction during test sequences. The HMI consists of:

  • A color LCD screen (160 × 80 resolution)
  • An audio speaker for notifications
  • A rotary knob for user interaction

The image below shows the different elements on the front panel of the AT1000 device:

HMI Capabilities​

The HMI is designed for:

  1. Displaying status messages and progress information to the user.
  2. Allowing simple user interactions during test sequences.

Built-in single-choice prompts let an operator answer a question with the knob, without programming a menu.

What the HMI is not made for

The AT1000's HMI and API are not designed for building complex navigation menus, displaying images, or playing user-defined sound effects. While the hardware is capable of advanced graphics and audio, the HMI is intentionally simplified for ease of use in test automation.

Note

The examples assume that tester is an open AT1000 controlling session.

Asking the operator a question​

Ask a question on the screen, then check the result status before using the answer.

const request = {
text: "Continue the run?",
choices: ["Yes", "No"],
};
const result = await tester.hmi.prompt(request);

if (result.status === "selected") {
console.log(`Selected ${result.selection.index}: ${result.selection.label}`);
} else if (result.status === "timed_out") {
console.log("No answer: the prompt timed out.");
} else if (result.status === "cancelled") {
console.log(`Prompt cancelled: ${result.reason}`);
}

Turn the knob to change the selected choice, then click to confirm. Holding the knob for more than five seconds invokes panel reclaim.

Long questions page automatically. The amber deadline bar disappears on the first rotation. The confirmed choice appears briefly before the previous screen returns, unless another owner or the panel replaces it.

See the request fields, results, and ownership rules before combining a prompt with other HMI operations.

Screen Control​

The AT1000 screen can display text messages, update the foreground and background colors, and show a progress bar.

Screen mutations conflict with a pending prompt. See prompt ownership.


// Set the screen colors (text: white, background: blue)
await tester.hmi.screen().colors({ text: "#FFFFFF", background: "#0000FF" });

//Clear all content on the screen
await tester.hmi.screen().clear();

// Display some text, and replace any previous text.
await tester.hmi.screen().print("Test is \nin progress...");

// Update the progress bar to 75%.
// Setting progress to 0 hides the progress bar
await tester.hmi.screen().progress(75);

Speaker Control​

The built-in speaker emits predefined sound effects for success, notifications, and failures. These sounds help alert users about test status.


// Play success sound at full volume
await tester.hmi.audio().play({ sound_id: "success", volume: 100 });

// Play a notification sound at 50% volume
await tester.hmi.audio().play({ sound_id: "notification_1", volume: 50 });

// Play a failure sound at 80% volume
await tester.hmi.audio().play({ sound_id: "failure", volume: 80 });

Knob Interaction​

The rotary knob allows for two types of user interactions:

  • Push interaction (pressing the knob)
  • Rotation interaction (turning left or right, counted in detent steps: one step per click)

Raw knob reads conflict with a pending prompt. Use its result instead. See prompt ownership.


let event = await tester.hmi.knob().wait_event(2000); // timeout in milliseconds

if (event) {
console.log("Button press: " + event.button_pressed);
console.log("Knob rotation: " + event.rotation_delta);
}


API Reference​

Accessing HMI​

const hmi = tester.hmi;

HMI Module Methods​

prompt(request)​

Displays a single-choice prompt and waits for selection, timeout, or cancellation.

SDKContract
JavaScriptprompt(request: PromptRequestInput, options?: { signal?: AbortSignal }): Promise<PromptState>
Python syncprompt(request: PromptRequest) -> PromptState
Python asyncasync prompt(request: PromptRequest) -> PromptState
Rustprompt(&self, request: PromptRequest) -> Result<PromptState, At1000Error>

With ikalogic_at1000.aio.AT1000, call the Python method with await. It accepts the same PromptRequest and returns the same PromptState.

Request fields

FieldMeaning and limits
textNonblank question, at most 256 UTF-8 bytes. Line feeds are allowed, but no other control characters.
choices1–32 choices in display order. JavaScript and Python accept strings or objects with label and optional color. Rust uses PromptChoice::new(label).color(Color), or a bare &str for an uncolored choice.
labelNonblank, at most 64 UTF-8 bytes, with no control characters. Duplicate labels are valid: position identifies a choice.
colorOptional choice background in #RRGGBB format (a Color in Rust). Default: #1769AA. The device chooses contrasting black or white text.
default_indexZero-based initial highlight, below the number of choices. Default: 0. It does not confirm a choice.
timeout_msInteger milliseconds from 1,000 through 1,800,000, inclusive. Default: 60,000. Guards an untouched prompt. Rust has no timeout_ms field: it uses .timeout(Duration), from 1 s through 30 min.

In Rust, build the request with PromptRequest::new(text), then add choices with .choice() or .choices(), and set .default_index() and .timeout() as needed.

The LCD rejects question or label characters missing from its Montserrat font.

The deadline stops on rotation

The first knob rotation permanently disables the device deadline. This applies even if the highlight cannot move at an endpoint. timeout_ms (.timeout() in Rust) is not a maximum duration for operator interaction.

For example, give a destructive choice a distinct background and make it the initial highlight:

const request = {
text: "Choose the next action.",
choices: [
{ label: "Retry", color: "#1769AA" },
"Skip",
{ label: "Abort run", color: "#B3261E" },
],
default_index: 2,
timeout_ms: 60000,
};

Result: PromptState

FieldMeaning
idOpaque prompt resource ID, not a choice identifier.
statuspending, selected, cancelled, or timed_out. The high-level SDK call waits for a terminal result.
selectionAlways present as { label, index }. Current highlight while pending, confirmed choice when selected, last highlight otherwise.
reasonCancellation only: client_cancelled, session_ended, panel_exit, or display_replaced.

Rust has no status or reason field: PromptState.outcome is a PromptOutcome, and a cancellation carries its PromptCancelReason. prompt() only returns once the prompt has ended, so its result is never Pending. Both enums are #[non_exhaustive], so a match on them needs a _ arm. PromptCancelReason keeps a reason this SDK version does not know in Unknown(String).

#[non_exhaustive]
pub enum PromptOutcome {
Pending,
Selected,
Cancelled { reason: PromptCancelReason },
TimedOut,
}

#[non_exhaustive]
pub enum PromptCancelReason {
ClientCancelled,
SessionEnded,
PanelExit,
DisplayReplaced,
Unknown(String),
}

Prompt ownership and errors​

The controlling session owns the prompt. Only one prompt can be pending on a device.

Reserved LCD and knob

While a prompt is pending, another prompt, screen mutations, hmi.reset(), and raw knob reads return CONFIGURATION_CONFLICT. Audio and unrelated hardware operations remain available.

Timeout and server-side cancellation return results. Validation, transport, and API failures raise errors. Do not use whole-device tester.reset() to cancel a prompt: it is not an atomic cancellation operation.

JavaScript accepts an AbortController signal. For example, this gives the application its own ten-second cancellation deadline:

const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), 10000);
try {
const result = await tester.hmi.prompt(request, { signal: controller.signal });
console.log(result.status);
} finally {
clearTimeout(timer);
}

An abort rejects with the original abort reason and attempts server cancellation. Python synchronous interruption and async task cancellation also attempt best-effort server cancellation before propagating the original exception. Rust has no extra cancellation argument.

SDK waits follow hmi.prompt events and read the state again when their event window expires. They do not impose an unconditional local deadline after the operator engages.

Losing the network alone does not cancel the prompt. After engagement, it can remain pending until confirmation, cancellation, or session loss. Losing control of the device cancels a pending prompt.

Prompt REST endpoints​

Direct API clients must send the active X-AT1000-Session header on all three routes.

RequestResult
POST /v0/hmi/promptsCreate a prompt. Returns HTTP 201 and PromptState.
GET /v0/hmi/prompts/{id}Read the owning session's state.
DELETE /v0/hmi/prompts/{id}Cancel a pending prompt with client_cancelled. Returns an already-terminal state unchanged.

REST choices must be objects, rather than the SDK string shorthand:

{
"text": "Continue the run?",
"choices": [{"label": "Yes"}, {"label": "No"}],
"default_index": 1,
"timeout_ms": 60000
}

Example state after the operator confirms No:

{
"id": "42",
"status": "selected",
"selection": {"label": "No", "index": 1}
}

For a valid owning session, unknown, expired, or other-owner IDs return HTTP 404 RESOURCE_NOT_FOUND. The session gate can reject missing or revoked tokens first. Invalid fields return HTTP 400.

Terminal results last up to five minutes, with at most the newest 32 retained.

Other HMI module methods​

reset()​

Returns the HMI to its power-on state: restores the default colors, then does the same as clear(): the text and the progress bar are hidden and the logo page is shown.

This returns CONFIGURATION_CONFLICT while a prompt is pending. See prompt ownership.

await tester.hmi.reset();

Returns: Promise<void> / None / Result<(), At1000Error>


screen()​

Access the screen interface for display operations.

const screen = tester.hmi.screen();

Returns: Screen instance / Screen in Rust (returned directly, not a Result)


audio()​

Access the audio interface for sound playback.

const audio = tester.hmi.audio();

Returns: Audio instance / Audio in Rust (returned directly, not a Result)


knob()​

Access the rotary knob interface for user input.

const knob = tester.hmi.knob();

Returns: Knob instance / Knob in Rust (returned directly, not a Result)


Screen Class​

Screen modifications return CONFIGURATION_CONFLICT while a prompt is pending. See prompt ownership.

print(text)​

Displays text on the screen.

await screen.print("Test in progress...");

Parameters:

  • text (string / str / &str): Text to display, from 0 to 1024 Unicode scalar values (inclusive). Empty text is allowed. The limit counts neither UTF-8 bytes nor JavaScript UTF-16 code units: for example, a character outside the Basic Multilingual Plane, such as U+1F600, counts as one value.

Returns: Promise<string> / str / Result<String, At1000Error> - The displayed text

Exceptions:

  • All three SDKs reject text longer than 1024 Unicode scalar values locally, before sending a request.

colors(config)​

Sets the screen color scheme.

await screen.colors({
text: "#FFFFFF",
progress: "#00FF00",
background: "#000000"
});

Parameters:

  • config (Color / ScreenColorsPatch in Rust): Color configuration object:
    • text (string / str / Option<Color>, optional): Text color in hex format (#RRGGBB)
    • progress (string / str / Option<Color>, optional): Progress bar color in hex format (#RRGGBB)
    • background (string / str / Option<Color>, optional): Background color in hex format (#RRGGBB)

In Rust, write a Color as Color::rgb(0xFF, 0xFF, 0xFF) or parse it with "#FFFFFF".parse()?. A None field keeps its current color, so ..Default::default() leaves the fields you do not set unchanged.

Returns: Promise<Color> / Color / Result<ScreenColors, At1000Error> - The applied color configuration

Exceptions:

  • Throws validation error if color strings are not valid hex colors (#RRGGBB format). In Rust, parsing an invalid string into a Color returns InvalidInput.

progress(value)​

Sets the progress bar value.

await screen.progress(50); // 50%
await screen.progress(0); // Hide progress bar

Parameters:

  • value (number / int / f64): Progress percentage (0 to 100). Setting to 0 hides the progress bar in JavaScript and Python; in Rust, 0 shows an empty bar and clear_progress() hides it.

Returns: Promise<Progress> / Progress / Result<f64, At1000Error> - Object containing the progress value

Exceptions:

  • Throws validation error if value is outside the range [0, 100]

clear_progress()​

Removes the progress bar. This method exists in Rust only. In JavaScript and Python, progress(0) hides the progress bar.

let screen = tester.hmi.screen();
screen.clear_progress()?;

Returns: Result<(), At1000Error>


clear()​

Empties and hides the text, hides the progress bar and shows the logo page. Colors are unchanged. The next print() or progress() replaces the logo page; after clear(), print() alone shows no progress bar until progress() is called again.

await screen.clear();

Returns: Promise<void> / None / Result<(), At1000Error>


clear_text()​

Empties and hides the text, keeping colors and the progress bar. Unlike clear(), it does not bring back the logo page.

await screen.clear_text();

Returns: Promise<void> / None / Result<(), At1000Error>


Audio Class​

play(config)​

Plays a sound with specified volume. In Rust, play takes a Sound and the volume as two arguments instead of a configuration object.

await audio.play({
sound_id: "success",
volume: 80
});

Parameters:

  • config (PlaybackConfiguration; in Rust, the two arguments sound: Sound and volume: f64):
    • sound_id (string / str / Sound, required): Sound identifier - one of:
      • "success" - Success/pass sound
      • "warning" - Warning sound
      • "failure" - Failure/error sound
      • "notification_1" - Notification sound 1
      • "notification_2" - Notification sound 2
      • "imperial_march" - Imperial March theme !
    • volume (number / int / f64, required): Volume level (0 to 100)

The list is the set of sounds shipped with the AT1000 firmware; you cannot add your own.

In Rust, Sound has one variant per sound: Sound::Success, Sound::Warning, Sound::Failure, Sound::Notification1, Sound::Notification2, and Sound::ImperialMarch. "notification_1".parse::<Sound>()? parses a sound identifier.

Returns: Promise<PlaybackConfiguration> / PlaybackConfiguration / Result<(), At1000Error> - The playback configuration (nothing in Rust)

Exceptions:

  • Throws validation error if sound_id is not one of the valid values. In Rust, a Sound is always valid; parsing an unknown identifier returns InvalidInput.
  • Throws validation error if volume is outside the range [0, 100]

Knob Class​

Knob reads require control of the device and return CONFIGURATION_CONFLICT while a prompt is pending. See prompt ownership.

read_event()​

Reads and consumes the pending knob input, without waiting. The result reports whether the button was pressed since the previous knob read, whether it is held now, and the rotation since the previous knob read in signed detent steps: one step per physical click, positive for clockwise. Every knob read consumes the pending input, including the reads made by is_button_held(), is_knob_turned() and wait_event().

const event = await knob.read_event();
console.log("Pressed:", event.button_pressed, "Held:", event.button_held);
console.log("Detent steps:", event.rotation_delta);

Returns: Promise<{ button_pressed, button_held, rotation_delta }> / InternalKnobEvent / Result<KnobEvent, At1000Error>

  • button_pressed (boolean / bool / bool): True if the button was pressed since the previous knob read
  • button_held (boolean / bool / bool): True if the button is held now
  • rotation_delta (number / int / i32): Signed detent steps since the previous knob read, positive for clockwise; 0 if the knob did not turn

wait_event(timeout_ms)​

Waits for a knob event (rotation or button press) with a timeout. It first reads and discards one pending event, so input made before the call is ignored, then polls until the button is pressed or the knob turns at least one detent. A held button alone does not end the wait. Each poll consumes the pending knob input.

const event = await knob.wait_event(5000); // Wait up to 5 seconds

if (event) {
console.log("Button pressed:", event.button_pressed);
console.log("Rotation delta:", event.rotation_delta);
} else {
console.log("Timeout - no event");
}

Parameters:

  • timeout_ms (number / int / Option<Duration>): Timeout in milliseconds (a Duration in Rust). Optional; omit it (pass None in Rust) to wait indefinitely

Returns: Promise<KnobEvent | null> / KnobEvent | None / Result<Option<KnobEvent>, At1000Error> - Event object or null/None if timeout

In Rust the timeout is a std::time::Duration or None; Duration::ZERO returns None without contacting the device.

KnobEvent properties:

  • button_pressed (boolean / bool / bool): True if the button was pressed since the previous poll
  • rotation_delta (number / int / i32): In JavaScript and Python, the direction only: 1 for clockwise, -1 for counter-clockwise, 0 for a button press without rotation, whatever the number of detents turned. In Rust, the signed number of detent steps read by the poll that ended the wait; rotation() returns the direction

The Rust KnobEvent also has button_held and a rotation() method. See KnobEvent.


is_button_held()​

Checks if the knob button is currently held down. Rust has no is_button_held(): read button_held from knob.read_event(). Each read consumes the pending knob event.

const held = await knob.is_button_held();
console.log("Button is", held ? "held" : "not held");

Returns: Promise<boolean> / bool / bool from Result<KnobEvent, At1000Error> in Rust - True if button is pressed, false otherwise


is_knob_turned()​

Polls once and reports whether the knob moved at least one step since the previous poll. Rust has no is_knob_turned(): check rotation_delta != 0 on knob.read_event(). Each read consumes the pending knob event.

const turned = await knob.is_knob_turned();

Returns: Promise<boolean> / bool / bool from Result<KnobEvent, At1000Error> in Rust


Types​

Color​

{
text?: string, // Hex color: #RRGGBB
progress?: string, // Hex color: #RRGGBB
background?: string // Hex color: #RRGGBB
}

Rust: ikalogic_at1000::ScreenColorsPatch (what you send) and ikalogic_at1000::ScreenColors (what the device returns). Each field holds a Color, one sRGB color written #RRGGBB on the wire. Build it with Color::rgb(0xFF, 0xFF, 0xFF) or parse it with "#FFFFFF".parse()?; it displays as #RRGGBB.

pub struct ScreenColorsPatch {
pub text: Option<Color>,
pub progress: Option<Color>,
pub background: Option<Color>,
}

pub struct ScreenColors {
pub text: Color,
pub progress: Color,
pub background: Color,
}

pub struct Color(/* private */);

impl Color {
pub const fn rgb(red: u8, green: u8, blue: u8) -> Self;
pub const fn components(self) -> [u8; 3];
}

Progress​

{
progress: number // 0 to 100
}

Rust: f64 - Screen::progress takes and returns the percentage itself, with no wrapper type.

PlaybackConfiguration​

{
sound_id: "success" | "warning" | "failure" |
"notification_1" | "notification_2" | "imperial_march",
volume: number // 0 to 100
}

Rust: Audio::play takes a Sound and the volume directly. ikalogic_at1000::PlaybackConfiguration is only the payload of the hmi.play event; its sound_id stays a string so a sound added by newer firmware still decodes. Compare it with Sound::as_str().

pub enum Sound {
Success, // "success"
Warning, // "warning"
Failure, // "failure"
Notification1, // "notification_1"
Notification2, // "notification_2"
ImperialMarch, // "imperial_march"
}

impl Sound {
pub fn as_str(&self) -> &'static str;
}

pub struct PlaybackConfiguration {
pub sound_id: String,
pub volume: f64,
}

KnobEvent​

wait_event() result in JavaScript:

{
button_pressed: boolean,
rotation_delta: number // -1, 0 or 1
}

read_event() also returns button_held: boolean, and its rotation_delta is the signed number of detent steps.

Python: ikalogic_at1000.KnobEvent (returned by wait_event(), rotation_delta is -1, 0 or 1) and ikalogic_at1000.InternalKnobEvent (returned by read_event(), with button_held and the signed number of detent steps).

Rust: ikalogic_at1000::KnobEvent, returned by read_event() and, wrapped in an Option, by wait_event(). In both, rotation_delta is the signed number of detent steps. rotation() returns the direction of rotation_delta, or None when the knob did not turn.

pub struct KnobEvent {
pub button_pressed: bool,
pub button_held: bool,
pub rotation_delta: i32,
}

impl KnobEvent {
pub fn rotation(&self) -> Option<Rotation>;
}

pub enum Rotation {
Clockwise,
CounterClockwise,
}

Notes​

  • Screen resolution is 160 × 80 pixels (width × height)
  • Screen supports multi-line text with \n line breaks
  • Screen text accepts 0 to 1024 Unicode scalar values, inclusive, consistently across JavaScript, Python, and Rust
  • Colors must be in hex format with leading # (e.g., #FF0000)
  • Volume ranges from 0 (mute) to 100 (maximum)
  • read_event() reports knob rotation in signed detent steps since the previous knob read (positive = clockwise). Every knob read consumes the pending input
  • The wait_event() method blocks until an event occurs or timeout
  • print() replaces the previous text. clear() hides the text and the progress bar and shows the logo page, clear_text() removes only the text, and hmi.reset() also restores the default colors
  • Progress bar value is independent of displayed text