protocols icon Protocols | Serial Commands

NOTE: This documentation is accurate for the Muse 2014 headband. Updated documentation for the Muse 2016 headband is coming soon.

The following are serial commands that can be sent to Muse during the setup phase.

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.During data streaming, only the “h” and “k” commands should be used.

‘v’ = version handshake

Retrieve current the version string from the Muse. Also sets the protocol version for the communication.

The version string contains information about the version numbers of all components:

MUSE <BOOT|APP|TEST> HW-<hardware_version> FW-<headset_firmware_version> BL-<bootloader_version> FW_BUILD-<headset_firmware_build_number> FW_TARGET_HW-<target_hardware> FW_TYPE-<firmware_type> PROTO-<protocol_used>

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.

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 >

 

Firmware Version String Contents

NameDescription   
MUSEIndicates what kind of device this is (currently only one kind).
BOOT|APP|TESTIndicates whether the headset firmware, bootloader or test image is currently running.
BOOT: The boot loader that is only capable of limited functionality for connectivity over bluetooth and firmware updates
TEST: Internal image used for hardware verification, unused on end user headsets.
APP: Actual application image, providing all the expected functionality, including acquiring and streaming sensor data.
hardware_version: major_version.minor_versionHardware type and revision.
headset_firmware_versionA.B.C format, where:
A = The max hardware version supported, for rev2 this would be 2. If it supports rev 3, this number would be 3, but can also support rev2.
B = Always even numbers for production releases. Incremented when new features/improvements are added.
C = Incremented for a bug fix or tweak.
bootloader_version_numberA.B.C format, where:
A = The max hardware version supported, for rev2 this would be 2. If it supports rev 3, this number would be 3, but can also support rev2.
B = Always even numbers for production releases. Incremented when new features/improvements are added.
C = Incremented for a bug fix or tweak.
headset_firmware_build_number
Incremented for each build that is made. Used to link firmware image with build from build server.
target_hardware
The hardware revision for which the build was made. Might be lower then hardware_version, if no firmware changes are necessary to support the difference.
firmware_type
The intended use case for this build
"consumer": consumer firmware
"research": research firmware
protocol_used
The Muse communication protocol agreed upon for this session. If this is different to the requested protocol version then this is the best the headset can offer and the client needs to deal with it.

‘?’ = 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.

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 ===
 

NameDescription
Datatype  
bluetooth_macMAC address of Muse's Bluetooth module12 hex digits
bluetooth_fwFirmware version of the Bluetooth moduleString
serialNumber
Muse serial number, matches the serial number printed on the right ear podString (14 characters)
lastPresetLast preset ID that was sent to the headbandInteger (hex)
outputFrequencyEEG sampling frequencyInteger (decimal)
seroutModeEEG output mode, either compressed or uncompressed. 2 for compressed, 3 for uncompressed.Hex
eegChannelLayoutChannel order in the EEG packets.
02: DRL
03: REF
06: TP10
07: FP1
08: BAT
09: RIGHT_AUX
0A: LEFT_AUX
0B: TP9
0C: FP2
Dynamic length array, 2 hex digits for each element. String length equals (eegChannelCount x 2).
eegChannelCountNumber of channels in one EEG packet.Integer (decimal)
adcFrequencyActual sampling frequency of the analog digital converter(ADC). Multiply this by eegChannelCount to get the actual sample frequency as only one channel can be sampled at a time.
Integer (decimal)
downsampleRateAmount of downsampling performed on samples read by the analog digital converter(ADC).Integer (decimal)
afe_gainGain of the analog front end. As EEG signals are very weak they are amplified. This can be used to calculate the actual voltage level of the signal.Integer (decimal)
filterEnabledTrue if the internal Muse filters are used, false otherwise. Muse can filter EMI radiation at 50hz or 60hz.
0 - False
1 - True
Boolean
notchSelected notch filter centre frequency. Only valid if "filterEnabled" is true.

"407C" for 60Hz filter
"408C" for 50Hz filter
Integer (hex)
accelModeTrue if accelerometer enabled.
0 - disabled
1 - enabled
Boolean
accelRateLimitDownsampling of the accelerometer to limit the output rate. Currently unused.Integer (decimal)
errorFlagsInternal field with information about error modes.
Integer (hex)
sendErrorFlagsTrue if error flag packets will be sent in the data stream.
0 - False
1 - True
Boolean
sendBatteryDataTrue if battery packets will be sent in the data stream.
0 - False
1 - True
Boolean
sendDrlRefTrue if DRL/REF flag packets will be sent in the data stream.
0 - False
1 - True
Boolean
freqDrlRefFrequency of the DRL/REF packets.
Integer (decimal)
socState of charge of the battery in (percent * 100). This can be used to initialize the starting value of the battery readout prior to receiving updates in the data streaming. Integer (decimal)
voltageVoltage of the battery in millivolts(mV).
Integer (decimal)

‘-‘ = Clear Error Flags

Clears the error flags register.

Argument: NULL
Returns: NULL

‘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