Skip to content

OpenTX 2.3 Docker Build Instructions

Martin W. Kirst edited this page Aug 15, 2019 · 2 revisions

OpenTX 2.3 Docker Build Instructions

With Docker and the prepared build machine configuration, a reliable and cross-platform way of compiling the firmware exists.

These instructions will enable you to produce your own firmware binary files, which can be written to the radio via the OpenTX Companion app.

Prerequisites

Docker

In order to run the Docker image, you need to install Docker on your machine. Docker is available as a Community Edition, which is free (free as in free beer). It's recommended to follow https://docs.docker.com/install/.

Clone the sources

Clone the sources to your local development machine and switch to the '2.3' branch.

git clone https://github.com/opentx/opentx.git
cd opentx
git checkout 2.3

build the docker image

The provided image ensures consistent libraries and toolchain is used, in order to create reliable binaries.

cd radio/util
docker build -t opentx .

build the firmware

The following example assumes you've checked out the "2.3" development branch and want to compile the firmware for an X-Lite S radio.

# assuming you're in the project root folder of opentx,
# which is /your/project/root/folder/opentx --> this needs to be mounted as volume under /opentx
mkdir build-xlites
docker run -v /your/project/root/folder/opentx:/opentx -e "OPENTX_VERSION_SUFFIX=2.3" -w /opentx/build-xlites opentx cmake -DPCB=XLITES -DGVARS=YES -DLUA=YES -DLUA_COMPILER=YES -DHELI=NO -DDEBUG=NO -DCMAKE_BUILD_TYPE=Release ../
docker run -v /your/project/root/folder/opentx:/opentx -e "OPENTX_VERSION_SUFFIX=2.3" -w /opentx/build-xlites opentx make firmware

The firmware file is now ready to be written to the radio: firmware.bin.

You can look up the -D... compiler options in the wiki: OpenTX Compilation Options. As an alternative, you can run the docker command with cmake -LH to get all options.

upload firmware to the radio

IMPORTANT: When writing firmware to your radio, there's a risk you break/damage it. It's recommended to make a backup of your previous firmware first.

Once the firmware.bin was successfully built, it's time to use the OpenTX Companion application. If you don't have this application already installed, just get a fresh copy from https://www.open-tx.org/downloads.

In order to write the firmware to the radio, follow these steps

  1. connect your radio via USB
  2. start OpenTX Companion application
  3. within the OpenTX Companion application, go to the menu "Read/Write"
    3.1. To make a backup, select "Read firmware from the radio" and follow the instructions.
  4. click the menu item "Write Firmware to the radio".
  5. in the dialog, click the file chooser button on the right and select the firmware.bin file
  6. verify the dialog shows the right version (2.3) and built timestamp from your firmware
  7. optionally: select a start screen image
  8. finally, click the "Write to TX" button
Clone this wiki locally