Skip to content

Commit d964834

Browse files
authored
Docs: Add Developer Guide for Linux Users (#445)
* Fix: aspell instead of apsell * Docs: Add Developer Guide for Linux Users This patch adds a straight-forward quick start guide for linux users to get involved with the project. Add respective words to .wordlist.txt
1 parent 9302161 commit d964834

File tree

3 files changed

+92
-1
lines changed

3 files changed

+92
-1
lines changed

.spellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
matrix:
22
- name: Markdown
33
expect_match: false
4-
apsell:
4+
aspell:
55
lang: en
66
dictionary:
77
wordlists:

.wordlist.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,3 +493,14 @@ Bidirectionality
493493
VTXes
494494
OpenVTX
495495
Xrossband
496+
Arduino
497+
repurposed
498+
env
499+
venv
500+
pio
501+
platformio
502+
src
503+
Mhz
504+
Ctrl
505+
esptool
506+

docs/software/toolchain-install.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,83 @@ Don't change ``user_defines.txt`` for setting up your local configuration. Inste
133133
-DAUTO_WIFI_ON_INTERVAL=40
134134

135135
Note: the `!` flag is called the removal flag. It removes other flags that completely match the text after the `!`.
136+
137+
## Toolchain Setup (Advanced) for Linux Users
138+
139+
!!! note "Note"
140+
These instructions are meant as a quick start guide for those who develop on Linux.
141+
Typically developers on Linux don't need much of an explanation and just look for the right commands for the toolchain.
142+
That's what this guide will provide, without any nudging to use Microsoft VSCode IDE.
143+
144+
145+
### Cloning the Repo
146+
Open a Shell (Bash) in your regular workspace and clone the repo recursively like always and change into that directory.
147+
It is assumed that Linux users know how to use git.
148+
149+
```
150+
git clone --recursive https://github.com/ExpressLRS/ExpressLRS.git
151+
cd ExpressLRS
152+
```
153+
154+
### PlatformIO
155+
PlatformIO is available as a Python package and can be installed via Pip.
156+
Following best practices we will create a virtual environment in the repo directory first.
157+
158+
1. Install virtual-env (just in case it's not installed by default)
159+
160+
```
161+
pip install virtual-env
162+
```
163+
164+
2. Setup a virtual environment to not taint your system's python installation.
165+
It does not matter where you create this but it makes sense to create it in the project directory, because best practice is to have a separate venv for each python project.
166+
167+
```
168+
python -m venv .venv
169+
source .venv/bin/activate
170+
```
171+
172+
3. Install the required python packages. `empy` and `pexpect` are listed because modules like `dronecan` fail to correctly specify
173+
their dependencies for pip to install them automatically.
174+
175+
```
176+
pip install platformio dronecan setuptools empy==3.3.4 pexpect
177+
```
178+
179+
### Building Targets using PlatformIO
180+
181+
The platformio package comes with the [pio](https://docs.platformio.org/en/latest/core/userguide/cmd_run.html) executable.
182+
It is the build command of the toolchain.
183+
`pio` expects a `platformio.ini` file in the directory where it is invoked, so change into src directory first.
184+
185+
There find and open the `user_defines.txt` file in your favorite editor.
186+
This file contains the build flags that you know from ELRS Configurator.
187+
At least uncomment the line for your regulatory domain. That's the minimum requirement for the build to work.
188+
You may also want to set your binding phrase and everything else you would normally set in the ELRS Configurator.
189+
190+
To verify your build environment does work, start building firmware for a common 900Mhz target. It obviously needs a corresponding regulatory domain setting.
191+
192+
```
193+
cd src
194+
pio run --environment Unified_ESP32_900_RX_via_BetaflightPassthrough
195+
```
196+
197+
At some point at the end of the build you will be asked to select some configuration between different manufacturers and products.
198+
This sets parameters to provision a unified software binary with information about the device hardware, e.g. if the device has a power amplifier, diversity, etc. .
199+
200+
When you reach that point, this indicates that everything did work. You can abort with Ctrl-C and Enter now.
201+
202+
### Finding the right configuration for your target
203+
204+
This is the most tricky and obscure part of the ELRS project.
205+
Browsing through the `platformio.ini` file already gives hints about the correct environment, but typically you need to look into the [targets](https://github.com/ExpressLRS/targets) and into the [devices](https://github.com/ExpressLRS/ExpressLRS-Configurator/tree/master/devices) to back-track what the configurator would select for your device.
206+
Another option is to look into the logs of the ELRS Configurator after it flashed your device. You should find the call to pio together with the arguments there.
207+
208+
### Flashing
209+
210+
When you select `--target upload` and provide an `--upload-port`, pio will flash the device as the final step of the build, again asking you about manufacturer / device. Under the hood pio then invokes [esptool](https://github.com/espressif/esptool).
211+
212+
```
213+
pio run --target upload --environment Unified_ESP32_900_RX_via_BetaflightPassthrough --upload-port /dev/ttyUSB0
214+
```
215+

0 commit comments

Comments
 (0)