## Muse Developer Resources | Search this site

Muse Communication Protocol‎ > ‎ ### Serial Commands
The following are the list of serial commands that can be used with the Muse during the setup phase. During data streaming, only the "h" and "k" commands should be used. ## Structure The format of the command is: `<c>[ ][<arg>[ ][<argEx.size>,<binary data>]](\r|\n)` `<c>` - the command name. 1 byte char, case sensitive `<arg>` - optional argument. A hex number up to 4 digits `<argEx.size>` - size of the extended arg (hex number) `<binary data>` - extended argument in binary format. Length is exactly <argEx.size> ## List of Commands This lists all available commands with their command characters, arguments and extended arguments. Optional Argument and Extended Argument are omitted if they are not evaluated. Except for version 'v' and status '?' no argument returns any data. The configuration can always be verified by the status '?' command. ### 'v' = version handshake Retrieve current the version string from the Muse. Also sets the protocol version for the communication. Not requesting a protocol version will assume protocol version 1, which is undocumented and most likely not what you want. Latest protocol version is 2, which is also the documented one. Enter a world of pain by using protocol version 1. Argument: Protocol version requested. Returns: the version string, for structure see "Version String". Example: `> v 2` `<` `MUSE APP HW-6.0 FW-6.4.1 BL-6.2.0 FW_BUILD-123 FW_TARGET_HW-6.0 FW_TYPE-prod PROTO-2` ### '?' = Show Status Retrieve the current configuration from the Muse. Argument: NULL Returns: A set of key value pairs with the current configuration of the Muse. The status command returns the current active configuration of the Muse in a set of new line delimited key value pairs. The result spans a variety of modules and carries information that is required to properly parse and use the data stream. For detailed description of this output see "Status Output". Format: `=== Begin dumpConfig ===` `{key:value}` `=== Done dumpConfig ===` Example: `=== Begin dumpConfig ===` `bluetooth_mac:00066668A76F` `bluetooth_fw:Ver 5.45 IAP 10` `serialNumber:1090-AZPB-A76F` `lastpreset:10` `outputFrequency:220` `seroutMode:2` `eegChannelLayout:0b070c06` `eegChannelCount:4` `adcFrequency:3520` `downsampleRate:4` `afe_gain:1961` `filterEnabled:1` `notch:407C` `accelMode:0` `accelRateLimit:65535` `errorFlags:0` `sendErrorFlags:0` `sendBatteryData:0` `sendDrlRef:0` `freqDrlRef:0` `soc:5125` `voltage:3786` `=== Done dumpConfig ===` ### '-' = Clear Error Flags Clears the error flags register. Argument: NULL Returns: NULL Example: `< -` ### 'g' = Choose Notch Frequency If the filters are enabled this selects the which power line frequency to filter out, it's either 60Hz or 50Hz. ATTENTION: Filters need to be enabled before selecting a notch filter. Argument: `` `0x407C for 60Hz filter` `` `0x408C for 50Hz filter` Returns: NULL Example: `> g 408C` ### 'r' = SetHostPlatform Some platforms need specific bluetooth handling, so the application needs to set the platform it is running on. Argument: `PLATFORM_IOS = 1` `PLATFORM_ANDROID = 2` `PLATFORM_WINDOWS = 3` `PLATFORM_MAC = 4` `PLATFORM_LINUX = 5` `` Returns: NULL Example: `> r 5` ### 'k' = Keep-Alive This is a keep-alive command for the data streaming. If there has been no keep-alive received by Muse inside of a 10s timeframe it will cease streaming data, assuming there is no recipient. Argument: NULL Returns: NULL Example: `> k` `` ### '%' = Load Preset Loads a predefined configuration. See https://sites.google.com/a/interaxon.ca/muse-developer-site/museio/presets for further details. Argument: The preset ID Returns: NULL Example: `> % 13` `` ### 's' = Start Data Transmission Starts streaming data according to the current configuration. Muse now switches into a binary transport mode. Argument: NULL Returns: NULL Example: `> s` ### 'h' = Stop Data Transmission Cease streaming data. To use most of the serial commands, especially for the ones that modify the configuration or return a result the data streaming needs to be stopped. Argument: NULL Returns: NULL Example: `> h`
Comments