Protocols | Data Streaming Protocol
- Configuring Muse
- An ASCII-encoded text protocol where Muse accepts a range of serial commands and responds with output. For details see Serial Commands.
- Data streaming from Muse to the client
- Sensor readings are sent from Muse as soon as they are available. The format, layout, and frequency will depend on the chosen setup in the configuration mode. For details see the Data Streaming Protocol.
The general flow of connecting to Muse from a client is:
- Stop the data stream(in case it happens to be streaming already)
- Do a version handshake
- Load a preset
- Send other configuration messages(such as changing the EMI filtering based on region of the world)
- Request Muse status
- From this status a data stream parser should be configured
- Start data streaming
- Stream data and parse it
- Stop the data stream when it is no longer needed
To allow for incompatible changes in the communication protocol between Muse and client, the protocol is versioned. The protocol version is negotiated with the version handshake on establishing the communication. See the ‘v’ command for details in Serial Commands.
To allow for maximum freedom in improving the protocol only the ‘h’ and the ‘v’ command are guaranteed to be stable. This allows a communication partner to always stop the communication and attempt to negotiate a protocol version. Between protocol versions, anything can be changed including the serial commands(including their outputs) and the data streaming protocol. An up-to-date firmware will always support the latest protocol version and most likely at least one older protocol version, to allow for backwards compatibility and migration time.
In general the protocol is very stable there are no plans for any big changes. If a change is needed, we will usually incorporate multiple unrelated changes to reduce the number of different protocol versions and have a longer lifespan of a protocol version.