Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The heart of MPXE is the harness program. This is the program that will interact with clients over websocket connections, as well as manage running projects.

Web socket Interface

Input:

  • start project

    • due to the asynchronous nature of this, once the project is started up, the harness should send a response indicating the project was started.

  • stop project

  • query entire data store

  • set data store state

Output:

  • State of the data store

    • To begin with, we can prototype by just always periodically spewing the entire data store via web socket

    • Ideally, later on we can only send updates

    • It would be great if we could ‘query’ this, so by sending a web socket ‘request’ message we could trigger a send of the entire data store

  • CAN messages

    • send them raw. Any client can decode them on their own.

Components

There are four main components to the harness

  1. Data store: stores the state of every project. Memory is shared between it and each project, so both the harness and the project can read from and write to the same memory.

  2. Web socket interface: sends the state of the data store periodically, and receives commands from clients.

  3. Project manager: manages allocating memory for projects and spinning them up via make command.

  4. Log manager: gathers and parses output from the projects, including CAN messages.

Automated testing

Testing can be done via python script: the script should use the python library we define for interacting with the harness via websockets, and can make assertions to the reactions of the system. An example flow could be:

  • start pedal board

  • start MCI

  • Set throttle to 50%

  • Assert MCI output is 50%

  • etc.

Steps for starting a project

Starting up a project would look something like this:

  1. Web socket interface receives command to start up a project

  2. Project manager allocates memory in data store for project

  3. Project manager runs system("make run PROJECT=blablabla PLATFORM=x86") and pipes output to log manager

  4. Project manager sets up message queue for project to talk to project manager

  5. Each driver gets key to the message queue project manager set up

  6. Log manager taps into virtual CAN bus to collect those messages

  7. Project updates data store and sends a message via message queue

  8. Web socket interface sends web sockets upon data store being updated

  9. Log manager sends CAN messages over web socket upon receiving them

  • No labels