|
| 1 | +# ESP32 project template |
| 2 | + |
| 3 | +## Description |
| 4 | + |
| 5 | +This is a project template to create microcontroller apps with automatized firmware builds for [esp32](https://www.espressif.com/en/products/socs/esp32), [esp32s2](https://www.espressif.com/en/products/socs/esp32-s2) and [esp32s3](https://www.espressif.com/en/products/socs/esp32-s3) microcontroller boards. It uses for that [GitHub Actions](https://github.com/features/actions) and [platformio](https://platformio.org/). Use this repository as a template for your own esp32 projects. |
| 6 | + |
| 7 | +## Requirements |
| 8 | + |
| 9 | +- [GitHub Actions](https://github.com/features/actions) |
| 10 | +- [platformio](https://platformio.org/) |
| 11 | +- [python](https://www.python.org/) |
| 12 | + |
| 13 | +## GitHub Actions - Workflow |
| 14 | + |
| 15 | +The release build happens in the `build & release` workflow: [build_release.yml](.github/workflows/build_release.yml). |
| 16 | +It creates a release, after creation of a new git tag (named it like `v1.0.0`). |
| 17 | + |
| 18 | +If you want to test the build on all merge w/o creating a tag then the `build` workflow is what you looking for: [build.yml](.github/workflows/build.yml) |
| 19 | + |
| 20 | +## PlatformIO |
| 21 | + |
| 22 | +[PlatformIO](https://platformio.org/) is a tool to create microcontroller apps for arduino platforms and compatibles (esp32). You can install the [Visual Studio Code extension](https://platformio.org/install/ide?install=vscode) in the [Visual Studio Code](https://code.visualstudio.com/) IDE. |
| 23 | + |
| 24 | +## Python |
| 25 | + |
| 26 | +There is a tiny python script needed to customize the firmware filenames within platformio, see documentation: https://docs.platformio.org/en/stable/scripting/examples/custom_program_name.html |
| 27 | + |
| 28 | +The [extra_script.py](extra_script.py) script gets the platformio env (e.g. lolin32) and the git-tag for the firmware filename. |
| 29 | +This is required to publish several firmware names in the github artifacts of a release. |
| 30 | + |
| 31 | +## Get Started |
| 32 | + |
| 33 | +<img src="doc/create-new-project-with-template.png" /> |
| 34 | + |
| 35 | +1. Login to github |
| 36 | + |
| 37 | +2. Click on `Use this template` to create a new git repository |
| 38 | +3. Implement your application in the [src/main.cpp](src/main.cpp) |
| 39 | +4. Comment your new change in the [CHANGELOG.md](CHANGELOG.md) file |
| 40 | +5. Push your changes |
| 41 | + |
| 42 | +```sh |
| 43 | +git add . |
| 44 | +``` |
| 45 | + |
| 46 | +```sh |
| 47 | +git commit -am "my app" |
| 48 | +``` |
| 49 | + |
| 50 | +```sh |
| 51 | +git push -u origin main |
| 52 | +``` |
| 53 | + |
| 54 | +5. Create a new tag to trigger a release, e.g. for v1.0.0 |
| 55 | + |
| 56 | +```sh |
| 57 | +git tag v1.0.0 |
| 58 | +``` |
| 59 | + |
| 60 | +```sh |
| 61 | +git push origin v1.0.0 |
| 62 | +``` |
| 63 | + |
| 64 | +6. You can find your firmwares under `Releases` after the CI build finished |
| 65 | + |
| 66 | +## CHANGELOG |
| 67 | + |
| 68 | +You can write your changes in the [CHANGELOG.md](CHANGELOG.md) before you create a release. It will be shown under the release page. |
| 69 | + |
| 70 | +## Example Release |
| 71 | + |
| 72 | +see [Releases](https://github.com/mcuw/esp-ghbuild-template/releases) on the right sidemenu. |
| 73 | + |
| 74 | +## Customize your project |
| 75 | + |
| 76 | +You can reduce and adapt your required boards in the [platformio.ini](platformio.ini). |
| 77 | + |
| 78 | +Update the [CHANGELOG.md](CHANGELOG.md) file before you are creating a new release. By creating a new git tag you trigger a new release which generate for you the firmwares. |
| 79 | + |
| 80 | +## Supported boards |
| 81 | + |
| 82 | +- ESP32 (buy with affiliate link: [LILYGO T-Beam](https://s.click.aliexpress.com/e/_DBzslDV) with LoRA, lolin32, lolin D32 pro) |
| 83 | +- ESP32 S2 |
| 84 | +- ESP32 S3 (buy with affiliate link: [LILYGO T-Display S3](https://s.click.aliexpress.com/e/_DBmOMkn), [LILYGO T-Display-S3 AMOLED](https://s.click.aliexpress.com/e/_DmboYpZ), [LILYGO T-Display-S3 Touch](https://s.click.aliexpress.com/e/_DCBgPlV), [LILYGO T-Display S3 Long](https://s.click.aliexpress.com/e/_Dl6UVMx)) |
| 85 | +- ESP32 C6 with WiFi 6 and BT-5 LE (buy with affiliate link: [UICPAL nanoESP32-C6](https://s.click.aliexpress.com/e/_DdZ83IB) with up to 16MB flash, [ESP32-C6](https://s.click.aliexpress.com/e/_DeLjVMb) with 4MB flash and W2812 RGB LED) |
| 86 | + |
| 87 | +## Disclaimer |
| 88 | + |
| 89 | +Contribution and help ... if you find an issue or wants to contribute then please do not hesitate to create a merge request or an issue. |
| 90 | + |
| 91 | +We provide our build template as is, and we make no promises or guarantees about this code. |
0 commit comments