MQTT - Ghoust-game/docs GitHub Wiki

Topic Payload Info
GHOUST/clients/{clientId}/status ? ?
GHOUST/clients/{clientId}/events/button PRESS or LONGPRESS ?
GHOUST/clients/{clientId}/events/accelerometer OUTSHOCK (<val>) or WARNSHOCK (<val>) ?
GHOUST/clients/{clientId}/events/gestures See below
GHOUST/clients/{clientId}/events/battery 0-1023 current battery level
GHOUST/clients/{clientId}/config/led PRESET:1-4 or RAW:0-1023,<duration> ?
GHOUST/clients/{clientId}/config/motor PRESET:1-4 or RAW:0-1023,<duration> ?
GHOUST/clients/{clientId}/config/buzzer PRESET:1-4 or RAW:0-1023,<duration> ? :
GHOUST/clients/{clientId}/config/accel_warn <float> Set Threshold for WARNSHOCK event
GHOUST/clients/{clientId}/config/accel_out <float> Set Threshold for OUTSHOCK event
GHOUST/clients/{clientId}/config/accelerometer RESET resets the accelerometer and delta values to 0
GHOUST/clients/{clientId}/config/name ? Sets the devices NAME (displayed in web frontend)
GHOUST/server/changegame name Change server game mode
GHOUST/server/status/gamemodes name1,name2,... List game modes [Retained Message]
GHOUST/server/status/activegames id:name1,id:name2,... List active game [Retained Message]
GHOUST/server/version/{componentName}/latest version Info about latest version of a software component
GHOUST/server/version/{componentName}/current version Info about current version of a software component

GHOUST/clients/{clientId}/status

currently not in use

should state CONNECTED / DISCONNECTED, maybe the server will handle this.


GHOUST/clients/{clientId}/events/button

contains CLICK or LONGPRESS .. pretty self explaining. duh?


GHOUST/clients/{clientId}/events/accelerometer

currently reports:

WARNSHOCK (<float>)

OUTSHOCK (<float>)

(<float>) == the value that triggered the event (should be above threshold)

currently this is a value that is higher than an accumulated sum of shock events over a certain time.


GHOUST/clients/{clientId}/events/gestures

  • PORTRAIT_UP
  • PORTRAIT_DOWN
  • LANDSCAPE_RIGHT
  • LANDSCAPE_LEFT
  • FLAT

reports orientation of the chip.

could be used in configuration for example

maybe this should be triggered ofer an MQTT config request for menu setups and such.


GHOUST/clients/{clientId}/events/battery

contains integer 0-1023

  • 0== total empty
  • 1023== 100%charged
  • danger zone is ! <450 for LIPO operated ghoust clients
  • might differ for batteries and NiMH reloadable batteries

the config tree sets values and state on the client.

GHOUST/clients/{clientId}/config/led

RAW:1023,1023,1023

= R,G,B<,TIMEOUT(ms)>

for example RAW:0,1023,1023

set RED=off, GREEN=full, BLUE=full as default state of the led

for example RAW:1023,0,0,500

set RED=full,GREEN=off,BLUE=off for half a second

after half a second the leds are set back to the last default state (see above)

PRESET:<1-5>

PRESET:1 = a rainbow animation

RESET:2 = blue fade in/out


GHOUST/clients/{clientId}/config/motor

PRESET:<1-4>

different vibration patterns.

these need to be tested and implemented

also documentation needs to be written..

RAW:<frequency>,<duration>

This event is BLOCKING and should NOT be triggered DURING an active game but on the end/beginnning of a game.


GHOUST/clients/{clientId}/config/buzzer

PRESET:<1-5>

plays one of five different sounds.

this event is BLOCKING and should NOT be used during an active game!!

RAW:<frequency>,<duration>

setzt buzzer to a frequency for a certain time. (nonblocking)


GHOUST/clients/{clientId}/config/accel_warn

sets the threshold before an WARNSHOCK event is triggered

expects a float value

currently defaults to 10.0


GHOUST/clients/{clientId}/config/accel_out

sets the threshold before an OUTSHOCK event is triggered

expects a float value

currently defaults to 20.0


GHOUST/server/changegame

makes the server change the game. payload is a comma-separated list of the game(s) to be started. all current games will be stopped and the new ones initialized.

⚠️ **GitHub.com Fallback** ⚠️