Production websocket
This value is assigned by the device itself.
Staging websocket - prerelease testing
This value is assigned by the device itself.
Send messages to the API
Accepts one of the following messages:
{
"type": "hello",
"model": "DPB0200",
"uuid": "0a115964-659f-d095-b4f8-c2d468447ed9",
"version": "1.0.0",
"firmwareChecksum": "1df795aed8236272eb6f2ad3c5a489499c4a88597727a602fd0a03408564ce34"
}
{
"type": "parameter",
"name": "ticker_url",
"value": "wss://ticker.cryptoclock.net:443/"
}
{
"type": "parameters",
"parameters": [
{
"type": "parameter",
"name": "ticker_url",
"value": "wss://ticker.cryptoclock.net:443/"
}
]
}
User presses the OTP button on device
{
"type": "OTPRequest"
}
server sending heartbeat to keep the connection alive and client sending heartbeat to keep server informed it's still connected
{
"type": "heartbeat"
}
{
"type": "error",
"command": "setImage",
"text": "Error, Image size must be 64x32..."
}
{
"type": "diagnostics",
"internalTemperature": {
"current": 0,
"max": 0
},
"lastResetReason": {
"cpu0": "string",
"cpu1": "string"
},
"rotationChanged": {
"degrees": 0,
"value": 0
},
"uptime": "string",
"wifi": {
"channel": 0,
"bssid": "string",
"rssi": 0
}
}
{
"type": "fonts",
"names": [
"5x7"
]
}
Messages that you receive from the API
Accepts one of the following messages:
{
"type": "welcome",
"text": "Welcome client 12311221-1312-1213-1231-123123132231"
}
Highest ever value for given item can be provided by server in similar fashion as tick.
{
"type": "allTimeHigh",
"data": [
{
"id": "1d14c6d4-b6aa-4f90-88ba-3501ca9bba61",
"value": 99999.9
}
]
}
Value updates are received as "tick" commands. For devices capable of displaying more than one value, "id" field refers to particular display slot, associated beforehand by "layout" command.
{
"type": "tick",
"data": [
{
"id": "fbf59877-d56f-42b8-b0a7-4db230ed4090",
"value": 6456.9
}
]
}
Server sends otp to the device. Password has to be presented to user.
{
"type": "OTP",
"password": 123456
}
Server notifies about successful OTP usage
{
"type": "OTP_ACK"
}
Display rotating message on given screen
{
"type": "message",
"text": "Hello there!",
"target": "29508f89-8b9c-480e-ac2c-2862efaae8b5"
}
Display static message
{
"type": "staticMessage",
"text": "Hello there!",
"durationSecs": 60,
"target": "29508f89-8b9c-480e-ac2c-2862efaae8b5"
}
Plays a melody specified in RTTL format (only for devices with attached buzzer)
{
"type": "sound",
"melodyRTTL": "StarwarsI:d=16,o=5,b=100:4e,4e,4e,8c,p,g,4e,8c,p,g,4e,4p,4b,4b,4b,8c6,p,g,4d#,8c,p,g,4e,8p"
}
Display an image, format must be 24-bit .bmp image, with same size as display image is split into X-bytes chunks (default 1024), each individually base64-encoded
{
"type": "imageBegin",
"size": 6282,
"chunk_size": 1024
}
{
"type": "imageChunk",
"offset": 0,
"chunk": "Qk2KGAAAAAAAA..."
}
Display an image or store it on device's filesystem for use as logo
{
"type": "imageEnd",
"action": "display",
"oneOf": null
}
For devices capable of displaying multiple values, templates are collections of display formating options for each "display slot". Each format contains display position(x,y) and attributes such as color, font or text alignment. Formats can be divided into horizontal/vertical pairs; appropriate format is then selected based on physical device orientation. Devices contain default templates in case of displaying 1-n values, that are automatically selected based on number of displayed values. Using setTemplate command overrides current template until device restart. Formatting options for any "display slot" can be overriden using layout command.
{
"type": "setTemplate",
"template": [
{
"index": 0,
"horizontal": {
"x": 2,
"y": 2,
"maxCharacters": 6,
"textAlignment": "right",
"font": "5x7",
"color": "#00FF00"
},
"vertical": {
"x": 2,
"y": 2,
"maxCharacters": 6,
"textAlignment": "right",
"font": "5x7",
"color": "#00FF00"
}
}
]
}
If device is capable of displaying multiple values, "display slots" on a device are identified by index (0,1,2 etc). The layout command is used to associate display slot index with unique service ID, which is sent by "tick" command on each value update. Optional "format" parameter specifies overrides for default display settings such as font, color, x/y position etc. See "setTemplate" command for additional details.
{
"type": "layout",
"data": [
{
"index": 0,
"id": "fbf59877-d56f-42b8-b0a7-4db230ed4090",
"displayName": "USD",
"source": "/bitfinex/btc/usd",
"format": {
"text": {
"color": "#FF0000"
},
"horizontal": {
"x": 2,
"y": 2,
"maxCharacters": 6,
"textAlignment": "right",
"font": "5x7",
"color": "#00FF00"
},
"vertical": {
"x": 2,
"y": 2,
"maxCharacters": 6,
"textAlignment": "right",
"font": "5x7",
"color": "#00FF00"
}
}
}
]
}
Server requests all stored parameter values
{
"type": "requestParameters"
}
Server can set some of device's timeouts (in case of server source sending values too infrequently)
{
"type": "setTimeout",
"dataReceivedTimeoutSecs": 180
}
server sending heartbeat to keep the connection alive and client sending heartbeat to keep server informed it's still connected
{
"type": "heartbeat"
}
Notifies client to check for firmware updates
{
"type": "triggerUpdate"
}
Notifies client to restart the device
{
"type": "triggerReset"
}
Highest ever value for given item can be provided by server in similar fashion as tick.
server sending heartbeat to keep the connection alive and client sending heartbeat to keep server informed it's still connected
Display an image, format must be 24-bit .bmp image, with same size as display image is split into X-bytes chunks (default 1024), each individually base64-encoded
Display an image or store it on device's filesystem for use as logo
If device is capable of displaying multiple values, "display slots" on a device are identified by index (0,1,2 etc). The layout command is used to associate display slot index with unique service ID, which is sent by "tick" command on each value update. Optional "format" parameter specifies overrides for default display settings such as font, color, x/y position etc. See "setTemplate" command for additional details.
Display rotating message on given screen
Server sends otp to the device. Password has to be presented to user.
Server notifies about successful OTP usage
User presses the OTP button on device
Server requests all stored parameter values
For devices capable of displaying multiple values, templates are collections of display formating options for each "display slot". Each format contains display position(x,y) and attributes such as color, font or text alignment. Formats can be divided into horizontal/vertical pairs; appropriate format is then selected based on physical device orientation. Devices contain default templates in case of displaying 1-n values, that are automatically selected based on number of displayed values. Using setTemplate command overrides current template until device restart. Formatting options for any "display slot" can be overriden using layout command.
Server can set some of device's timeouts (in case of server source sending values too infrequently)
Plays a melody specified in RTTL format (only for devices with attached buzzer)
Display static message
Value updates are received as "tick" commands. For devices capable of displaying more than one value, "id" field refers to particular display slot, associated beforehand by "layout" command.
Notifies client to restart the device
Notifies client to check for firmware updates