This is a customised Ardupilot firmware builder which allows to integrate custom patches, recall old builds etc. This is hosted on a private server but publicly accessible and the source code can be downloaded by anyone. Detailed instruction on how to build your custom firmware patcher based with this code are in the readme below. A live version of this app can be accessed here: https://ardupilot.equalmass.com

Shiv Tyagi 9842f3de72 scripts: fetch AP_Periph releases as well 11 ماه پیش
ap_git 5ace3c503e ap_git: add GitRepo.clone_if_needed method 1 سال پیش
build_manager 818d80ad8e build_manager: use Flash usage summary text for determining build success 10 ماه پیش
builder 8acf28e552 builder: use the same dill version as the web component 10 ماه پیش
examples 6daa523148 examples: add .env.sample 11 ماه پیش
metadata_manager e39fc7eeba metadata_manager: add AP_Periph as vehicle and support listing periph boards 10 ماه پیش
scripts 9842f3de72 scripts: fetch AP_Periph releases as well 10 ماه پیش
utils ce201be66a utils: wrap target method call in TaskRunner inside try-except 11 ماه پیش
web b43a1db048 web: use new get_boards method from APSourceMetadataFetcher 10 ماه پیش
.gitignore 944367a32f gitignore: ignore anything with the name base 11 ماه پیش
LICENSE 519e1f8813 Initial commit 5 سال پیش
README.md c4af3242ec update README.md 10 ماه پیش
Vagrantfile 28c381d75c Vagrant: add Vagrant vm definition and creation script 4 سال پیش
docker-compose.yml b541ce9272 pass github access token to web component from .env 10 ماه پیش

README.md

ArduPilot Custom Firmware Builder

Table of Contents

  1. Overview
  2. Live Versions
  3. Running Locally Using Docker
  4. Running Locally Without Docker on Ubuntu
  5. Directory Structure
  6. Acknowledgements

Overview

The ArduPilot Custom Firmware Builder is a web-based application designed to generate downloadable customized ArduPilot firmware, tailored to user specifications. This tool facilitates the customization and building of firmware by allowing users to select the options that best fit their needs, thus providing a streamlined interface for creating ArduPilot firmware.

Live Versions

  • Stable Version: The stable version of the ArduPilot Custom Firmware Builder can be accessed at custom.ardupilot.org.
  • Beta Version: We maintain a beta version available at custom-beta.ardupilot.org where newly developed features are tested before they are rolled out in the stable version.

Running Locally Using Docker

To minimize setup overhead and enhance ease of use, running this application in Docker containers is highly recommended. Follow the instructions below to run the application locally using Docker:

  1. Install Docker and Docker Compose: Make sure Docker and Docker Compose are installed on your machine. For installation instructions, visit the Docker website.

  2. Clone the Repository:

    git clone https://github.com/ardupilot/CustomBuild.git
    cd CustomBuild
    
  3. Configure Environment Variables: Copy the .env file to the root of the cloned repository from ./examples/.env.sample and configure the necessary parameters within it.

    cp ./examples/.env.sample .env
    
  4. Build and Start the Docker Containers:

    • To build and start the application, run:

      sudo docker compose up --build
      
    • If you want to run the application with the last built image, simply execute:

      sudo docker compose up
      

Use the -d flag to run the application in daemon mode:

   sudo docker compose up -d

Note: When starting the application for the first time, it takes some time to initialize the ArduPilot Git repositories at the backend. This process also involves populating the list of available versions and releases using the GitHub API, so please be patient.

  1. Access the Web Interface: The application binds to port 11080 on your host machine by default. Open your web browser and go to http://localhost:11080 to interact with the web interface. To change the port, set the WEB_PORT environment variable in the .env file mentioned in the Configure Environment Variables section.

  2. Stopping the Application: To stop the application, you can use the following command:

    sudo docker compose down
    

    This will stop and remove the containers, but it will not delete any built images or volumes, preserving your data for future use.

Running Locally Without Docker on Ubuntu

To run the ArduPilot Custom Firmware Builder locally without Docker, ensure you have an environment capable of building ArduPilot. Refer to the ArduPilot Environment Setup Guide if necessary.

  1. Clone the Custom-Build Repository:

    git clone https://github.com/ardupilot/CustomBuild.git
    cd CustomBuild
    
  2. Create and use a virtual environment:

    python3 -m venv path/to/virtual/env
    source path/to/virtual/env/bin/activate
    

If the python venv module is not installed, run:

   sudo apt install python3-venv

To deactive the virtual environment, run:

   deactivate
  1. Install Dependencies:

    pip install -r web/requirements.txt -r builder/requirements.txt
    

If pip is not installed, run:

   sudo apt install python3-pip
  1. Install and Run Redis: Use your package manager to install Redis:

    sudo apt install redis-server
    

    Ensure the Redis server is running:

    sudo systemctl status redis-server
    
  2. Execute the Application:

    • For a development environment, run:

      ./web/app.py
      
    • For a production environment, use:

      gunicorn web.wsgi:application
      

    During the coding and testing phases, use the development environment to easily debug and make changes. When deploying the app for end users, use the production environment to ensure better performance, scalability, and security.

    The application will automatically set up the required base directory at ./base upon first execution. You may customize this path by using the --basedir option with the above commands or by setting the CBS_BASEDIR environment variable.

  3. Access the Web Interface:

Once the application is running, you can access the interface in your web browser at http://localhost:5000 if running directly using app.py (development environment), or at http://localhost:8000 if using Gunicorn (production environment).

To change the default port when running with app.py, modify the app.run() call in web/app.py file by passing port=<expected-port> as an argument. For Gunicorn, refer to the commonly used arguments section of the Gunicorn documentation to specify a different port.

Directory Structure

The default directory structure is established as follows:

/home/<username>
└── CustomBuild
    └── base
        ├── ardupilot            (used by the web component)
        ├── builds
        ├── configs
        |   └── remotes.json     (auto-generated, see examples/remotes.json.sample)
        ├── secrets
        |   └── reload_token     (optional)
        ├── tmp
            └── ardupilot        (used by the builder component)

The build artifacts are organized under the base/builds subdirectory.

Acknowledgements

This project includes many valuable contributions made during the Google Summer of Code 2021. For more information, please see the GSOC 2021 Blog Post.