{"id":18397690,"url":"https://github.com/dridri/bcflight","last_synced_at":"2025-04-07T04:33:31.576Z","repository":{"id":71450417,"uuid":"50266966","full_name":"dridri/bcflight","owner":"dridri","description":"Raspberry Pi based drone flight controller and remote control","archived":false,"fork":false,"pushed_at":"2024-05-02T08:34:34.000Z","size":19745,"stargazers_count":120,"open_issues_count":7,"forks_count":22,"subscribers_count":25,"default_branch":"master","last_synced_at":"2024-05-02T21:56:40.483Z","etag":null,"topics":["drone","flight-controller","quadcopter","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dridri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-24T01:22:54.000Z","updated_at":"2024-05-30T01:53:09.958Z","dependencies_parsed_at":null,"dependency_job_id":"a5b97065-3d11-464b-b168-c4c105af0eb7","html_url":"https://github.com/dridri/bcflight","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dridri%2Fbcflight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dridri%2Fbcflight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dridri%2Fbcflight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dridri%2Fbcflight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dridri","download_url":"https://codeload.github.com/dridri/bcflight/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595370,"owners_count":20963939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drone","flight-controller","quadcopter","raspberry-pi"],"created_at":"2024-11-06T02:18:11.923Z","updated_at":"2025-04-07T04:33:26.554Z","avatar_url":"https://github.com/dridri.png","language":"C++","readme":"Open-source Linux-based Raspberry drone and ground controller.\n\n## Features\n * Supports Raspberry Pi 1/2/3/4/zero boards\n * Mid CPU (~25% at 4KHz update rate on Raspberry Pi 4) and low RAM (~100MB) usage\n * Sensors and stabilizer update rate up to 8kHz (on rPi4)\n * Up to 8 motors with customizable configuration matrix\n * DShot (150 \u0026 300), OneShot125 and standard PWM motor protocols\n * Supports SPI and I²C [sensors](#supported-sensors)\n * LUA-based configuration, with fully configurable event-handling and user code execution\n * Homemade communication protocol over Wifi \u0026 FSK/LoRa radio, also supports S-BUS with limited functionnality\n * ~5ms controls latency\n * ~50ms video latency over composite output to 5GHz VTX module\n * ~100ms video latency over Ethernet / WiFi / RawWifi\n * Live camera view over HDMI / Composite output with On-Screen Display (showing telemetry, battery status, fly speed, acceleration...)\n * Supports multiple cameras recording in MKV file format (for a total max throughput of ~120 MPix/s without overclock)\n * Produces [Gyroflow](https://github.com/gyroflow/gyroflow) GCSV output\n\n\n[preview.webm](https://github.com/user-attachments/assets/5b8bf825-73fa-47d5-b7b2-dfe6beb78eec)\n\n[https://www.youtube.com/@drichfpv/videos](https://www.youtube.com/@drichfpv/videos)\n\n\n\n## Pre-built binaries\n[![Build Status](https://ci.drich.fr/buildStatus/icon?job=BCFlight)](https://ci.drich.fr/job/BCFlight/)\n[![Tests Status](https://ci.drich.fr/buildStatus/icon?job=BCFlight-tests\u0026subject=tests)](https://ci.drich.fr/job/BCFlight-tests/)\n\nPre-built 32-bits binaries for Raspberry Pi 4 can be found here : [https://ci.drich.fr/](https://ci.drich.fr/)\n\n## Pre-built images\n[![Build Status](https://ci.drich.fr/buildStatus/icon?job=BCFlight-CM4-Images)](https://ci.drich.fr/job/BCFlight-CM4-Images/)\n\n\nThese images are generated using the [tools/image-builder/generate-flight-image.sh](./tools/image-builder/generate-flight-image.sh) script. The root filesystem is set to read-only on boot to prevent data corruption, this can be changed by running `rw` command in terminal.\n\nRoot SSH is enabled by default with password `bcflight`. The `flight` binary sits in the /var/flight folder.\n\nThe flight service is disabled by default, this helps to easily setup the flight controler. Once correctly working, this can be set to automatically start on boot by running `rw \u0026\u0026 systemctl enable flight`\n\n| File                             | Based on                               | DShot support                                        | Analog video output                                  |\n|----------------------------------|----------------------------------------|------------------------------------------------------|------------------------------------------------------|\n| [2023-07-18-raspbian-bcflight.img](https://bcflight.drich.fr/files/2023-07-18-raspbian-bcflight.img) | 2023-05-03-raspios-bullseye-armhf-lite | \u003cp align=\"center\"\u003e✅¹\u003c/p\u003e | \u003cp align=\"center\"\u003e✅¹\u003c/p\u003e |\n\n¹ DShot and composite output can be enabled by changing /boot/config.txt and /var/flight/config.lua settings.\n\n## Supported sensors\n#### IMUs\n * InvenSense ICM-42605\n * InvenSense ICM-20608\n * InvenSense MPU-9250\n * InvenSense MPU-9150\n * InvenSense MPU-6050\n * STMicroelectronics L3GD20H\n * STMicroelectronics LSM303\n#### Barometers / Altimeters\n * Bosch BMP180\n * Bosch BMP280\n#### Distance sensors\n * HC-SR04\n#### ADC\n * Texas Instruments ADS1015\n * Texas Instruments ADS1115\n\n## Supported communication systems\n * standard TCP/UDP/IP over ethernet / wifi\n * raw wifi (based on [wifibroadcast](https://github.com/befinitiv/wifibroadcast))\n * Nordic Semiconductor nRF24L01\n * Semtech SX1276/77/78/79 FSK/LoRa / RFM95W\n * SBUS (limited functionnality)\n\n## Hardware\nAny form-factors of Raspberry Pi can be used, connecting sensors and peripherals using GPIO header and other dedicated connectors.\nFor smaller size and weight it's recommended to use a Compute Module 4 with a custom carrier board like this one (can be found in [./electronics](./electronics)) :\n\nView this project on [CADLAB.io](https://cadlab.io/project/23184)\n\n\u003cimg width=\"512px\" style=\"max-width: 100%\" alt=\"Raspberry Pi Compute Module 4 carrier board schematics\" src=\"misc/cm4_schematics.png\"/\u003e\n\u003cbr /\u003e\n\u003cimg width=\"512px\" style=\"max-width: 100%\" alt=\"Raspberry Pi Compute Module 4 carrier board front photo\" src=\"misc/cm4-fc-front.png\"/\u003e\n\u003cbr /\u003e\n\u003cimg width=\"512px\" style=\"max-width: 100%\" alt=\"Raspberry Pi Compute Module 4 carrier board back photo\" src=\"misc/cm4-fc-back.png\"/\u003e\n\u003cbr /\u003e\n\u003cimg width=\"512px\" style=\"max-width: 100%\" alt=\"Raspberry Pi Compute Module 4 carrier board back photo\" src=\"misc/cm4-on-drone.png\"/\u003e\n\nThis carrier board has the following features :\n * 5V 3A LM22676 low dropout regulator (with 42V max input)\n * ADS1115 ADC, channel 0 used to measure battery voltage\n * microsd card socket\n * dual RFM95W radio sockets with seperate status LEDs and external antennas plugs\n * optional S-BUS input (with TTL inverter)\n * ICM-42605 high-precision IMU\n * BMP581 barometer / altimeter\n * dual camera CSI connectors\n * exposed IO pads :\n   * 8 PWM / OneShot125 / DSHOT outputs\n   * ADC channels 1-2-3\n   * I2C (for additionnal sensors and peripheral drivers)\n   * UART (for external GPS)\n   * USB\n   * Video composite output (can be directly connected to any FPV drone VTX)\n\n## Building `controller_pc`\nFor cmake to run properly, the below dependecies should be installed first. Below commands are working for: ***Distro***: Ubuntu 22.04.2 LTS (Jammy Jellyfish), ***Kernel***: 5.15.0-69-lowlatency x86_64, ***bits***: 64, ***Desktop***: Xfce 4.16.0 \n1. **Install dependencies**\n\n  * `sudo apt-get install nasm qtmultimedia5-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libiw-dev libfftw3-dev`\n\n  * *QScintilla:*\n    * `sudo apt install libqscintilla2-qt5-dev`\n    * If that doesn't work, try building source from [HERE](https://riverbankcomputing.com/software/qscintilla/download), by running:\n      * `tar -xzf  QScintilla_src-2.13.4.tar.gz`\n      * `cd QScintilla_src-2.13.4/src`\n      * `qmake`\n      * `make`\n      * `make install`\n\n  * *MP4V2:* repo located [HERE](https://github.com/enzo1982/mp4v2)\n    * `git clone https://github.com/enzo1982/mp4v2.git`\n    * `cd mp4v2`\n    * `cmake . \u0026\u0026 make`\n    * `make install`\n\n  * *shine:* repo located [HERE](https://github.com/toots/shine)\n    * `git clone https://github.com/toots/shine`\n    * `cd shine`\n    * `autoreconf --install --force`\n    * `automake`\n    * `./configure`\n    * `make`\n    * `make install`\n\n  * *PF_RING:* Download latest release [HERE](https://github.com/ntop/PF_RING/releases)\n    * `tar -xzf PF_RING-8.4.0.tar.gz`\n    * `cd PF_RING-8.4.0/`\n    * `make`\n    * `make install`\n\n2. **Build**\n  * `git clone https://github.com/dridri/bcflight.git`\n  * `cd bcflight/controller_pc`\n  * `cmake -DCMAKE_BUILD_TYPE=Release -S . -B build`\n  * `cd build`\n  * `make -j$(nproc)`\n  * `./controller_pc`\n\n🎉\n\n\u003cimg width=\"1024px\" style=\"max-width: 100%\" alt=\"Camera view in the Controller PC GUI window\" src=\"misc/controller_pc_camera.png\"/\u003e\n\u003cbr /\u003e\n\u003cimg width=\"1024px\" style=\"max-width: 100%\" alt=\"Sensors view in the Controller PC GUI window\" src=\"misc/controller_pc_sensors.png\"/\u003e\n\u003cbr /\u003e\n\u003cimg width=\"1024px\" style=\"max-width: 100%\" alt=\"Controllers view in the Controller PC GUI window\" src=\"misc/controller_pc_controls.png\"/\u003e\n\n\n## Building `flight`\nCurrently only Raspberry Pi boards are supported, the 4'th variants are the recommended ones. Below commands are working for: ***Distro***: Raspbian GNU/Linux 11 (bullseye), ***Kernel***: 6.1.21-v7l+ armv7l, ***bits***: 32\n\n1. **Install dependencies**\n  * `sudo apt update`\n  * `sudo apt install git pkg-config cmake make g++ libc6-dev libraspberrypi-dev libiw-dev libdrm-dev libgbm-dev libcamera-dev libgles2-mesa-dev libgps-dev libasound2-dev libcrypt-dev zlib1g-dev libpng-dev libshine-dev libavformat-dev libavutil-dev libavcodec-dev libpigpio-dev lua5.3 libfftw3-dev`\n\n2. **Build**\n  * `git clone https://github.com/dridri/bcflight`\n  * `cd bcflight/flight`\n  * `cmake -Dboard=rpi -Ddebug=1 -S . -B build`\n  * `cd build`\n  * `make -j$(nproc)`\n \nThis will produce two files : `flight_unstripped` which contains all debugging symbols, and `flight` which is a lightweight regular executable.\n  * `flight_unstripped` can be run via gdb, or Valgrind using [flight/valgrind.sh](./flight/valgrind.sh)\n  * `flight` is intended to be used on final product\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdridri%2Fbcflight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdridri%2Fbcflight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdridri%2Fbcflight/lists"}