Overview
The OSSM Lite firmware (ESP32, NimBLE stack) exposes a GATT server with four services. It is designed so that a plain web page using the Web Bluetooth API can do everything the official tooling does: control playback, stream positions, configure and provision a device, and update its Wi-Fi credentials.
- Almost every value on the bus is a plain UTF-8 string — numbers, booleans, even small JSON documents. There is no binary framing to speak of, with one exception (the Fleshy service).
- There are two generations of API on the device: the modern OSSM service (one characteristic per setting) and a Legacy service that funnels text commands through a single characteristic. Both are live and both are documented here.
- This reference matches firmware v1.6.2.
Transport & connection
| Property | Value |
|---|---|
| Role | GATT peripheral (server) |
| Advertised name | The configured device name (default CYBORGTOP, see Rename) |
| Advertised services | OSSM, Legacy, Device Information, Fleshy (scan response enabled) |
| MTU | Server requests a 512-byte MTU exchange on connect, so full state JSON and preset payloads fit in one packet |
| Security | Secure Connections pairing flag set; no bonding, PIN or encryption is required for normal use |
When is the device visible?
The firmware only advertises while it is at rest on an idle screen (menu.idle,
wifi.idle or error.idle) and no client is connected. During boot, homing or active
play the radio is invisible, and advertising resumes when the device returns to the menu. In practice: scan
while the device is sitting on its menu screen, or shortly after boot.
What happens on disconnect
Safety first: when the last client drops, the device returns to the menu and, if it was moving, waits one second and then ramps speed to zero over two seconds with a sine ease. A reconnecting client always starts from a stopped, menu-state device.
Connecting from a web page
Web Bluetooth needs Chrome or Edge, a secure context (https:// or localhost) and a
user gesture. Filtering by the OSSM service UUID is the reliable way to find the device, since its name is
user-configurable:
const OSSM_SERVICE = "4f53534d-0000-0000-0000-000000000000";
const device = await navigator.bluetooth.requestDevice({
filters: [{ services: [OSSM_SERVICE] }],
});
device.addEventListener("gattserverdisconnected", () => {
console.log("device went away");
});
const server = await device.gatt.connect();
const ossm = await server.getPrimaryService(OSSM_SERVICE);
Value conventions
- Strings. Everything is UTF-8 text unless stated otherwise. Encode with
new TextEncoder(), decode withnew TextDecoder(). - Numbers. Written as decimal strings (
"42","3.5"). Floats are parsed with Cstofsemantics; the firmware clamps out-of-range values rather than rejecting them (noted per characteristic). - Booleans. Reads always return
"true"or"false". Writes accepttrue/false/1/0/t/f, case-insensitive. Anything else sets the characteristic value to"error:invalid_value". - Ack pattern. Many characteristics answer a write by storing an acknowledgement (or an
error:/fail:string) in their own value. After an important write, read the characteristic back to see the result. - Notifications. Notify-capable characteristics only fire when the firmware notices a change (see State & notifications); they do not echo every write.
Fun fact that helps when reading UUID tables: the OSSM UUIDs are hex-encoded ASCII.
4f53534d-436f-6e66-6967-486F6D696E67 decodes to "OSSMConfigHoming":
function decodeUuid(uuid) {
const bytes = Uint8Array.fromHex(uuid.replaceAll("-", ""));
return new TextDecoder().decode(bytes);
}
decodeUuid("4f53534d-436f-6e66-6967-486F6D696E67"); // "OSSMConfigHoming"
Service map
| Service | UUID | Purpose |
|---|---|---|
| OSSM | 4f53534d-0000-0000-0000-000000000000 |
Modern API: one characteristic per setting, plus configuration/provisioning and Advanced Penetration |
| Legacy | 522b443a-4f53-534d-0001-420badbabe69 |
Text command channel + state JSON broadcast, kept for older clients |
| Fleshy | 0000ffe0-0000-1000-8000-00805f9b34fb |
Binary "FTS" position streaming (servo-style payloads) |
| Device Information | 0000180a-0000-1000-8000-00805f9b34fb |
Manufacturer, model, firmware version (standard SIG service) |
Property abbreviations used below: R read, W write (with response), WNR write (no response), N notify, I indicate. Unless noted, every OSSM-service characteristic created by the firmware is R + W + WNR + N.
The command mechanism
The Legacy service exposes a single command characteristic — a line-oriented text protocol. This is the simplest integration path: one write fires one action, and the device tells you whether it worked.
| UUID | 522b443a-4f53-534d-1000-420badbabe69 |
| Properties | R + W + WNR |
Flow
- You write a command string (e.g.
set:speed:35). - The firmware validates it against the grammar below. Invalid commands are rejected
immediately: the command characteristic's value becomes
fail:<your command>— read it back to see the rejection. - Valid commands are queued and executed by the state machine within milliseconds. After
execution, the Legacy state characteristic value is set to
ok:<your command>. This ack is not notified — read the state characteristic to collect it.
The queue is only drained while a client is connected, so commands never execute "offline". Values in
set: commands must match (\d|\.)+ — digits and decimal point only, no signs — and
must fall in 0–100.
Grammar
go:(strokeEngine|streaming|menu)
set:(max|min|speed|stroke|depth|sensation|buffer|pattern):(\d|\.)+
set:wifi:[^|]+\|.+
stream:(\d|\.)+:\d+
Command reference
| Command | Effect |
|---|---|
go:menu | Emergency-stops motion and returns to the main menu (any unknown go: target also lands here) |
go:strokeEngine | Enters the Stroke Engine play mode (via the menu selection) |
go:streaming | Enters Streaming play mode |
set:speed:X | Sets BLE speed 0–100 (percent). This is the speed source used while playing; the physical knob can optionally act as a limit (see Speed Knob) |
set:max:X | Sets max position (depth) 1–100 |
set:min:X | Sets min position 0–99; stroke is recomputed as max − min |
set:depth:X | Legacy alias: sets max = X (1–100) and shifts min = X − stroke |
set:stroke:X | Legacy: sets stroke length, min = max − X |
set:sensation:X | Sensation 0–100 — a pattern-specific parameter (see pattern table) |
set:buffer:X | Latency-compensation buffer 0–100 (a number; distinct from the boolean Buffer toggle) |
set:pattern:X | Selects stroke pattern by index (taken modulo the pattern count, 14) |
set:wifi:SSID|PASSWORD | Accepted by the grammar but ignored on the command channel — Wi-Fi provisioning is done through the dedicated WiFi characteristic |
stream:POS:TIME | Queues a move to position POS (0–100) over TIME milliseconds; switches the device into Streaming mode. Send a sequence of these to puppet the rail |
Example
const LEGACY_SERVICE = "522b443a-4f53-534d-0001-420badbabe69";
const COMMAND_UUID = "522b443a-4f53-534d-1000-420badbabe69";
const STATE_UUID = "522b443a-4f53-534d-2000-420badbabe69";
const encoder = new TextEncoder();
const decoder = new TextDecoder();
const legacy = await server.getPrimaryService(LEGACY_SERVICE);
const command = await legacy.getCharacteristic(COMMAND_UUID);
const state = await legacy.getCharacteristic(STATE_UUID);
// Fire a command, then read the ack.
await command.writeValue(encoder.encode("set:speed:35"));
console.log(decoder.decode(await state.readValue())); // "ok:set:speed:35"
// A bad command is rejected into the command characteristic itself.
await command.writeValue(encoder.encode("set:speed:banana"));
console.log(decoder.decode(await command.readValue())); // "fail:set:speed:banana"
OSSM service — runtime characteristics
These are the play-time controls on the OSSM service
(4f53534d-0000-0000-0000-000000000000). All values are strings; positions and speeds are
percentages of the measured rail (0–100). Unless a row says otherwise, properties are
R + W + WNR + N, and a read returns the current live value.
| Characteristic | UUID | Write | Read / notify |
|---|---|---|---|
| Speed | 4f53534d-436f-6d6d-6f6e-005370656564 |
Float 0–100 → BLE speed setpoint | Current effective speed (may differ while ramping or knob-limited) |
| Max Depth | 4f53534d-436f-6d6d-6f6e-4d6178446570 |
Float 0–100; forced to at least min + 1 |
Current max position |
| Min Depth | 4f53534d-436f-6d6d-6f6e-4d696e446570 |
Float 0–100; forced to at most max − 1 |
Current min position |
| Sensation | 4f53534d-456e-6769-6e65-536174696f6e |
Float 0–100 | Current sensation |
| Pattern | 4f53534d-456e-6769-6e65-50617465726e |
Integer pattern index (mod 14). Side effect: switches the device into Stroke Engine mode | Current pattern index. Reading also starts Stroke Engine mode |
| Pattern List (R + W only) | 4f53534d-456e-6769-6e65-5061744c7374 |
Integer index → value becomes "Name:Description" (empty string if out of range) |
Before any write: the pattern count ("14"). After: the last Name:Description |
| Stream | 4f53534d-436f-6d6d-6f6e-53747265616d |
"POS:TIME" (position 0–100, milliseconds). Side effect: switches into Streaming mode and queues the move |
"Ready" — and starting Streaming mode |
| Buffer (latency compensation toggle) | 522b443a-4f53-534d-1030-420badbabe69 ⚠ see quirks |
Boolean — enable/disable latency compensation for streamed positions (not persisted) | Boolean |
| Offset (R + N only) | 4f53534d-436f-6d6d-6f6e-4f6666736574 |
— (read-only) | The current latency buffer number (the value set:buffer:X writes) |
| State | 4f53534d-5374-6174-654d-616368696e65 |
— (read-only, notify) | Current state-machine name, e.g. "strokeEngine.idle". Initial value "ok:boot". See State & notifications |
OSSM service — configuration characteristics
These are the provisioning settings — everything a setup tool needs to commission a fresh device. Values are persisted to flash (NVS) unless noted. All are R + W + WNR + N except WiFi (R + W). A read always returns the currently stored value.
| Setting | UUID | Value | Default | Notes |
|---|---|---|---|---|
| Device name | 4f53534d-436f-6e66-6967-52656e616D65 |
String, truncated to 8 chars | CYBORGTOP |
Also the BLE advertised name (applies after restart). Rate-limited: writes within 1 s of the last are dropped |
| Homing type | 4f53534d-436f-6e66-6967-486F6D696E67 |
Integer enum: 0 None, 1 Default, 2 SingleSided, 3 DoubleTap |
2 |
How the rail finds its zero position |
| Rail length | 4f53534d-436f-6e66-6967-4c656e677468 |
Float, mm; clamped to 50–500 (or the current value if already longer) | 400 |
Physical travel of the rail |
| Re-home between modes | 4f53534d-436f-6e66-6967-5265486F6D65 |
Boolean | false |
Force a homing run when switching play modes |
| Invert direction | 4f53534d-436f-6e66-6967-496e76657274 |
Boolean | false |
Flips rail orientation (motor mounting) |
| Max acceleration | 4f53534d-436f-6e66-6967-4d414343454c |
Float, mm/s² | 10000 |
Not clamped — write sane values |
| Motor max RPM | 4f53534d-436f-6e66-6967-4d415852504d |
Float | 300 |
Motor/belt geometry. Steps-per-mm is derived as stepsPerRev / (pulleyTeeth × beltPitch); max belt speed as rpm / 60 × pulleyTeeth × beltPitch |
| Steps per revolution | 4f53534d-436f-6e66-6967-535445505052 |
Float | 800 |
|
| Pulley teeth | 4f53534d-436f-6e66-6967-50554c4c4559 |
Float | 30 |
|
| Belt pitch | 4f53534d-436f-6e66-6967-425049544348 |
Float, mm | 5 |
|
| Sensor limit | 4f53534d-436f-6e66-6967-53656e736f72 |
Float | 2.5 |
Homing sensor trigger distance |
| Speed curve | 4f53534d-436f-6e66-6967-537064437276 |
Float exponent | 0.8 |
Maps the 0–100 speed percentage onto actual motor speed: (1 − (1 − x)^e)^(1/e) |
| Homing speed | 4f53534d-436f-6e66-6967-537064486f6d |
Float, clamped 10–40 | 25 |
Speed used while searching for the home sensor |
| GPIO | 4f53534d-436f-6e66-6967-20204750494f |
"N:high" / "N:low" (also 1/0), N ∈ 1–3 |
— | Auxiliary output pins; see below |
| WiFi | 4f53534d-436f-6e66-6967-202057694669 |
"set:wifi:SSID|PASSWORD" |
— | Credentials + status; see below |
GPIO details
- Write
"1:high","2:low","3:1"… — the index is 1-based (the firmware maps it to a board pin), level ishigh/low/1/0, case-insensitive. - On success the characteristic value becomes
"ok:<index>:<level>"; on bad input"error:invalid_format"or"error:pin_out_of_range". Read it back for the result. - A read returns the fixed capabilities hint
"pins:[1,2,3,4]"— but only indices 1–3 are actually writable.
WiFi details
- Properties are R + W only (no notify).
- Write format:
set:wifi:<ssid>|<password>. SSID must be 1–32 chars, password 8–63 chars. The device saves the credentials and tries to connect for up to ~10 s — the write callback blocks during this, so expect a slow response. - The characteristic value then holds the outcome:
"ok:wifi:connected","fail:wifi:invalid_format","fail:wifi:invalid_ssid","fail:wifi:invalid_password"or"fail:wifi:connection_failed". - A read returns live status as JSON:
{"connected":true,"ssid":"…","ip":"…","rssi":-52}(onlyconnectedis present when offline). - Wi-Fi exists mainly for over-the-air firmware updates; BLE keeps working regardless.
Advanced Penetration characteristics
"Advanced Penetration" (AP) is the layered motion mode: per-direction depth/speed/acceleration controls plus a step-based modifier, with named presets stored in flash. It lives on the OSSM service as four characteristics. Writing to Control automatically switches the device into AP mode.
| Characteristic | UUID | Properties | Purpose |
|---|---|---|---|
| Control | 4f53534d-6164-7661-6e63-6564636f6e74 |
R + W + WNR | Send value changes |
| Status | 4f53534d-6164-7661-6e63-656473746174 |
R + N | Current values, notified on change while in AP mode |
| Config | 4f53534d-6164-7661-6e63-6564636f6e66 |
R | Self-describing list of control names and min/max ranges |
| Presets | 4f53534d-6164-7661-6e63-656470727374 |
R + W | Save / load / delete named presets |
Control grammar
A write is a list of comma-terminated segments. Each segment is either
<id>:<value>, or <id>:<modifierId>:<value>,.
The trailing comma is what tells the firmware the segment is complete — text after the last comma is kept in
a buffer and prepended to your next write, so you can even split segments across packets. Values are clamped
to the control's range. If a write contains no comma at all, it fails and the characteristic value becomes
"fail:<cmd>".
| Base id | Control | Range | Default |
|---|---|---|---|
0 | Max Depth | 0–100 | 10 |
1 | Min Depth | 0–100 | 0 |
2 | In Speed | 1–100 | 100 |
3 | Out Speed | 1–100 | 100 |
4 | In Accel | 0–100 | 40 |
5 | Out Accel | 0–100 | 40 |
6 | Speed (master) | 0–100 | 0 |
| Modifier id | Modifier | Range | Default |
|---|---|---|---|
0 | Amplitude | 0–100 | 100 (off) |
1 | Steps to Min | 1–25 | 1 |
2 | Steps at Min | 0–25 | 0 |
3 | Steps to Max | 1–25 | 1 |
4 | Steps at Max | 0–25 | 0 |
5 | Offset | 0–100 | 0 |
Modifiers attach to a base control and vary it over a cycle of strokes (amplitude < 100 with a nonzero step count means "active"). Examples:
"6:35," // master speed 35%
"0:80,1:10," // max depth 80, min depth 10
"0:0:50," // Max Depth modifier: amplitude 50
"0:1:4,0:2:2," // Max Depth modifier: 4 steps down to min, pause 2 strokes
Status format (read / notify)
Seven comma-separated values, always in this order:
maxDepth,minDepth,inSpeed,outSpeed,inAccel,outAccel,speed. If a control has an active modifier,
its value is followed by six more colon-separated numbers:
amplitude:stepsToMin:stepsAtMin:stepsToMax:stepsAtMax:offset.
"10,0,100,100,40,40,0" // plain
"15:50:2:1:2:1:0,0,100,100,40,40,35" // max depth 15 with active modifier, speed 35
Config format (read-only)
The same seven controls, but self-describing: Name(min/max) per control, with modifier ranges
appended to Max Depth. Handy for building UIs without hard-coding ranges:
"Max Depth(0/100):Amplitude(0/100):Steps to Min(1/25):Steps at Min(0/25):Steps to Max(1/25):Steps at Max(0/25):Offset(0/100),Min Depth(0/100),In Speed(1/100),Out Speed(1/100),In Accel(0/100),Out Accel(0/100),Speed(0/100)"
Presets
A read returns the comma-separated preset name list, e.g.
"Simple,Teasing,Pounding,Robo,…,Knot (50%),". A write is a one-character opcode plus a name:
| Write | Effect |
|---|---|
>MyName | Save the current settings as preset MyName. Empty name (>) auto-names it "User Pattern N" |
<MyName | Delete the preset |
:MyName | Load the preset (its payload is fed through the Control grammar) |
^ | Factory-reset all presets back to the built-in set |
- After any write, the characteristic value is refreshed to the current name list — read it back to confirm.
- Rate-limited to one command per second; faster writes are silently skipped.
- Preset payloads use the Control grammar, with defaults omitted:
"id:value,"for base values and"id:modId:value,"for modifiers. Example: the built-in "Teasing" preset is"2:50,"(In Speed 50), "Deeper" is"0:0:15,0:3:10,"(Max Depth modifier: amplitude 15, 10 steps to max). - Built-in preset names: Simple, Teasing, Pounding, Robo, Half'n'half, Deeper, Insist, Jackhammer, Progressive, Mid, Knot (75%), Knot (50%).
Legacy service characteristics
Service UUID 522b443a-4f53-534d-0001-420badbabe69. Kept for backwards compatibility with older
clients — new integrations should prefer the OSSM service, but the command/state pair is still the nicest way
to drive the device with one characteristic.
| Characteristic | UUID | Properties | Behaviour |
|---|---|---|---|
| Command | 522b443a-4f53-534d-1000-420badbabe69 |
R + W + WNR | Text command channel — see The command mechanism |
| State | 522b443a-4f53-534d-2000-420badbabe69 |
R + N | Initial value "ok:boot". Notified with the full state JSON whenever the device state changes; set to "ok:<cmd>" after each queued command (not notified — read it) |
| Speed Knob | 522b443a-4f53-534d-1010-420badbabe69 |
R + W + WNR + N | Boolean, not persisted (resets to false on boot). When true, the physical speed knob acts as a limit on BLE speed. Invalid writes → "error:invalid_value" |
| Buffer | 522b443a-4f53-534d-1030-420badbabe69 |
R + W + WNR + N | Boolean latency-compensation toggle — same handler and same UUID as the OSSM-service Buffer characteristic (see quirks) |
| Patterns | 522b443a-4f53-534d-3000-420badbabe69 |
R | Static JSON array of all stroke patterns: [{"name":"Simple Stroke","idx":0},…] |
| Pattern Data | 522b443a-4f53-534d-3010-420badbabe69 |
R + W | Write a pattern index (wraps with modulo) → the value becomes that pattern's description; read returns the last description. Does not change the active pattern |
Fleshy service (binary streaming)
A compatibility path for clients that speak the old servo-style "FTS" binary protocol (e.g. Funscript-style
senders). Service 0000ffe0-0000-1000-8000-00805f9b34fb, characteristic
0000ffe1-0000-1000-8000-00805f9b34fb, properties R + W + WNR + N + I.
This is the only binary characteristic in the API.
| Byte | Meaning |
|---|---|
| 0 | Position, 0–180 "servo degrees". Converted internally to a percentage: byte / 1.8 |
| 1–2 | Duration in milliseconds, uint16 big-endian |
Writes shorter than 3 bytes are ignored. Each write enqueues a timed move on the same queue the
stream: command uses, so the device behaves like Streaming mode.
// Move to 50% (90 "degrees") over 500 ms:
const fleshy = await server.getPrimaryService("0000ffe0-0000-1000-8000-00805f9b34fb");
const fts = await fleshy.getCharacteristic("0000ffe1-0000-1000-8000-00805f9b34fb");
await fts.writeValue(new Uint8Array([90, 500 >> 8, 500 & 0xff]));
Device Information service
Standard SIG service 0x180A, all characteristics read-only:
| Characteristic | UUID | Value |
|---|---|---|
| Manufacturer Name | 0x2A29 | "Kinky Makers" |
| Model Number | 0x2A24 | "OSSM Lite" |
| Firmware Version | 0x2A26 | Semver string, e.g. "1.6.2" — check this before relying on any behaviour documented here |
const info = await server.getPrimaryService("0000180a-0000-1000-8000-00805f9b34fb");
const fw = await info.getCharacteristic("00002a26-0000-1000-8000-00805f9b34fb").readValue();
console.log(decoder.decode(fw)); // "1.6.2"
State & notifications
While a client is connected, the firmware polls its own state roughly every 100 ms and builds a fingerprint from: state-machine name, speed, min position, max position, sensation and pattern (numbers truncated to integers). When the fingerprint changes, it notifies:
- the Legacy State characteristic with the full JSON payload below,
- the OSSM State characteristic with just the state name,
- and the Speed, Max Depth, Min Depth, Sensation and Pattern characteristics with their current values.
State JSON payload (single packet thanks to the 512-byte MTU):
{
"timestamp": 123456, // ms since boot
"state": "strokeEngine.idle",
"speed": 35.0, // effective speed, %
"minPosition": 10.0, // %
"maxPosition": 80.0, // %
"depth": 80.0, // alias of maxPosition
"stroke": 70.0, // maxPosition - minPosition
"sensation": 50.0, // %
"buffer": 0.0, // latency buffer number
"pattern": 3 // pattern index
}
State machine names
Useful for gating UI (e.g. only show play controls when homed). Dotted names are sub-states:
| Boot | idle, hello, homing, homing.run, measure.run |
| Menu | menu, menu.idle |
| Stroke Engine | strokeEngine, strokeEngine.preflight, strokeEngine.idle, strokeEngine.stopping, strokeEngine.pattern, strokeEngine.speedCheck, usercalibration |
| Streaming | streaming, streaming.preflight, streaming.idle |
| Advanced Penetration | advancedPenetration, advancedPenetration.preflight, advancedPenetration.idle, advancedPenetration.presets |
| Wi-Fi / error | wifi, wifi.idle, error, error.idle, restart |
Subscribing
const legacy = await server.getPrimaryService("522b443a-4f53-534d-0001-420badbabe69");
const state = await legacy.getCharacteristic("522b443a-4f53-534d-2000-420badbabe69");
state.addEventListener("characteristicvaluechanged", (event) => {
const text = decoder.decode(event.target.value);
if (text.startsWith("{")) {
console.log("state:", JSON.parse(text));
} else {
console.log("command ack:", text); // "ok:…" after a queued command
}
});
await state.startNotifications();
Stroke pattern reference
The 14 built-in StrokeEngine patterns. Use the index with set:pattern:X, the Pattern
characteristic, or Pattern Data. The meaning of sensation (0–100) is per pattern:
| Idx | Name | Description (sensation effect) |
|---|---|---|
| 0 | Simple Stroke | Acceleration, coasting, deceleration equally split; sensation adds randomness in stroke |
| 1 | Teasing Pounding | Speed shifts with sensation; balances faster strokes |
| 2 | Robo Stroke | Sensation varies acceleration; from robotic to gradual |
| 3 | Half'n'Half | Full and half depth strokes alternate; sensation affects speed |
| 4 | Half'n'Out | Full and half depth strokes alternate on pull out; sensation affects speed |
| 5 | Deeper | Stroke depth increases per cycle; sensation sets count |
| 6 | Stop'n'Go | Pauses between strokes; sensation adjusts length |
| 7 | Insist | Stroke length decreases per cycle to set depth; sensation sets count |
| 8 | Progressive Stroke | Strokes are made of substrokes controlled by sensation |
| 9 | Knot Stroke | Splits stroke into three parts by sensation |
| 10 | Slap Stroke | Slapping style stroke with a delay determined by sensation |
| 11 | Random Stroke | Random stroke; sensation controls maximum randomness from current location |
| 12 | Go to Point | Moves to a point between depth and stroke based on sensation |
| 13 | Stroke Calibration | Calibration entry point — never drives the rail; used by the on-device min/max calibration flow |
Prefer fetching this at runtime over hard-coding: the Legacy Patterns characteristic returns
the names as JSON, and the OSSM Pattern List characteristic returns
"Name:Description" per index.
Quirks & gotchas
Things that will bite you if you don't know them:
- The OSSM-service Buffer characteristic has a Legacy UUID. A duplicated
#define BUFFER_UUIDin the firmware headers means the OSSM service's buffer toggle is created with522b443a-4f53-534d-1030-420badbabe69— the intended4f53534d-436f-6d6d-6f6e-427566666572is never registered. Both services expose a characteristic with that UUID, backed by the same setting. (Older docs referencing the…427566666572UUID are stale.) - Two different "buffers". The Buffer characteristic is a boolean
(latency compensation on/off);
set:buffer:Xand the Offset characteristic deal with the number used for that compensation. - Offset returns the buffer number. Reading Offset gives the latency-buffer value set by
set:buffer:X, not a positional offset. - Reads can have side effects. Reading Pattern or Stream switches the device into Stroke Engine / Streaming mode respectively. Writing AP Control switches into Advanced Penetration mode.
- Acks are not notified.
ok:…/fail:…/error:…responses are written into characteristic values silently — you must read the characteristic back. - Rate limits. Device-name writes and AP preset writes are ignored if they arrive less than a second after the previous one.
- Command numbers are unsigned. The command grammar accepts digits and dots only — no negative numbers, no exponents. Values are expected in 0–100.
- Advertising pauses while busy. You can't connect (or reconnect) while the device is homing or playing — it must be on an idle screen. Plan provisioning flows accordingly.
- Notifications are change-driven. There's no periodic telemetry other than on state change; poll with reads if you need continuous values (e.g. speed while ramping).
- Config writes persist immediately. Every configuration characteristic write goes straight to flash — avoid hammering them from sliders; write on release.
Putting it together: a minimal provisioning session
// 1. Connect (must be inside a user gesture, e.g. a button click)
const device = await navigator.bluetooth.requestDevice({
filters: [{ services: ["4f53534d-0000-0000-0000-000000000000"] }],
});
const server = await device.gatt.connect();
const ossm = await server.getPrimaryService("4f53534d-0000-0000-0000-000000000000");
const encoder = new TextEncoder();
const decoder = new TextDecoder();
// Small helper: write a string, read back whatever the device stored
async function writeAndCheck(uuid, text) {
const c = await ossm.getCharacteristic(uuid);
await c.writeValue(encoder.encode(text));
return decoder.decode(await c.readValue());
}
// 2. Name the device (8 chars max, 1 write/second)
await writeAndCheck("4f53534d-436f-6e66-6967-52656e616d65", "MYOSSM");
// 3. Motor geometry for this build
await writeAndCheck("4f53534d-436f-6e66-6967-4d415852504d", "300");
await writeAndCheck("4f53534d-436f-6e66-6967-535445505052", "800");
// 4. Rail + homing
await writeAndCheck("4f53534d-436f-6e66-6967-4c656e677468", "400");
await writeAndCheck("4f53534d-436f-6e66-6967-486f6d696e67", "2"); // SingleSided
// 5. Wi-Fi for OTA updates (slow — blocks up to ~10 s while it connects)
console.log(await writeAndCheck(
"4f53534d-436f-6e66-6967-202057694669",
"set:wifi:MyNetwork|supersecret",
)); // "ok:wifi:connected"