Updated Compiling Tasmota on Gitpod (markdown)

Michael Ingraham 2019-05-07 16:18:35 -04:00
parent 5689f842e5
commit 1677597731
1 changed files with 27 additions and 32 deletions

@ -1,21 +1,22 @@
Even if we offer various Tasmota flavors, sometimes the ready-to-flash binary aren't enough.
Do you want to enable or disable some features, or simply change some parameters? Then you need to compile yourself a binary.
Even though Tasmota offers several pre-compiled firmware variants, sometimes the ready-to-flash binaries aren't enough.
Do you want to enable or disable some features, or simply change some parameters? Then you need to compile a binary yourself.
If you are not skilled enough or don't want to install an IDE (Integrated Development Environment) like PlatformIO or Arduino-IDE on your computer, you can compile yourself in a breeze on [Gitpod](https://www.gitpod.io/).
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, you can compile your own firmware in a breeze on [GitPod](https://www.gitpod.io/).
#### Gitpod:
is a One-Click Online IDE, running on any recent browser. All you need to use it is just link your GitHub account (or make a new one [here](https://github.com/join?source=header)).
#### 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](https://github.com/join?source=header)).
![Gitpod login](https://i.imgur.com/irTdi4A.png)
![GitPod login](https://i.imgur.com/irTdi4A.png)
After you successfully sign in you can start your personal project.
The fastest way to load Tasmota on Gitpod is with the following link
After you successfully sign in, you can start your personal project. The fastest way to load Tasmota into GitPod is with the following link:
[https://gitpod.io#https://github.com/arendst/Sonoff-Tasmota](https://gitpod.io#https://github.com/arendst/Sonoff-Tasmota)
`https://gitpod.io#https://github.com/arendst/Sonoff-Tasmota/tree/<branch>`
Gitpod will take care of all the dependency needed for you.
where branch is either `master` of `development`
After loading the project, you will be greeted by the main window, presenting three main sections:
GitPod will take care of all the necessary software package dependencies for you.
After loading the project, you will be greeted by the main window, presenting three panels:
1. Explorer
2. Editor
@ -23,49 +24,43 @@ After loading the project, you will be greeted by the main window, presenting th
![Gitpod main screen](https://i.imgur.com/nfAYnwM.png)
Explorer is the first place you need to look if you want to edit your configuration.
Explorer is the first place you need to look to edit your configuration.
#### :warning: ATTENTION:
Users are strongly advised to use the `user_config_override.h` file for most changes and not the config `my_user_config.h` located under /sonoff folder.
To modify the stock configuration without changing the `my_user_config.h` file:
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:
1. Copy this file to `user_config_override.h` (It will be ignored by Git)
2. Define your own settings below
3. On Gitpod:
* open the file `platformio.ini` (on root directory)
* find [common] section and uncomment `-DUSE_CONFIG_OVERRIDE` (remove the semicolon `;` at the beginning of the line) and save.
1. Select the `/sonoff` folder in the Explorer (1) pane
2. Create a new file called `user_config_override.h`
3. In the Editor (2) pane, change, add, 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 as `my_user_config.h` for `#define` options. You can find a list of Tasmota features supported listed [here](https://github.com/arendst/Sonoff-Tasmota/wiki/Builds). Define the features you require in your configuration file.
4. Open the `platformio.ini` file located in the `/Sonoff-Tasmota` root directory (scroll to the bottom of the file Explorer pane)
5. In the Editor (2) pane, find the `[common]` section and uncomment (remove the semicolon `;` at the beginning of the line) `-DUSE_CONFIG_OVERRIDE`
![Edit platformio.ini](https://i.imgur.com/AQml2kI.png)
You are now ready to change, add or remove all you need on your configuration file.
When done save, now you're ready to compile.
When you are done, save all of your edits (user_config_override & platformio.ini). Now you're ready to compile.
#### COMPILING YOUR BINARY:
This action is done on terminal window with very simple commands.
The straight one is `platformio run -e sonoff`
This action is done in the Terminal pane (3) with very simple commands. The simplest one is `platformio run -e sonoff`
![compile command](https://i.imgur.com/wXA4hvd.png)
With this command Gitpod will compile sonoff.bin for you.
If you like another flavor, we get you covered!
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 [sonoff-flavor-you-like-here]`
`platformio run -e <variant-name>`
For example:
`platformio run -e sonoff-sensors`
or
`platformio run -e sonoff-DE`
[Here](https://github.com/arendst/Sonoff-Tasmota/wiki/Builds) you can find a list of Tasmota builds with respective features supported.
Compiling time normally takes a couple of minutes, this time is directly related to the configuration you made: more feature added means more time needed to compile.
When done, you will find you binary (`firmware.bin`) on `/Sonoff-Tasmota/.pioenvs/[name of the build]/`
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 you binary (`firmware.bin`) in `/Sonoff-Tasmota/.pioenvs/<variant-name>/`
![folders](https://i.imgur.com/SEqyGy2.png)
You just need to download the file firmware.bin to your computer, you are now ready to flash with [Esptool](https://github.com/arendst/Sonoff-Tasmota/wiki/Esptool) or any other compatible [tool](https://github.com/arendst/Sonoff-Tasmota/wiki/Flashing).
Download the `firmware.bin` file to your computer and you are now ready to flash your device. Use [`esptool`](https://github.com/arendst/Sonoff-Tasmota/wiki/Esptool) or any other firmware upload [method](https://github.com/arendst/Sonoff-Tasmota/wiki/Flashing).
#### Extension:
Gitpod has a browser extension (Chrome and Firefox) useful to load directly a GitHub project in your personal work-space.
#### Browser Extension:
GitPod has a browser extension (Chrome and Firefox) useful to directly load a GitHub project into your personal work-space.
![Gitpod link](https://i.imgur.com/uEHszIn.png)