Skip to main content
This page describes how the WiFi API exposes device information, live status, configuration settings, service commands, and debug data for the Melody hardware device. All examples here assume you are calling the WiFi-related endpoints on:
https://api.getmelody.io
with standard headers:
Authorization: Bearer <YOUR_JWT_TOKEN>
Content-Type: application/json

πŸ“˜ Device Information (Read)

Static information about the connected Melody device.
FieldTypeDescription
firmwareVersionstringCI/CD firmware name (e.g. "v0.0.3-6-g4210228-dirty")
deviceTypestringDevice model (e.g. "melody")
hardwareRevisionstringHardware revision identifier/number
factoryActivationTimeuint32Unix timestamp of factory activation
These values are typically returned by a device info or status endpoint and rarely change during normal operation (except firmware version after OTA).

πŸ“‘ Device Status (Read)

Dynamic operational data from the Melody device.
FieldTypeRangeDescription
deviceTimeint64msCurrent device time in milliseconds (power-on time if no internet time source is available)
batteryLeveluint320–100Battery level (%)
batteryVoltagefloat10.0–15.0Battery voltage (V)
temperatureSensor1floatΒ°CPCB temperature near the charger section
temperatureSensor2floatΒ°CPCB temperature near the motor section
wifiConnectedboolβ€”Whether the device is connected to a WiFi access point
wifiRssiint32-100 to 10WiFi RSSI signal strength (dB)
bleConnectedboolβ€”Whether there is an active BLE client connection
Use these fields to show battery state, thermal status, and connectivity health in your UI.

βš™οΈ Device Settings (Read/Write)

Configurable parameters that control connectivity and naming.
FieldTypeDescription
deviceNamestringHuman-readable device name (e.g. "Melody Toy") shown in apps / BLE lists
wifiEnabledboolEnable or disable WiFi connectivity
bleEnabledboolEnable or disable BLE connectivity
When updating settings, make sure your UI clearly reflects any changes that could disconnect the current control channel (for example, disabling WiFi while using WiFi).

πŸ› οΈ Service Commands (Write)

Service commands are write-only control flags that trigger specific system-level actions on the device.
⚠️ Important: Calibration and OTA may move the stroker or restart the device. Always require explicit user confirmation before triggering these commands.
CommandTypeDescription
startCalibrationboolStart stroker calibration. Warn users to detach the device and confirm before execution.
startOtaboolCheck for firmware updates. Requires user confirmation before applying an update.
startOtpboolRequest an OTP token used for API authentication / secure pairing flows.
powerDownboolShut down the device safely.
Typically, these are exposed as part of a device maintenance or service endpoint where you send a small JSON body with the appropriate flag set.

πŸ”„ Firmware Update Info (Read)

Information about firmware update availability and state.
FieldTypeDescription
latestFirmwareVersionstringLatest available firmware version on the update server
firmwareStatusstringOne of: up-to-date, update-available, update-required
You can use these fields to show firmware banners in your UI and decide when to surface β€œUpdate available” prompts.

🧠 Debug Information (Read)

Debug data is exposed for diagnostics and should not normally be shown to end users.
It is especially useful during development, QA, or support tooling.
FieldTypeDescription
freeHeapSizeuint32Available heap memory in bytes
externalFlashSizeuint32External flash storage size in bytes
deviceTokenRetrieveTimeuint32Unix timestamp when the device token was received

  • Show user-facing status from: batteryLevel, batteryVoltage, temperatureSensor*, wifiConnected, bleConnected.
  • Offer configuration UI for: deviceName, wifiEnabled, bleEnabled.
  • Gate service commands behind confirmation dialogs for: startCalibration, startOta, powerDown.
  • Surface firmware prompts based on: firmwareStatus and latestFirmwareVersion.
  • Use debug information only in internal tools, logs, or support dashboards.
For exact endpoint URLs, request/response schemas, and error codes, see the WiFi API section in the HapticsConnect API Reference.