Connecting to AT1000 devices
This section describes how to find and connect to AT1000 devices on the network.
Under the hood, all interactions with AT1000 hardware happen over TCP/IP transactions. In stand-alone mode a project script runs in an isolated OCI container on the device itself; in remote mode the same script runs on a PC on the LAN.
The SDK papers over the difference: AT1000.isStandalone() tells you which mode you are in, and AT1000.findLocalDevice() resolves the device's own address directly (without mDNS) when running on-device. The same code is portable between stand-alone and remote operation:
- NodeJS
- Python
import { AT1000 } from '@ikalogic/at1000';
let host;
if (AT1000.isStandalone()) {
host = await AT1000.findLocalDevice(); // on-device: resolve own address, no mDNS
} else {
const devices = await AT1000.findDevices();
host = devices[0]; // remote: first device found on the LAN
}
from ikalogic_at1000 import AT1000
if AT1000.is_standalone():
host = AT1000.find_local_device() # on-device: resolve own address, no mDNS
else:
devices = AT1000.find_devices() # remote: discover devices on the LAN
host = devices[0]
Discovering AT1000 Devices​
Before a test sequence can be launched (controlling outputs and measuring inputs), a device needs to be found on the network.
Discovery returns a list of host strings (e.g. AT1032S-000022.local) - not connected devices. Enumerating the network never takes control of anything. The following code lists every device found and prints its host:
- NodeJS
- Python
import { AT1000 } from '@ikalogic/at1000';
let hosts = await AT1000.findDevices(500); // timeout in milliseconds → host strings
if (hosts.length === 0) {
console.log("No devices found");
process.exit(1);
}
// Loop through discovered devices and print their host strings
hosts.forEach((host, index) => {
console.log(`Device ${index + 1}: ${host}`);
});
from ikalogic_at1000 import AT1000
hosts = AT1000.find_devices(0.5) # timeout in seconds → host strings
if len(hosts) == 0:
print("No devices found")
exit(1)
# Loop through discovered devices and print their host strings
for index, host in enumerate(hosts):
print(f"Device {index + 1}: {host}")
Opening a device​
To control a device, open it with AT1000.open(host). Opening takes exclusive access of the device (last-open-wins - see Device access control) and returns a tester object. The example below picks the first discovered device, opens it, resets it to a known state, and reads its identity from tester.info:
- NodeJS
- Python
import { AT1000 } from '@ikalogic/at1000';
let hosts = await AT1000.findDevices();
let tester = await AT1000.open(hosts[0]); // Open the first device (takes exclusive access)
await tester.reset(); // Reset the device to its default state
console.log(`Connected to ${tester.info.model} (Serial: ${tester.info.serial_number})`);
from ikalogic_at1000 import AT1000
hosts = AT1000.find_devices()
tester = AT1000.open(hosts[0]) # Open the first device (takes exclusive access)
tester.reset() # Reset the device to its default state
print(f"Connected to {tester.info.model} (Serial: {tester.info.serial_number})")
# tester.close() # release the HTTP client and event stream when done
Exclusive access & read-only mode​
A normal open() takes exclusive control of the device: any client that opened it earlier is revoked. When you only need to monitor a device - read pin states, watch power telemetry, subscribe to events - open it read-only. A read-only client mints no session, sends no session header, and never takes control away from whoever is driving the device:
- NodeJS
- Python
const monitor = await AT1000.open(hosts[0], { readonly: true });
monitor = AT1000.open(hosts[0], readonly=True)
See Device access control for the full model.
Some code examples in the next sections of this documentation assume that a tester variable representing an opened AT1000 device already exists (created with AT1000.open(...) as shown above). The discovery-and-open preamble may not be repeated in every example for simplicity and readability.