From fd0419a2b63ad72e11a35f7d17c2542cd80d0e58 Mon Sep 17 00:00:00 2001 From: blakadder Date: Thu, 31 Oct 2019 20:12:21 +0100 Subject: [PATCH] compile your own article --- Commands.md | 2 +- Compile-your-build.md | 64 ++++++++++++++++++++++++++++++++-- Compiling-Tasmota-on-Gitpod.md | 4 +-- 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/Commands.md b/Commands.md index 2405a541..8992b6c0 100644 --- a/Commands.md +++ b/Commands.md @@ -177,7 +177,7 @@ IPAddress3|`XXX.XXX.XXX.XXX` = set subnet mask IPAddress4|`XXX.XXX.XXX.XXX` = set DNS server IP address
*follow IPAddress commands with `restart 1` to apply changes* Password\|`1` = reset AP\ Wi-Fi password to firmware default (`STA_PASS1`) and restart
`` = set AP\ Wi-Fi password (64 char limit, **do not use special characters or white spaces in the password**) and restart. **Note that `Password` and `Password1` are equivalent commands.** Ssid\|`1` = reset AP\ Wi-Fi SSID to firmware default (`STA_SSID1` or `STA_SSID2`) and restart
`` = set AP\ Wi-Fi SSID (32 char limit, **do not use special characters or white spaces in the SSID**) and restart -WebColor\|Configure Web GUI colors  »6.6.0
`#RRGGBB` = Set web GUI color (x = `1..18`):
`1` = Global text (Black)
`2` = Global background (White)
`3` = Form background (Greyish)
`4` = Input text (Black)
`5` = Input background (White)
`6` = Console text (Black)
`7` = Console background (White)
`8` = Warning text (Red)
`9` = Success text (Green)
`10` = Button text (White)
`11` = Button (Blueish)
`12` = Button hovered over (Darker blueish)
`13` = Restart/Reset/Delete button (Redish)
`14` = Restart/Reset/Delete button hover (Darker reddish)
`15` = Save button (Greenish)
`16` = Save button hover (Darker greenish)
`17` = Config timer tab text (White)
`18` = Config timer tab background (Light grey)
[Default config](https://gist.github.com/blakadder/4569e16fd9cec36d0bc2a8dac6439d42) +WebColor\|Configure Web GUI colors  »6.6.0
`#RRGGBB` = Set web GUI color (x = `1..18`):
`1` = Global text (Black)
`2` = Global background (White)
`3` = Form background (Greyish)
`4` = Input text (Black)
`5` = Input background (White)
`6` = Console text (Black)
`7` = Console background (White)
`8` = Warning text (Red)
`9` = Success text (Green)
`10` = Button text (White)
`11` = Button (Blueish)
`12` = Button hovered over (Darker blueish)
`13` = Restart/Reset/Delete button (Redish)
`14` = Restart/Reset/Delete button hover (Darker reddish)
`15` = Save button (Greenish)
`16` = Save button hover (Darker greenish)
`17` = Config timer tab text (White)
`18` = Config timer tab background (Light grey)
[User themes](webui#themes) WebPassword|Show current web server password
`0` = disable use of password for web UI
`1` = reset password to firmware default (`WEB_PASSWORD`)
`` = set web UI password (32 char limit) for user `WEB_USERNAME` *(Default WEB_USERNAME = `admin`)* WebRefresh|Web page refresh  »6.3.0
`1000..10000` = set refresh time in milliseconds *(default = `2345`)* WebSend|Send a command to Tasmota host over http. If a command starts with a `\` it will be used as a link.  »6.1.0
`[:,:] `
`` = hostname or IP address.
`` = port for the device if not the default `80`
`` = enter username of the device you're sending the command to
`` = enter password of the device you're sending the command to
`` = command and payload
*example: `[] POWER1 ON` sends `http:///cm?cmnd=POWER1 ON`* diff --git a/Compile-your-build.md b/Compile-your-build.md index 21bfc43f..8431582c 100644 --- a/Compile-your-build.md +++ b/Compile-your-build.md @@ -1,3 +1,63 @@ -*Placeholder for future article* +Flash and memory space on an ESP82XX chip is limited and very valuable. Because of that our precompiled binaries include the most popular features of Tasmota but no build can include all of them. -For now refer to [GitPod instructions](https://github.com/arendst/Tasmota/wiki/Compiling-Tasmota-on-Gitpod#customize-firmware-features-and-settings) \ No newline at end of file +To include a feature you need (or build completely customized Tamota) you will have to configure and compile your own version. + +First you will need a [development environment](https://github.com/arendst/Tasmota/wiki/Flashing#flashing-and-compiling-from-source) and Tasmota's source code (either [development](https://github.com/arendst/Tasmota/archive/development.zip) or [master](https://github.com/arendst/Tasmota/archive/master.zip) branch). + +***Simplest way to compile is with [GitPod](Compiling-Tasmota-on-Gitpod), requires only a web browser.** + +Once you have set up the development environment, unzip the source code into a folder. + +Navigate to where you unpacked Tasmota and into /tasmota folder. + +Open `my_user_config.h` and uncomment (remove `//`) line with `#define USE_CONFIG_OVERRIDE`. It should look like this: +`#define USE_CONFIG_OVERRIDE // Uncomment to use user_config_override.h file. See README.md` + +Create a new file in /tasmota folder called `user_config_override.h`. + +Open the file in chosen development environment for editing. + +Enter lines required to enable or disable desired feature. All features and their identifier can be found in [`my_user_config.h`](https://github.com/arendst/Tasmota/blob/development/tasmota/my_user_config.h). + +Best practice to enable a feature is to use +``` +#ifndef %identifier% +#define %identifier% +#endif +``` +Directives|Description +-|- +#define %identifier% | enables the feature +#undef %identifier% | disables the feature +#ifdef %identifier% | checks if the feature is defined in code +#ifndef %identifier% | checks if the feature is not defined +#endif | closes #if statement + +Example: enable blinds and shutters support +``` +#ifndef USE_SHUTTER +#define USE_SHUTTER // Add Shutter support for up to 4 shutter with different motortypes (+6k code) +#endif +``` +- identifier = `USE_SHUTTER` +1. check whether USE_SHUTTER is already defined and proceed if it is not +2. line copied from [`my_user_config.h`](https://github.com/arendst/Tasmota/blob/20370820b85acf282fbf7ebec38ef2a484921a16/tasmota/my_user_config.h#L332) then uncommented. tells the compiler to include (#define) shutter support +3. close the IF statement from line 1 + +Example: disable Domoticz support +``` +#ifdef USE_DOMOTICZ +#undef USE_DOMOTICZ +#endif +``` +- identifier = `USE_DOMOTICZ` +1. check whether `USE_DOMOTICZ` is already defined and proceed if it is +2. tell the compiler to remove (#undef) Domoticz support +3. close the IF statement from line 1 + +>It is not recommended to change `my_user_config.h`, use it only for reference + +Save file, compile the custom binary and flash it + +:warning: +***There are limits to how many features can be included, if you go overboard firmware might not compile due to features conflicting or might not be able to be flashed if it exceeds flash size*** \ No newline at end of file diff --git a/Compiling-Tasmota-on-Gitpod.md b/Compiling-Tasmota-on-Gitpod.md index 12a45807..315237f7 100644 --- a/Compiling-Tasmota-on-Gitpod.md +++ b/Compiling-Tasmota-on-Gitpod.md @@ -36,9 +36,9 @@ The display consists of three panels: 4. Click 'File' on the menu bar and 'Save' your edits. ### Prepare the IDE for Compilation -1. 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. +1. 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. 2. In the Editor (2) pane: - - If you are using your own `user_config_overrid.h`, you must tell the compiler to use it. Find the `[common]` section in the file. Enable `-DUSE_CONFIG_OVERRIDE` + - 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` ![Edit platformio.ini](https://i.imgur.com/AQml2kI.png) - 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 the `platform` and `build_flags` lines for the desired Core. 3. Click 'File' on the menu bar and 'Save' your edits