Project Drohnen
Jump to navigation
Jump to search
Drohnen
Taranis Q X7
Docker Build Environment
A build is only fully supported with some debian environments (see OpenTX 2.2 Linux Build Instructions). Using docker to solve this for opensuse:
sudo zypper in docker sudo systemctl start docker sudo usermod "$USER" -a -G docker
Create docker image
Roughly following OpenTX-2.3-Docker-Build-Instructions
Opened issue https://github.com/opentx/opentx/issues/6773 to get rid of the sed requirement below
tag="2.3" pcb="X7" opts="-DGVARS=YES -DLUA=YES -DLUA_COMPILER=YES -DHELI=NO -DDEBUG=NO -DCMAKE_BUILD_TYPE=Release" git clone --recursive https://github.com/opentx/opentx.git cd opentx git checkout "$tag" cd radio/util sed -i 's@/debian/pool@/debian-archive/debian/pool@' Dockerfile docker build -t "opentx-$tag" . cd - mkdir "build-$pcb" docker run -v "$PWD:/opentx" -e "OPENTX_VERSION_SUFFIX=$tag" -w "/opentx/build-$pcb" "opentx-$tag" cmake -DPCB="$pcb" $opts ../ docker run -v "$PWD:/opentx" -e "OPENTX_VERSION_SUFFIX=$tag" -w "/opentx/build-$pcb" "opentx-$tag" make firmware
Other build options (e.g PCB, TRANSLATIONS, ...) can be looked up with
docker run -v "$PWD:/opentx" -e "OPENTX_VERSION_SUFFIX=$tag" -w "/opentx/build-$pcb" "opentx-$tag" cmake -LH
Companion
Companion can be built with
docker run -v "$PWD:/opentx" -e "OPENTX_VERSION_SUFFIX=$tag" -w "/opentx/build-$pcb" "opentx-$tag" make companion23
Run companion within docker (for testing, no usb access)
xopts="-e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix" docker run -v "$PWD:/opentx" -e "OPENTX_VERSION_SUFFIX=$tag" -w "/opentx/build-$pcb" $xopts "opentx-$tag" ./companion23
Companion runs fine in the opensuse host OS (for normal use, including talking with radio via usb)
"build-$pcb/companion23"
Flash Firmware
- Copy "build-$pcb"/firmware.bin to the SD cards Firmware directory
- Insert SD card into the sender
- Start sender in bootloader mode (press left and right trim to the inside while powering on)
- Select firmware in menu and start update
Betaflight
Disable ModemManager
sudo systemctl stop ModemManager sudo systemctl disable ModemManager
Register STM32 as Udev Device
- Create file /etc/udev/rules.d/45-stdfu-permissions.rules
# DFU (Internal bootloader for STM32 MCUs) ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="dialout"
- Activate changed rules
sudo udevadm control --reload-rules sudo udevadm trigger
Build And Start Current Betaflight Configurator
git clone https://github.com/betaflight/betaflight-configurator.git cd betaflight-configurator/ git checkout 10.5.1 sudo zypper in nodejs10 sudo npm install yarn -g sudo npm install gulp -g npm install gulp release --linux64 apps/betaflight-configurator/linux64/betaflight-configurator
Build And Flash Betaflight Firmware
git clone https://github.com/betaflight/betaflight.git cd betaflight git checkout 4.0.6 make arm_sdk_install make JHEF7DUAL
- In Betaflight Configurator select "Firmware Update", then select "Load Firmware (local)".
- Choose betaflight/obj/*.hex file
- Select "Flash Firmware" (sometimes needed twice to start the flash)
- After flash connect again. Log includes build time.
Useful Links
- Configure BMP280: https://github.com/betaflight/betaflight/wiki/Barometer-Configuration-(3.2)
- Betaflight Slack (User joba1): https://betaflightgroup.slack.com/messages
- Config of my FC (except I2C/BMP280?): https://github.com/betaflight/betaflight/blob/master/src/main/target/JHEF7DUAL/target.h
Flight Controller Config
- Current target GepRC Stable F7 (mini 20x20): EXF722DUAL
- R-XSR: Recv con (R4) + soldered S.Port (T3) (T3 unlike doc which uses T1 that I use for GPS)
- GPS: 5-Pin conn (Uart1)
- Buzzer: Buzzer/LED conn
- LED strip: Buzzer/LED conn LED + Vid conn 5V/Gnd