A.Quarter.To.Seven

Some of Stef's Stuff

MSP – The MultiWii Serial Protocol

by Stefano on 2015.05.16, one comment

Want create site? Find Free WordPress Themes and plugins.

The MultiWii Serial Protocol (MSP) is the de-facto standard to interact with a MultiWii flight controller (FC). Its implementation contains a list of the most common operations one would expect from a remote control/telemetry point of view. Developers can add custom functionality if required, being cautious about typos and errors in the information available as the project and the wiki are in constant development.

These notes are the foundation of the Android RC app developed to control the S-QUAD quadcopter. A clean Java implementation of the MSP protocol is available on GitHub.

History

MSP has been used by the MultiWii configurator (a Processing application) since the beginning with the first draft of the protocol eventually defined in 2012. The MSP wiki page is the main source of information and contains a brief description of the structure of a MSP request

MSP request

The definition of “request” is quite loose in fact three types of messages can be identified:

  • command – is an incoming (into FC) message without implicit outgoing response from the controller
  • request –  is an incoming message with implicit outgoing response (e.g. a telemetry request sent in by a remote station)
  • response – is the outgoing message resulting from an incoming request

MultiWii_MSP_graphics

The figure shows the different parts constituting a MSP message (see wiki)

Header (preamble and flow)

Header is 3 bytes long. A MSP message can be identified by a 2-byte preamble, the sequence of char “$M”. A 3rd byte containing the message direction completes the header. Data flow toward the MultiWii is identified with “<” while data from the MultiWii with “>” (the incoming flow is composed of commands and requests while the outgoing flow contains responses)

Info (data length and message type)

The 4th byte is the size and contains the length of the payload (number of bytes of the payload field only). Size is zero for a MSP request.

The 5th byte is the type of MSP message. Value 1xx identify requests while 2xx identify commands.

Payload

See the wiki for details

Checksum

The checksum is computed as the XOR of size, type and payload bytes. The checksum of a request (no payload) equals the type.

Other resources

Arduino MSP TX and RX  at https://code.google.com/p/mwii-msp-tx/ and the original thread on the MultiWii forum http://www.multiwii.com/forum/viewtopic.php?f=8&t=3473

 

 

Did you find apk for android? You can find new Free Android Games and apps.

One thought on “MSP – The MultiWii Serial Protocol

Leave a Reply

Your email address will not be published. Required fields are marked *