Home

Awesome

MakAir Control UI

Control Lint dependency status

<p align="center"> <img alt="UI When Ventilation Unit Is Running" src="./doc/screens/unit-running.png"> </p>

Versions

VersionLast ChangelogReady?Release
V1.1.xOperational initial releasenone
V1.2.xCrashes fixed + smoother graph + implemented medical staff feedbacksnone
V1.3.xImprove text readability, by increasing font sizesview
V1.4.xAdded internationalization capabilitiesview
V1.5.xImprove UI readability + allow to change MakAir's settingsview
V2.0.xTelemetry protocol version update to V2 + large code rework + improved UI/UX + reduced CPU usage + translated alarms + regulatory complianceview
V2.1.xVentilation modes + flow sensing + new options + new plot rendererview
V2.2.xPatient configuration modal + new error messages + UX improvementsview
V2.3.xFactory calibration utility + show more errors from the firmwareview
V2.4.xStore user configurations in firmware EEPROM, eg. localenone

How To Build?

Building on a computer (for development)

In order to setup your environment and build the code, please follow these steps:

  1. Install Rustup
  2. Ensure you are using the Rust stable toolchain: rustup default stable
  3. On Linux, make sure you have cmake installed and those libraries (debian): libxcb-shape0 libxcb-shape0-dev libxcb-xfixes0 libxcb-xfixes0-dev libfontconfig libfontconfig1-dev libudev-dev
  4. Build the project: cargo build

Wayland support may be available but it hasn't been tested. You need a working X11 server.

As well, please make sure that you have at least 2GB of RAM for the build to complete. Running the UI requires less than 40MB of RAM afterwards (in release mode).

Tested with Rust version: rustc 1.52.1 (9bc8c42bb 2021-05-09)

Note: as the MakAir Control UI currently targets a single 7" touch display, the UI only supports a static resolution of 800 x 480 pixels.

Building on a MakAir ventilator (for end use)

Building directly on a ventilator is convenient for testing purposes while developing. The Raspberry Pi boards in ventilators run ArchLinux. To build on a ventilator:

  1. Make sure glibc is up to date (e.g. by running pacman -S glibc as root)
  2. Install the following packages: git gcc make cmake pkg-config
  3. Enable NTP by running timedatectl set-ntp TRUE
  4. Install Rustup
  5. Ensure you are using the Rust stable toolchain: rustup default stable
  6. Clone the repository and build the project: cargo build --release

Warning: Do NOT perform a full system upgrade. This has been observed to break the software.

How To Run?

Quick start

To run the Control UI, please ensure that your device first has an open serial connection with the motherboard.

Note that the Control UI relies on the MakAir Telemetry library, which gets pulled from the makair-telemetry repository.

Take note of the serial port used as an input on your Control UI board, and call:

  1. Run: ./makair-control --port=0 (where --port is your serial port ID, maybe /dev/ttyUSB0)

You may also play a pre-recorded file, by passing it as an input (this is handy while developing; example records are available in the telemetry library repository):

  1. Pull the telemetry library (in the parent directory): git pull https://github.com/makers-for-life/makair-telemetry.git
  2. Run an example (from the Control UI directory): ./makair-control --input=../makair-telemetry/records/v2/short.record (where --input is an UNIX file path)

Available options

The following options can be passed to the Control UI upon running it:

Supported Translations

As MakAir was designed to be used internationally, we have made sure that the Control UI was fully translated in major languages.

You can pass the desired locale code when running the makair-control binary, using the --translation argument. Make sure to pass the locale ISO code, eg. for French: --translation=fr.

By default, you do not need to pass the target locale, as it is read from user settings and can be changed by the end-user through the UI. If the --translation argument is used, then user settings are ignored and the passed locale is forcibly used.

➡️ You can find the list of supported languages, with their ISO language codes below:

➡️ Some CJK languages require building with the fonts-cjk feature in order to render properly:

ℹ️ If your language does not appear in the list above, you may translate the base English file, then open a Pull Request.

How To Build A Release? (Cross-Compile For ARM)

To cross-compile a new release for an ARM target (using MUSL; statically-linked libraries), you can call the release_binaries.sh script:

  1. Run: ./scripts/release_binaries.sh --version=1.0.0

Make sure to replace the version script argument with the current release version. This is used for file naming purposes only.

⚠️ Important note: this is still a work in progress. We are near cross-compiling capabilities, though some work still needs to be done due to non-MUSL C-based dependencies. See issue #38.

Optional Features

The Control UI behavior can be tuned at compile time, by enabling some optional features while building the binary:

Prepared System Images

Prepared system images that run on a Raspberry Pi and pack the Control UI are available in the makair-files repository (over Git LFS). They can be flashed to a microSD card and ran in a MakAir in a matter of minutes.

You may use a base system image and update it with any newer version of the UI (compiled on the same image, with additional build tools installed). Image update and flash instructions are available within this repository.

Troubleshooting

In case of an issue, please review the following points and check if any could help: