Euphoria F1 API Reference
The Euphoria F1 exposes three local interfaces: BLE GATT services for wireless sensor streaming, a REST API over WiFi for device configuration, and a WebSocket endpoint for real-time data.
Contents
Connecting to the Device
The Euphoria F1 runs a WiFi access point and a BLE server simultaneously. You can use either interface depending on your use case.
WiFi (REST API + WebSocket)
Connect to the device's WiFi network. The default SSID is Euphoria F1 (configurable). The device IP is always 192.168.4.1.
Once connected, a captive portal opens automatically on most devices. The REST API and WebSocket are available on port 80.
Bluetooth Low Energy
The device advertises as Euphoria F1 (or Euphoria F1 HID in HID mode). Manufacturer data contains company ID 0x0FD5 (Telemacy Ltd).
Pairing uses Secure Connections with passkey 123456. The user must confirm by pressing the physical button on the device. Once paired, bonding information is stored persistently.
Authentication
Protected REST endpoints require a session token. The token is obtained through a physical button approval flow.
Step 1: Open a WebSocket connection
const ws = new WebSocket('ws://192.168.4.1/ws');
You need this open before requesting auth, because the token is delivered over WebSocket.
Step 2: Request authentication
// Response:
{ "status": "ok", "message": "Press button on device" }
The device LED starts blinking. You have 30 seconds to press the button.
Step 3: User presses the physical button
{ "type": "auth_success", "token": "a1b2c3d4e5f6...64 hex chars" }
Short press = approve. Long press = reject. Store this token for subsequent API calls.
Step 4: Use the token
Authorization: a1b2c3d4e5f6...
Token expires after 10 minutes of inactivity. Max 4 concurrent sessions.
Check auth status
// Response:
{ "authenticated": true, "status": "authenticated" }
BLE GATT Services
All custom services use the base UUID 0000XXXX-6136-4d92-9bb7-5bab7345fa61 where XXXX is the 16-bit service/characteristic ID.
Device Information Service
0x180A (Standard)Sensor Data Service
0x0004 (Custom)8 FSR pressure sensor values streamed at up to 50Hz.
{ "timestamp": 12345, "values": [100, 200, 150, 175, 220, 180, 190, 210] }
Values range 0-2500 (ADC units, averaged over 10 readings).
Sum of all 8 sensor values as a uint16 (little-endian, 2 bytes). Range: 0-20000.
Button Events Service
0x0006 (Custom){ "event": "short_press", "timestamp": 54321 }
Events: short_press, double_press, long_press
Device Mode Service
0x0007 (Custom)Modes: normal, config, factory_reset_confirm
WebSocket API
Endpoint
Subscribe to sensor stream
{ "type": "subscribe", "channel": "sensors" }
{
"type": "sensor_update",
"timestamp": 12345,
"sensors": [100, 200, 150, 175, 220, 180, 190, 210],
"sum": 1425
}
Unsubscribe
Button events (automatic)
Button events are broadcast to all connected WebSocket clients without subscribing.
Full example
ws.onopen = () => {
// Subscribe to sensor data
ws.send(JSON.stringify({
type: 'subscribe',
channel: 'sensors'
}));
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
if (data.type === 'sensor_update') {
// data.sensors = [s0, s1, s2, s3, s4, s5, s6, s7]
// Each value: 0-2500
console.log('Pressure:', data.sensors);
}
if (data.type === 'button_event') {
console.log('Button:', data.event);
}
};
REST API
Base URL: http://192.168.4.1. Endpoints marked with a lock require an auth token in the Authorization header.
Authentication
Request authentication. Device LED blinks, waiting for button press.
Check current authentication status.
Device Status
Device info, firmware version, current mode.
Current sensor readings (one-shot, not streaming).
WiFi
Scan for available WiFi networks.
Connect to a WiFi network.
Current WiFi connection status.
Disconnect from WiFi network.
Configuration
Get all device configuration.
Set device name and identifiers. All fields optional.
Configure audio/mute settings.
Configure sleep timeout. All fields optional.
Configure whether device boots into HID mode.
Control
Calibrate sensors (reset baseline to current pressure).
Restart the device.
Factory reset. Clears all settings and bonding data.
Remove all paired BLE devices.
List all paired BLE devices.
Remove a specific paired device. Pass ?address=AA:BB:CC:DD:EE:FF as query parameter.
HID
HID mode status.
Enable HID mode. Device will re-advertise as HID.
Disable HID mode. Returns to normal BLE mode.
Get all trigger configurations.
Create or update a trigger.
Delete a trigger. Pass ?id=0 as query parameter.
List available trigger presets.
Load a trigger preset.
HID Mode (Dick Interface Device)
In HID mode, the Euphoria F1 acts as a Bluetooth keyboard and mouse. It advertises as Euphoria F1 HID and supports up to 11 configurable triggers that map pressure and button inputs to keystrokes or mouse clicks.
Trigger input types
Triggered when pressure rises on a sensor.
Triggered when pressure drops on a sensor.
Triggered when pressure is held above a threshold.
Triggered when pressure drops below threshold.
Triggered when pressure crosses a specific value.
Physical button quick press.
Physical button pressed twice quickly.
Physical button held for 2+ seconds.
Trigger output types
Any HID key code with optional modifiers (Ctrl, Shift, Alt, Win).
Left, right, or middle mouse button click.
Hold a key while trigger is active, release when trigger stops.
Built-in presets
Switching modes
Enter HID mode via the configuration portal or REST API. Exit by holding the button for 7 seconds. The device will disconnect all BLE clients and re-advertise in the new mode.