Overview
Devices are the core entities in Joystick that represent physical IoT hardware. Each device contains configuration, connection information, and operational state that enables remote control and monitoring.Device structure
A device in Joystick consists of several key components:Device fields
Device fields
Unique identifier for the device
Human-readable device name
Reference to the device model that defines capabilities
Current operational status:
on, off, or waitingCurrent operating mode of the device
Array of user IDs with access to control this device
Connection and configuration details (see below)
Device-specific settings and parameters
Automated scheduling configuration
Device information
Theinformation field contains critical connection details and hardware-specific configuration:
packages/core/src/types/index.ts
SSH connection parameters
- SSH key authentication
- Password authentication
- Default authentication
The recommended method for secure device access:
SSH keys are stored securely and written to temporary files with 600 permissions during command execution.
Dual-SIM slot management
Joystick supports devices with dual SIM slots, enabling automatic failover between network connections.Slot configuration
Determines which SIM slot is currently active:
primary- Useshostandphonesecondary- UsessecondSlotHostandsecondSlotPhone
Enables automatic switching between slots when primary connection fails
Active connection resolution
Joystick automatically determines the active connection based on the slot configuration:packages/core/src/device.ts
The active slot is used for all SSH commands and network operations. The switcher service monitors connection health and can automatically change slots.
Device automation
Devices support automated mode switching based on time or duration:- Duration-based
- Time-based
Switch modes after a specified time period:
Configuration examples
Complete device configuration
Device access control
Access to devices is controlled through theallow field, which contains an array of user IDs:
Device status monitoring
Joystick provides a ping endpoint to check device connectivity:- Retrieves the active host using
getActiveDeviceConnection() - Executes
ping -c 1 {host} - Returns connection status
You can customize the expected ping result using the
result query parameter for non-standard ping outputs.Related resources
Actions
Learn how to execute commands on devices
Streaming
Configure video streams from devices
Authentication
Understand device access control