A small project to mess around with LoRa. It's aim is to provide drones with long-range low-datarate telemetry while providing high-datarate at close ranges.
To support multiple hardware/software configurations, multiple sdkconfig files are provided similar to ESP's multi_config example. Each configuration has it's own sdkconfig.* file and a corresponding command arguments file is profiles/. To build to the ht_tracker configuration, for example, reference it's command argument file when running idf.py as follows:
idf.py @profiles/ht_tracker build
This build will generate an sdkconfig file placed in the build/ht_tracker. While developing, one may want to change various config values with idf.py @profiles/ht_tracker menuconfig, and later check what values have been modified from the defaults with idf.py @profiles/ht_tracker save-defconfig which creates a sdkconfig.defaults file you can reference.
If you want VSCode to better track the build (and properly find the generated sdkconfig.h) you can choose one configuration to develop with by running your first build with something like:
idf.py -DSDKCONFIG_DEFAULTS="sdkconfig.common;sdkconfig.ht_tracker" build
After this you can run a bare idf.py build to re-build as the sdkconfig generated will be re-used. But changing to a different configuration requires deleting the sdkconfig and re-running the above command.
To build the docs run doxygen Doxyfile. This generates html files in build/docs from any doxygen-formatted documentation comments. To view the docs open build/docs/index.html in a web browser.
To keep a consistent style (specifically Google Style) amongst other things we use pre-commit. After cloning this repo devs should run pre-commit install to ensure that pre-commit runs when committing new code. Optionally one can run pre-commit run --all-files to run checks on the entire codebase on-demand.
For boards that support Native USB, JTAG debugging can be performed alongside the console. To enable this, ensure CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is set via menuconfig (GDB debugging can also be done over UART apparently).
OpenOCD should have been installed alongside ESP-IDF. To check you can run idf.py openocd gdb with the board plugged in (this will also GDB). On Linux you may need to put this file in /etc/udev/rules.d/ and run sudo udevadm control --reload.
To start debugging with via VSCode, you need to install the ESP-IDF extension. Then run the ESP-IDF: Select Port to Use command (via View > Command Palette) and select ESP32-S3 chip (via buildtin USB-JTAG). Then run ESP-IDF: Add vscode configuration folder to. Then you just need to start debugging in VSCode (Run > Start Debugging).
- Add ability to use USB-CDC with DLRS_Serial and the serial pass mode
- Add some way to log max stack/heap usage (could also be used in an integration test)
- Add some way to determine board type (ex add an sdkconfig variable) to log on boot and possibly prevent flashing a board with the wrong config
- Ensure all CLI commands work even when logging at the info level is disabled (they should use printf)
- Incorporate esp32 CLI examples as debug tools (iperf, i2c_tools)
- Look more into multiple configs with a custom idf command and idf_ex.py (example)
- Look at how to separate public/private component headers properly (ex I feel like public headers including private headers via
../private_header.his not good practice, maybe investigatePRIV_INCLUDE_DIRS) - Look at making a nicer way to handle sys_mode's rather than a large manual switch case and basic C functions
- Clean up all the INFO level debugs (ex remove all the gpio logs somehow)
- Component README TODOs