MW<->RPi integration

Gregory Dymarek

gregory.dymarek@gmail.com

12 November 2015

MW

MW Service

CLI

WWW

UART

OTHER MODULES

LIKE

BAROMETER

GPS

ANDROID SUPPORT

3G COMM

...

ANDROID

GPS

...

RPi or similar

IMAGE

CONFIGURATOR

FLASH

MW Service

  • A host service that runs on start-up of the system
  • Does 2 way translation between UART and clients
  • Handles UART communication with MW
  • Defines 2 memory blocks for Client (IPC) communication:
    • incoming (read only by clients)
    • outgoing (writable by clients)

TRANSLATOR

UART

MW

PROTOCOL

CLIENTS

client to client communication to be done through service memory block

MW Service - Memory blocks

Incoming memory block contains information that was received from MW (and translated into a binary format).

Respectively, the service will read outgoing memory block, translate and send any available information to MW.

Each data point in both the memory blocks is timestamped:

  • for incoming block this allows clients to process messages only once
  • for outgoing messages the MW service can blank the processed data point or store the timestamp for each data point to prevent re-processing of the same data

Messages - Formats

There are 2 formats of messages: Raw / MW and binary

MW messages are messages as defined by Multiwii Serial Protocol. These can be send directly through UART. Also these types of messages are received from MW.

Binary messages are blobs in a memory and used to communicate between host processes.

The MW service primary purpose is to do 2-way translation between these.

Messages - Type

Each format of a message defines its own set of types.

Raw messages are as per the Multiwii Serial Protocol (MSP) definition.

Binary messages include the ones from MSP but also include additional ones like Wifi signal strength or host barometer reading.

The memory block definition has to be flexible enough to accommodate these additional messages.

BINARY

RAW

Command line interface (CLI)

The most basic client used for debug purposes with 2 mode of operation:

  • listener
    • displays all messages that are arriving
  • writer
    • accepts a RAW string that will be forwarded to MW without translation
    • or a binary message

These 2 modes are exclusive.

Workstream

  • Setup repository
  • Setup RPi image builder (buildroot)
  • Define MW Service
  • Implement UART library
  • Implement MW protocol translation library
  • Implement IPC library (shm)
  • Define Service main loop
  • Implement CLI
  • ------------
  • Proxy server for WWW
MW<->RPi integration - Google Slides