Project Drohnen: Difference between revisions

From JoBaPedia
Jump to navigation Jump to search
 
(13 intermediate revisions by 2 users not shown)
Line 16: Line 16:
Roughly following [https://github.com/opentx/opentx/wiki/OpenTX-2.3-Docker-Build-Instructions OpenTX-2.3-Docker-Build-Instructions]
Roughly following [https://github.com/opentx/opentx/wiki/OpenTX-2.3-Docker-Build-Instructions OpenTX-2.3-Docker-Build-Instructions]


Opened issue https://github.com/opentx/opentx/issues/6773 to get rid of the sed requirement below
Issue https://github.com/opentx/opentx/issues/6773 to get rid of the sed requirement below is solved.
But in the meantime OpenTX has removed the Dockerfile from the repo. It still works, but you need to checkout an older git hash to retrieve it.


  tag="release/2.3.14"
  tag="release/2.3.14"
Line 61: Line 62:
* Start sender in bootloader mode (press left and right trim to the inside while powering on)
* Start sender in bootloader mode (press left and right trim to the inside while powering on)
* Select firmware in menu and start update
* Select firmware in menu and start update
or
* Install dfu-util (e.g. from github git://git.code.sf.net/p/dfu-util/dfu-util) and copy to /usr/local/bin
* Configure companion Settings/Communication to use that path
* Switch off Taranis
* Plug in USB (dfu-util -l should show the device now, dmesg should show "Product: STM32  BOOTLOADER" and lsusb a line like "Bus 007 Device 025: ID 0483:df11 STMicroelectronics STM Device in DFU Mode")
Found DFU: [0483:df11] ver=2200, devnum=24, cfg=1, intf=0, path="7-1.1", alt=3, name="@Device Feature/0xFFFF0000/01*004 e", serial="3795336E3138"
Found DFU: [0483:df11] ver=2200, devnum=24, cfg=1, intf=0, path="7-1.1", alt=2, name="@OTP Memory /0x1FFF7800/01*512 e,01*016 e", serial="3795336E3138"
Found DFU: [0483:df11] ver=2200, devnum=24, cfg=1, intf=0, path="7-1.1", alt=1, name="@Option Bytes  /0x1FFFC000/01*016 e", serial="3795336E3138"
Found DFU: [0483:df11] ver=2200, devnum=24, cfg=1, intf=0, path="7-1.1", alt=0, name="@Internal Flash  /0x08000000/04*016Kg,01*064Kg,07*128Kg", serial="3795336E3138"
* Read firmware as backup
* Read Models as backup
* Write new firmware
New major releases need new sd card content from https://downloads.open-tx.org/2.3/release/sdcard/opentx-x7/
Don't forget to save your own sounds first (e.g. SOUNDS/de/SYSTEM/hello.wav :) )
== ExpressLRS ==
a new long range radio with good latency, telemetry and completely open source (incl. hardware designs)
* For openSuse (15.2) install RPM from repo https://github.com/ExpressLRS/ExpressLRS-Configurator/releases with zypper
* Run /usr/bin/expresslrs-configurator
* Any time: Download lua script (ELRS.lua) from configurator link and copy to Taranis Q X7 SD card in /SCRIPTS/TOOLS
* Select Release (1.0.1), Target (HappyModel_ES24TX_2400_TX_via_UART), Standard Mode, Check Reg Domain, Binding Phrase, UART inverted(?), Unlock higher power(?), OpenTX Sync, Hybrid Switches, Telemetry, Report Interval 320LU
* Put pins from middle (wifi update) to outside pos (uart update) and select Build and Flash -> Done
* For E[12] Rx Update via wifi: power off TX, power E[12] somehow: it starts a wifi AP to connect (passphrase expresslrs) and webserver at 10.0.0.1 for 1min? Maybe boot 3 times in a row?
* Connect notebook with that wlan and build&flash with ExpressLRS-Configurator (target HappyModel_EP_2400_RX_via_WIFI)
* For E[12] Rx Update via Betaflight-passthrough: Connect FC USB with PC. Don't connect Betaflight-Configurator but use ExpressLRS-Configurator (target HappyModel_EP_2400_RX_via_BetaflightPassthrough)
=== MAC of my ES24TX ===
* ESP8285 MAC: d8:f1:5b:fe:c7:56
* ESP32 MAC: 30:ae:a4:77:bc:a4
=== Info on ExpressLRS ===
* https://betaflight.de/docs/knowledge-base/setup/express-lrs/
* https://github.com/ExpressLRS
=== Flashing E2 via UART ===
* Connect Gnd, TX, RX with 5V USB2Serial (I accidentally used 3.3V and it worked, too)
* Connect Boot-Pad with GND and then VCC with 5V -> ESP in flash mode
* Run ExpressLRS Configurator Build&Flash (or manually start the PlatformIO project HappyModel_EP_2400_RX_via_UART in ~/.config/ExpressLRS Configurator/firmwares/github
build flags: [
  '-D PLATFORM_ESP8266=1',
  '-D VTABLES_IN_FLASH=1',
  '-D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48',
  '-O2',
  '-DTARGET_RX=1
  -Wall -Iinclude',
  '-D TARGET_RX_ESP8266_SX1280_V1',
  '-D TARGET_100mW_MODULE',
  '-D TARGET_SX1280 ', 
  '-DRegulatory_Domain_ISM_2400',
  '-DMY_UID=151,157,170,240,92,190',
  '-DHYBRID_SWITCHES_8',
  '-DENABLE_TELEMETRY',
  '-DLOCK_ON_FIRST_CONNECTION',
  '-DAUTO_WIFI_ON_INTERVAL="20"',
  '-DFAST_SYNC',
  '-DLATEST_COMMIT=0x1,0xd,0x5,0x4,0x3,0xb'
]


== Betaflight ==
== Betaflight ==

Latest revision as of 13:34, 6 August 2021

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

Issue https://github.com/opentx/opentx/issues/6773 to get rid of the sed requirement below is solved. But in the meantime OpenTX has removed the Dockerfile from the repo. It still works, but you need to checkout an older git hash to retrieve it.

tag="release/2.3.14"
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 f7163806f6061cb0a806e5d9f5d2328cbe5f3550
cp -av radio/util/Dockerfile /tmp/
git checkout "$tag"
cd radio/util
mv -v /tmp/Dockerfile .
# 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

or

  • Install dfu-util (e.g. from github git://git.code.sf.net/p/dfu-util/dfu-util) and copy to /usr/local/bin
  • Configure companion Settings/Communication to use that path
  • Switch off Taranis
  • Plug in USB (dfu-util -l should show the device now, dmesg should show "Product: STM32 BOOTLOADER" and lsusb a line like "Bus 007 Device 025: ID 0483:df11 STMicroelectronics STM Device in DFU Mode")
Found DFU: [0483:df11] ver=2200, devnum=24, cfg=1, intf=0, path="7-1.1", alt=3, name="@Device Feature/0xFFFF0000/01*004 e", serial="3795336E3138"
Found DFU: [0483:df11] ver=2200, devnum=24, cfg=1, intf=0, path="7-1.1", alt=2, name="@OTP Memory /0x1FFF7800/01*512 e,01*016 e", serial="3795336E3138"
Found DFU: [0483:df11] ver=2200, devnum=24, cfg=1, intf=0, path="7-1.1", alt=1, name="@Option Bytes  /0x1FFFC000/01*016 e", serial="3795336E3138"
Found DFU: [0483:df11] ver=2200, devnum=24, cfg=1, intf=0, path="7-1.1", alt=0, name="@Internal Flash  /0x08000000/04*016Kg,01*064Kg,07*128Kg", serial="3795336E3138"
  • Read firmware as backup
  • Read Models as backup
  • Write new firmware

New major releases need new sd card content from https://downloads.open-tx.org/2.3/release/sdcard/opentx-x7/ Don't forget to save your own sounds first (e.g. SOUNDS/de/SYSTEM/hello.wav :) )

ExpressLRS

a new long range radio with good latency, telemetry and completely open source (incl. hardware designs)

  • For openSuse (15.2) install RPM from repo https://github.com/ExpressLRS/ExpressLRS-Configurator/releases with zypper
  • Run /usr/bin/expresslrs-configurator
  • Any time: Download lua script (ELRS.lua) from configurator link and copy to Taranis Q X7 SD card in /SCRIPTS/TOOLS
  • Select Release (1.0.1), Target (HappyModel_ES24TX_2400_TX_via_UART), Standard Mode, Check Reg Domain, Binding Phrase, UART inverted(?), Unlock higher power(?), OpenTX Sync, Hybrid Switches, Telemetry, Report Interval 320LU
  • Put pins from middle (wifi update) to outside pos (uart update) and select Build and Flash -> Done
  • For E[12] Rx Update via wifi: power off TX, power E[12] somehow: it starts a wifi AP to connect (passphrase expresslrs) and webserver at 10.0.0.1 for 1min? Maybe boot 3 times in a row?
  • Connect notebook with that wlan and build&flash with ExpressLRS-Configurator (target HappyModel_EP_2400_RX_via_WIFI)
  • For E[12] Rx Update via Betaflight-passthrough: Connect FC USB with PC. Don't connect Betaflight-Configurator but use ExpressLRS-Configurator (target HappyModel_EP_2400_RX_via_BetaflightPassthrough)

MAC of my ES24TX

  • ESP8285 MAC: d8:f1:5b:fe:c7:56
  • ESP32 MAC: 30:ae:a4:77:bc:a4

Info on ExpressLRS

Flashing E2 via UART

  • Connect Gnd, TX, RX with 5V USB2Serial (I accidentally used 3.3V and it worked, too)
  • Connect Boot-Pad with GND and then VCC with 5V -> ESP in flash mode
  • Run ExpressLRS Configurator Build&Flash (or manually start the PlatformIO project HappyModel_EP_2400_RX_via_UART in ~/.config/ExpressLRS Configurator/firmwares/github
build flags: [
  '-D PLATFORM_ESP8266=1', 
  '-D VTABLES_IN_FLASH=1', 
  '-D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48', 
  '-O2', 
  '-DTARGET_RX=1 
  -Wall -Iinclude', 
  '-D TARGET_RX_ESP8266_SX1280_V1', 
  '-D TARGET_100mW_MODULE', 
  '-D TARGET_SX1280 ',  
  '-DRegulatory_Domain_ISM_2400', 
  '-DMY_UID=151,157,170,240,92,190', 
  '-DHYBRID_SWITCHES_8', 
  '-DENABLE_TELEMETRY', 
  '-DLOCK_ON_FIRST_CONNECTION', 
  '-DAUTO_WIFI_ON_INTERVAL="20"', 
  '-DFAST_SYNC', 
  '-DLATEST_COMMIT=0x1,0xd,0x5,0x4,0x3,0xb'
]

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

Flight Controller Config

  • Current target GepRC Stable F7 (mini 20x20): EXF722DUAL: flashed current version 4.2.5
  • 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) is actually Uart5 but receive did not work -> soldered to pads worked
  • Buzzer: Buzzer/LED conn
  • LED strip: Buzzer/LED conn LED + Vid conn 5V/Gnd