Compiling Tasmota on Gitpod - stodev-com-br/tasmota GitHub Wiki
Even though Tasmota offers several pre-compiled firmware variants, sometimes the ready-to-flash binaries aren't enough. If you need to enable or disable some features, or simply change some parameters, then you need to compile a firmware binary yourself.
If you are not experienced enough or don't want to install an IDE (Integrated Development Environment) like PlatformIO or Arduino-IDE on your computer, compiling your own firmware is a breeze using Gitpod.
Gitpod is a web browser based online IDE. All you need to use it is to link your GitHub account (or make a new one here). Gitpod will take care of all the necessary software package dependencies for you.
After you successfully sign in, you can start your personal project. The fastest way to load Tasmota into Gitpod is with one of the following links:
- Development Branch:
https://gitpod.io#https://github.com/arendst/Tasmota/tree/development
- Master Release:
https://gitpod.io#https://github.com/arendst/Tasmota/tree/master
- TasmoCompiler:
https://gitpod.io/#https://github.com/benzino77/tasmocompiler
Browser Extension
Gitpod has a browser extension (Chrome and Firefox) which is handy to directly load a GitHub project into your personal Gitpod work-space.
More information on the Gitpod browser extension.
Using Gitpod
After Gitpod loads the project, you will be greeted by the main window. Gitpod will then automatically compile tasmota.bin
. Wait for the compilation to complete.
The display consists of three panels:
- Explorer
- Editor
- Terminal
Customize Firmware Features and Settings
:warning: ATTENTION: The proper method of customizing firmware compilation options is to use the user_config_override.h
file. Most customizations should not require changes to the my_user_config.h
file. To modify the stock configuration:
- Select the
/tamota
folder in the Explorer (1) pane - Create a new file called
user_config_override.h
- In the Editor (2) pane, add, change, or remove anything you need in your configuration file to define your own settings. Refer to the
user_config_override_sample.h
file as well asmy_user_config.h
for#define
options (sample). You can find a list of Tasmota features and settings listed here. Define the features you require in your configuration file. - Click 'File' on the menu bar and 'Save' your edits.
Prepare the IDE for Compilation
- Open the
platformio.ini
file located in the/tasmota
root directory (scroll to the bottom of the file Explorer (1) pane). In this file, removing a leading semicolon;
enables a statement. - In the Editor (2) pane:
- If you are using your own
user_config_override.h
, you must tell the compiler to use it. Find the[common]
section in the file. Enable-DUSE_CONFIG_OVERRIDE
- By default, the 2.6 Core will be compiled. If you wish to use a different Core, find the
[core_active]
section in the file and enable theplatform
andbuild_flags
lines for the desired Core.
- If you are using your own
- Click 'File' on the menu bar and 'Save' your edits
Compile Your Firmware
This action is done in the Terminal pane (3) with very simple commands.
The simplest one is platformio run -e tasmota
. With this command, Gitpod will compile the Tasmota firmware with the features you selected. If you need a different variant, you can specify this option on the command line:
platformio run -e <variant-name>
Examples:
platformio run -e tasmota-sensors
platformio run -e tasmota-DE
Compilation normally takes only a couple of minutes. The time if takes is directly related to the configurations you selected; the more features selected means more time is needed to compile. When done, you will find a firmware file named firmware.bin
in the /Tasmota/.pioenvs/<variant-name>/
folder in the Explorer (1) pane.
Download firmware.bin
to your computer by right-clicking on the file and selecting 'Download'. You are now ready to flash your device.
Watch a livestream video by digiblurDIY of compiling Tasmota using Gitpod.
Flash Your Device
OTA Flash
If you already have Tasmota flashed on your device, you can use the File Upload
OTA method to load the new firmware binary file.
- Download
tasmota-minimal.bin
- Make a backup of the device configuration using the web UI
Configuration
menu option. - Upload
tasmota-minimal.bin
to your device using the web UIFirmware Upgrade
selection. ChooseUpgrade by file upload
. - After
tasmota-minimal.bin
is successfully loaded, selectFirmware Upgrade
once again and upload the firmware file compiled using Gitpod.
Serial Flash
Follow the same procedure for flashing as you would any new device.