platformio.ini problem in mega-20191122

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

platformio.ini problem in mega-20191122

#1 Post by mackowiakp » 22 Nov 2019, 06:45

I really dont know how to play with new platformio.ini in mega-20191122.
I uncommented line (and only that one):

Code: Select all

default_envs = normal_ESP8266_4M1M
But I still get error:

Code: Select all

> Executing task: platformio run <

Error: Please setup environments in `platformio.ini` file
The terminal process terminated with exit code: 1
I want to compile "normal" version based on 2.6.0 and 2.6.1 using SDK 2.2.2 or 3

How can I do it?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: platformio.ini problem in mega-20191122

#2 Post by grovkillen » 22 Nov 2019, 08:16

Try vagrant?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#3 Post by mackowiakp » 22 Nov 2019, 10:01

I dont understand. Vagrant - for what? Is it necessary to use virtualization? It was not needed so far.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#4 Post by TD-er » 22 Nov 2019, 11:54

The new platformio.ini layout requires platformio 4.1, so you probably must upgrade platformIO if you get build errors.

Open a terminal in your editor (Atom/VS code) and type:
pio upgrade

You can also try the dev version (not needed) with:
pio upgrade --dev

After upgrade you need to restart the IDE.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#5 Post by mackowiakp » 22 Nov 2019, 13:26

I have the newest version of platformio (VS platform)

Code: Select all

[maciek@Piotr source]$ pio upgrade
You're up-to-date!
PlatformIO 4.1.0 is currently the newest version available
But still can not even run any task (clean, compile or so) because of platformio.ini error as listed earlier.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#6 Post by TD-er » 22 Nov 2019, 13:32

And what if you just select the right task from the PlatformIO list?
(reverting the change you made)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#7 Post by TD-er » 22 Nov 2019, 13:35

Oh and make sure you restart the IDE after changing the platformio.ini file.
Also when you fetch the current repo from GitHub and it has platformio.ini changed.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#8 Post by mackowiakp » 22 Nov 2019, 13:41

Changes revering by removing former whole ESPEasy_mega-20191122 dir and decompressing ESPEasy_mega-20191122.zip file once again. "Clean" taken "as is" from git.
Run "build"

Code: Select all

> Executing task: platformio run <

Error: Please setup environments in `platformio.ini` file
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.
Run "Clean"

Code: Select all

> Executing task: platformio run <

Error: Please setup environments in `platformio.ini` file
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.
Last edited by mackowiakp on 22 Nov 2019, 13:45, edited 1 time in total.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#9 Post by mackowiakp » 22 Nov 2019, 13:44

Oh and make sure you restart the IDE after changing the platformio.ini file.
Also when you fetch the current repo from GitHub and it has platformio.ini changed.
Of course I did it.

Flying Domotic
Normal user
Posts: 37
Joined: 27 Aug 2019, 23:57

Re: platformio.ini problem in mega-20191122

#10 Post by Flying Domotic » 22 Nov 2019, 18:11

Try :

Code: Select all

env_default = normal_ESP8266_4M1M

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#11 Post by TD-er » 22 Nov 2019, 18:28

But have you tried by reverting your changes?
In other words, do you get build errors with the version as it is now present on the Github repo?

If that's also not working, then we have an issue with your setup, as it is building fine on my PC, on Linux, etc.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#12 Post by mackowiakp » 23 Nov 2019, 05:33

Flying Domotic wrote: 22 Nov 2019, 18:11 Try :

Code: Select all

env_default = normal_ESP8266_4M1M
I did it. The result is the same

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#13 Post by mackowiakp » 23 Nov 2019, 05:40

But have you tried by reverting your changes?
In other words, do you get build errors with the version as it is now present on the Github repo?
As I wrote earlier, changes revering by removing former whole ESPEasy_mega-20191122 dir and decompressing ESPEasy_mega-20191122.zip file once again. "Clean" sources taken "as is" from git.
If that's also not working, then we have an issue with your setup, as it is building fine on my PC, on Linux, etc.
I use Linux too (Mageia 7, RHEL fork) and VS as a platform for PIO. VS repo is added to YUM repos so always the newest version of "code" is installed.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#14 Post by mackowiakp » 23 Nov 2019, 07:04

I try today mega-20191123 - the same problem. Once more. Zip file taken "as is" from git, decompress and loaded as new project to PIO.

Flying Domotic
Normal user
Posts: 37
Joined: 27 Aug 2019, 23:57

Re: platformio.ini problem in mega-20191122

#15 Post by Flying Domotic » 23 Nov 2019, 08:11

Just to be sure, how are you starting build? Using <F7> key? What happens if you choose "normal ESP8266 4M1M" build in the F7 list?

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#16 Post by mackowiakp » 23 Nov 2019, 09:51

After depressing F7 nothing appears. No menu. Both in working version (mega-20191119) and not-working starting from mega-20191122.
I use "Run task" option located in bottom menu strip. If I click on the icon, pop-up menu is display.
I use VS on Linux (not Atom). As I remember, in Atom after depressing F7, pop-up menu was display. But because of problems with constant crashing of Atom, I change it to VS.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#17 Post by TD-er » 23 Nov 2019, 10:19

If you open a terminal in VS code, and type "pio --version" what do you get?
It looks like your platformIO version is < 4.1

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#18 Post by mackowiakp » 23 Nov 2019, 10:33

Code: Select all

[maciek@Piotr source]$ ~/back/.platformio/penv/bin/pio --version
PlatformIO, version 4.1.0
But now I notice that after upgrade (5 or 6 days ago) it lost PATH to pio binary. So I have to enter full path. Will investigate.
But maybe somebody else have the same problem? Any idea?

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#19 Post by mackowiakp » 23 Nov 2019, 10:43

No, it is not matter of path. Simply I changed ESP easy source version, without reload VS. After reload terminal takes proper path.
so You have:

Code: Select all

> Executing task: platformio run <

Error: Please setup environments in `platformio.ini` file
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

Code: Select all

[maciek@Piotr source]$ pio --version
PlatformIO, version 4.1.0
[maciek@Piotr source]$

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#20 Post by TD-er » 23 Nov 2019, 11:01

Is this a terminal from within VScode?
By running it from within the terminal in VScode, you make sure you have the same Python virtual env running as used when trying to build it in VS code.

Also just curious, what Python version are you running in the virtual env for VS code?
I recently updated to Python 3.8 on my Windows machine.
But one of the build systems I have is still using Python 2.7, so that should also still work.

Just don't upgrade your Python environment in Linux, but do it via the Python virtual env for VS code.
Python has a very nice system to separate Python configurations for specific applications, but it requires a small learning curve :)

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#21 Post by TD-er » 23 Nov 2019, 11:48

By the way, you can also see the PIO version when starting "PlatformIO Home", by pressing the house icon in the lower toolbar of VS code.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#22 Post by mackowiakp » 23 Nov 2019, 12:04

Code: Select all

Is this a terminal from within VScode?
By running it from within the terminal in VScode, you make sure you have the same Python virtual env running as used when trying to build it in VS code.
Yes, this is terminal from VS. Python version used by VS (from VS terminal) :

Code: Select all

[maciek@Piotr source]$ python -V
Python 2.7.17
[maciek@Piotr source]$ 
My Linux based PC has installed Python`s in versions 2.7.17 and 3.7.5. I used both versions depending on application.
Its easy to use different versions of Python, depending on apps.
Mageia 7 use for its own internal needs ver 3.xx at least several years.
For other apps default is 2.7.17. But as I wrote, it can be changed per apps.
To summarize, VS code use 2.7.17 in my case.
By the way, you can also see the PIO version when starting "PlatformIO Home", by pressing the house icon in the lower toolbar of VS code.
PIO.png
PIO.png (271.57 KiB) Viewed 20785 times
So all looks OK

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#23 Post by TD-er » 23 Nov 2019, 12:24

Can you upgrade PIO to the dev version?

Code: Select all

pio upgrade --dev
Make sure to run it from within your terminal in VScode.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#24 Post by mackowiakp » 23 Nov 2019, 12:40

Code: Select all

[maciek@Piotr source]$ pio upgrade --dev
Please wait while upgrading PlatformIO ...
PlatformIO has been successfully upgraded to 4.1.1b3
Release notes: https://docs.platformio.org/en/latest/history.html
Warning! Please restart IDE to affect PIO Home changes

Code: Select all

[maciek@Piotr source]$ pio --version
PlatformIO, version 4.1.1b3

Code: Select all

> Executing task: platformio run <

Error: Please setup environments in `platformio.ini` file
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.
F7 does not work.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#25 Post by TD-er » 23 Nov 2019, 13:06

Just checking, but you do have all .ini files there, right?
All ini files mentioned in the [platformio] section of the platformio.ini

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#26 Post by mackowiakp » 23 Nov 2019, 13:15

As I wrote. Taken "as is" from zip file. No changes I made.

But now for test, I copied platformio.ini from mega-20191119. And it works OK, it was possible to compile without problems for example normal_core_260_sdk222_alpha_ESP8266_4M1M.
And BTW. What does it mean in release notes "Change to SDK 20190703 to improve WiFi". Does it stands for "in normal default SDK is ver 3"?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#27 Post by TD-er » 23 Nov 2019, 13:24

The multi-file .ini is a feature of PIO 4.0 ( https://docs.platformio.org/en/latest/p ... ic-options )
The extends option is part of PIO 4.1

What you can do, is to concatenate all .ini files into a single platformio.ini file and see if that's working.
You should do it in the order of the .ini files mentioned in the "extra_configs" parameter and perhaps also remove that from the new .ini file.

Is there something special about the directory where you try to build ESPEasy?
For example, is it a mount of a network filesystem?

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#28 Post by mackowiakp » 23 Nov 2019, 13:35

What you can do, is to concatenate all .ini files into a single platformio.ini file and see if that's working.
You should do it in the order of the .ini files mentioned in the "extra_configs" parameter and perhaps also remove that from the new .ini file.
I made it de facto by copy platformio.ini from mega-20191119 (just for test i mentioned). And it works.
Is there something special about the directory where you try to build ESPEasy?
For example, is it a mount of a network filesystem?
No. I have dir named TMP in user working home dir. In TMP I collect all decompressed zip files I use. No network mounts, symlinks, mounted via loop/bind dir to dir or so inside TMP dir.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#29 Post by mackowiakp » 23 Nov 2019, 13:47

The multi-file .ini is a feature of PIO 4.0 ( https://docs.platformio.org/en/latest/p ... ic-options )
The extends option is part of PIO 4.1
Yeah. Documentation says so. But - in my opinion - there is a bug in PIO 4.1.
So maybe you should consider returning to the previous platformio.ini format?

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#30 Post by mackowiakp » 23 Nov 2019, 14:13

Another thing is why compilation of single file takes up to 30 sec. I have Intel 8 cores, 16 threads, 3.6 GHz processor and M2 on-board SSD drive so another compilations I have just "on click".
As I look to the "top" output, PIO can use practically only one tread. In my meaning - bug.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#31 Post by TD-er » 23 Nov 2019, 17:28

mackowiakp wrote: 23 Nov 2019, 14:13 Another thing is why compilation of single file takes up to 30 sec. I have Intel 8 cores, 16 threads, 3.6 GHz processor and M2 on-board SSD drive so another compilations I have just "on click".
As I look to the "top" output, PIO can use practically only one tread. In my meaning - bug.
You cannot conclude it is a bug if it is only using a single thread.
If no files have to be compiled, then it only has to collect everything for linking.
That's something you cannot do in lots of threads. Especially Arduino sketches have lots of code which is globally defined, so that cannot be processed multi-threaded.

And have you concatenated all ini files in a single file (still using the extends option), like I asked?
There are 2 major changes in the platform.ini file we now have:
- split into several files
- Using extends.

If the problem you're facing is related to having several files, then for the time being (until it is fixed in PIO) we can concatenate the files for sure.
If the problem is with the extends feature, then I'm less willing to revert the changes.
The problem is that without the extends feature the file will have lots and lots of definition duplication which does take a lot of work for me for single changes and is very error prone.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#32 Post by mackowiakp » 23 Nov 2019, 18:05

And have you concatenated all ini files in a single file (still using the extends option), like I asked?
As I wrote, I copied platformio.ini from mega-20191119, and it works OK. It is simmilar to concentration.

If You want to concentrate all *.ini files into single platformio.ini than You have below all *.ini files included in zip file:

Code: Select all

[maciek@Piotr ~]$ cd TMP/ESPEasy_mega-20191123/
[maciek@Piotr ESPEasy_mega-20191123]$ find . -type f -name *.ini
./source/platformio.ini
./source/lib/HLW8012_1.1.1/examples/HLW8012_Interrupts/platformio.ini
./source/lib/HLW8012_1.1.1/examples/HLW8012_Basic_Sleep/platformio.ini
./source/lib/HLW8012_1.1.1/examples/HLW8012_Basic/platformio.ini
./source/lib/IRremoteESP8266/platformio.ini
./source/lib/IRremoteESP8266/examples/IRsendProntoDemo/platformio.ini
./source/lib/IRremoteESP8266/examples/TurnOnToshibaAC/platformio.ini
./source/lib/IRremoteESP8266/examples/TurnOnMitsubishiAC/platformio.ini
./source/lib/IRremoteESP8266/examples/IRGCSendDemo/platformio.ini
./source/lib/IRremoteESP8266/examples/ControlSamsungAC/platformio.ini
./source/lib/IRremoteESP8266/examples/IRrecvDump/platformio.ini
./source/lib/IRremoteESP8266/examples/TurnOnTrotecAC/platformio.ini
./source/lib/IRremoteESP8266/examples/IRMQTTServer/platformio.ini
./source/lib/IRremoteESP8266/examples/TurnOnKelvinatorAC/platformio.ini
./source/lib/IRremoteESP8266/examples/TurnOnArgoAC/platformio.ini
./source/lib/IRremoteESP8266/examples/TurnOnDaikinAC/platformio.ini
./source/lib/IRremoteESP8266/examples/IRrecvDemo/platformio.ini
./source/lib/IRremoteESP8266/examples/TurnOnFujitsuAC/platformio.ini
./source/lib/IRremoteESP8266/examples/CommonAcControl/platformio.ini
./source/lib/IRremoteESP8266/examples/TurnOnPanasonicAC/platformio.ini
./source/lib/IRremoteESP8266/examples/JVCPanasonicSendDemo/platformio.ini
./source/lib/IRremoteESP8266/examples/LGACSend/platformio.ini
./source/lib/IRremoteESP8266/examples/IRsendDemo/platformio.ini
./source/lib/IRremoteESP8266/examples/SmartIRRepeater/platformio.ini
./source/lib/IRremoteESP8266/examples/Web-AC-control/platformio.ini
./source/lib/IRremoteESP8266/examples/TurnOnMitsubishiHeavyAc/platformio.ini
./source/lib/IRremoteESP8266/examples/IRrecvDumpV2/platformio.ini
./source/lib/IRremoteESP8266/examples/IRGCTCPServer/platformio.ini
./source/lib/IRremoteESP8266/examples/IRServer/platformio.ini
./source/lib/IRremoteESP8266/examples/DumbIRRepeater/platformio.ini
[maciek@Piotr ESPEasy_mega-20191123]$ find . -type f -name *.ini|wc -l
30
I dont use IRremote or HLW8012. So I dont know what to concentrate.......

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#33 Post by mackowiakp » 23 Nov 2019, 19:07

Problem solved. Simply file labeled as "ESPEasy_mega-20191123.zip" is not complete (as it was earlier)
But file labeled "Source code (zip)" is complete and it is possible to compile what I need.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#34 Post by TD-er » 23 Nov 2019, 19:17

Nope, only the ones mentioned in the platformio.ini.

I will create one, just to make sure we're talking about the same here.
The problem is, I tested it on:
- Windows 10 with Python 3.8
- Ubuntu 18.04 (command line) With Python 2.7
- Travis with Python 2.7
- Chromebook with Chrome-OS + VScode

And so it is really not clear what's the problem here.

So below is just the concatenation of the platformio*.ini files as mentioned in the platform.ini in this order:

Code: Select all

extra_configs =
  platformio_core_defs.ini
  platformio_esp82xx_base.ini
  platformio_esp82xx_envs.ini
  platformio_esp32_envs.ini
  platformio_special_envs.ini
Use this as platformio.ini:

Code: Select all

;
; PlatformIO Project Configuration File
;
; Please make sure to read documentation with examples first
; http://docs.platformio.org/en/stable/projectconf.html
;

; *********************************************************************;
; You can uncomment or add here Your favorite environment you want to work on at the moment
; (uncomment only one !)
; *********************************************************************;

[platformio]
description  = Firmware for ESP82xx/ESP32 for easy IoT deployment of sensors.
;default_envs = custom_ESP8266_4M1M, custom_ESP32_4M316k
;default_envs = dev_ESP8266_4M1M
;default_envs = normal_ESP8266_4M1M
;default_envs = test_beta_ESP8266_4M1M
; ..etc
;build_cache_dir = $PROJECT_DIR\.buildcache



; add these:
; -Werror -Wall -Wextra -pedantic -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op
;                    -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-promo -Wstrict-null-sentinel
;                    -Wstrict-overflow=5 -Wundef -Wno-unused -Wno-variadic-macros -Wno-parentheses -fdiagnostics-show-option
; thanks @chouffe103
[compiler_warnings]
build_flags = -Wall -Wno-parentheses -fdiagnostics-show-option


[minimal_size]
build_flags = 
  -Os
  -ffunction-sections 
  -fdata-sections
  -Wl,--gc-sections
  -s


[espota]
upload_protocol = espota
; each flag in a new line
; Do not use port 8266 for OTA, since that's used for ESPeasy p2p
upload_flags_esp8266 = 
  --port=18266
upload_flags_esp32 =
  --port=3232
build_flags = -DFEATURE_ARDUINO_OTA
upload_port = 192.168.1.152



[debug_flags]
build_flags               = 

[mqtt_flags]
build_flags               = -DMQTT_MAX_PACKET_SIZE=1024


[common]
lib_ldf_mode              = chain
lib_archive               = false
framework                 = arduino
upload_speed              = 115200
monitor_speed             = 115200
;targets                   = size, checkprogsize
targets                   =
extra_scripts             = pre:pre_default_check.py


[env]
extends                   = common


; *********************************************************************

; **** Definition cheat sheet:
; board_build.flash_mode in terms of performance: QIO > QOUT > DIO > DOUT
; for lib_ldf_mode, see http://docs.platformio.org/en/latest/librarymanager/ldf.html;ldf

; **** Frequently used build flags:
; Use custom.h file to override default settings for ESPeasy: -D USE_CUSTOM_H
; Set VCC mode to measure Vcc of ESP chip :                   -D FEATURE_ADC_VCC=true

; Build Flags:
;  -DUSE_CONFIG_OVERRIDE
; lwIP 1.4 (Default)
;  -DPIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH
; lwIP 2 - Low Memory
;  -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
; lwIP 2 - Higher Bandwitdh
;  -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH
; VTABLES in Flash (default)
;  -DVTABLES_IN_FLASH
; VTABLES in Heap
;  -DVTABLES_IN_DRAM
; VTABLES in IRAM
;  -DVTABLES_IN_IRAM
; NO_EXTRA_4K_HEAP - this forces the default NONOS-SDK user's heap location
;     Default currently overlaps cont stack (Arduino) with sys stack (System)
;     to save up-to 4 kB of heap. (starting core_2.4.2)
; ESP8266_DISABLE_EXTRA4K  - Calls disable_extra4k_at_link_time() from setup
;                            to force the linker keep user's stack in user ram.
; CONT_STACKSIZE to set the 'cont' (Arduino) stack size. Default = 4096
; -mtarget-align  see: https://github.com/arendst/Sonoff-Tasmota/issues/3678#issuecomment-419712437

[esp82xx_defaults]
build_flags               = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"'
                            -D NDEBUG
                            -lstdc++ -lsupc++
                            -mtarget-align
                            -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
                            -DVTABLES_IN_FLASH
                            -DPUYA_SUPPORT=1

[esp82xx_2_5_x]
build_flags               = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"'
                            -DNDEBUG
                            -mtarget-align
                            -DVTABLES_IN_FLASH
                            -fno-exceptions
                            -lstdc++
                            -DPIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY_LOW_FLASH
                            -DPUYA_SUPPORT=1
                            -DCORE_POST_2_5_0

[esp82xx_2_6_x]
build_flags               = ${esp82xx_2_5_x.build_flags} 
                            -O2
                            -DBEARSSL_SSL_BASIC
                            -DCORE_POST_2_6_0 


;[core_2_3_0]
;platform                  = https://github.com/TD-er/platform-espressif8266.git#patch/v1.5.0_Puya
;build_flags               = -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"'
;                            -DNDEBUG
;                            -DVTABLES_IN_FLASH
;                            -fno-exceptions
;                            -DPUYA_SUPPORT=1
;                            -DARDUINO_ESP8266_RELEASE_2_3_0
;                            -DFORCE_PRE_2_5_0
;lib_ignore                = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR

;[core_2_4_0]
;platform                  = https://github.com/TD-er/platform-espressif8266.git#patch/v1.6.0_Puya
;build_flags               = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_0 -DFORCE_PRE_2_5_0
;lib_ignore                = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR

;[core_2_4_1]
;platform                  = https://github.com/TD-er/platform-espressif8266.git#patch/v1.7.3_Puya
;build_flags               = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_1 -DFORCE_PRE_2_5_0
;lib_ignore                = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR


[core_2_4_2]
platform                  = https://github.com/TD-er/platform-espressif8266.git#patch/v1.8.0_Puya
build_flags               = ${esp82xx_defaults.build_flags} -DARDUINO_ESP8266_RELEASE_2_4_2 -DFORCE_PRE_2_5_0
lib_ignore                = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR

;[core_2_5_0]
;platform                  = espressif8266@2.0.4
;build_flags               = ${esp82xx_2_5_x.build_flags}

;[core_2_5_2]
;platform                  = espressif8266@2.2.3
;build_flags               = ${esp82xx_2_5_x.build_flags}


; See for SDK flags: https://github.com/esp8266/Arduino/blob/master/tools/platformio-build.py

[core_2_6_0]
platform                  = https://github.com/Jason2866/platform-espressif8266.git#core_2_6_0
build_flags               = ${esp82xx_2_6_x.build_flags} 
                            -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190703

[core_2_6_1]
platform                  = https://github.com/Jason2866/platform-espressif8266.git#core_2_6_1
build_flags               = ${esp82xx_2_6_x.build_flags} 
                            -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_190703

[core_2_6_1_sdk3]
platform                  = https://github.com/Jason2866/platform-espressif8266.git#core_2_6_1
build_flags               = ${esp82xx_2_6_x.build_flags} 
                            -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3

[core_stage]
platform                  = https://github.com/platformio/platform-espressif8266.git#feature/stage
build_flags               = ${esp82xx_2_6_x.build_flags}
                            -DARDUINO_ESP8266_RELEASE='"2.7.0-dev stage"'
                            -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22x_191105

[core_esp32_1_11_1]
platform                  = espressif32@1.11.1

[core_esp32_stage]
platform                  = https://github.com/platformio/platform-espressif32.git#feature/stage

;;; ESP82xx base definitions*******************************************
; Basic definitions used in ESP82xx environments                      ;
; *********************************************************************



[regular_platform]
build_unflags             =
build_flags               = ${core_2_6_1.build_flags}
platform                  = ${core_2_6_1.platform}

[core261_sdk3_platform]
build_unflags             =
build_flags               = ${core_2_6_1_sdk3.build_flags}
platform                  = ${core_2_6_1_sdk3.platform}

[beta_platform]
build_unflags             =
build_flags               = ${core_stage.build_flags}
platform                  = ${core_stage.platform}



[esp82xx_common]
extends                   = common
board_build.f_cpu         = 80000000L
build_flags               = ${debug_flags.build_flags} ${mqtt_flags.build_flags} -DHTTPCLIENT_1_1_COMPATIBLE=0
build_unflags             = -DDEBUG_ESP_PORT
lib_deps                  = https://github.com/TD-er/ESPEasySerial.git
lib_ignore                = ESP32_ping, ESP32WebServer, IRremoteESP8266, HeatpumpIR, SD(esp8266), SDFS
board                     = esp12e



;;; NORMAL (STABLE) ***************************************************
; normal version with stable plugins                                  ;
; *********************************************************************

[normal]
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags}

[normal_beta]
platform                  = ${beta_platform.platform}
build_flags               = ${beta_platform.build_flags}


;;; TEST  *************************************************************
; additional plugins (and dependend code) that is marked as TESTING   ;
; Includes "normal" + "testing" plugins                               ;
; *********************************************************************

[testing]
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags} -DPLUGIN_BUILD_TESTING

[testing_beta]
platform                  = ${beta_platform.platform}
build_flags               = ${beta_platform.build_flags} -DPLUGIN_BUILD_TESTING


;;; DEV  **************************************************************
; additional plugins (and dependend code) that is in development      ;
; (probably broken or incomplete)                                     ;
; *********************************************************************

[dev]
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags} -DPLUGIN_BUILD_DEV


;;; IR      ***********************************************************
; IR builds                                                           ;
; *********************************************************************

[ir]
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags}
lib_ignore                = ESP32_ping, ESP32WebServer, SD(esp8266), SDFS

[minimal_ir]
extends                   = ir
build_flags               = ${ir.build_flags} -DPLUGIN_BUILD_MINIMAL_IR

[minimal_ir_extended]
extends                   = ir
build_flags               = ${ir.build_flags} -DPLUGIN_BUILD_MINIMAL_IRext

[normal_ir]
extends                   = ir
build_flags               = ${ir.build_flags} -DPLUGIN_BUILD_NORMAL_IR

[normal_ir_extended]
extends                   = ir
build_flags               = ${ir.build_flags} -DPLUGIN_BUILD_IR_EXTENDED

[normal_ir_extended_no_rx]
extends                   = ir
build_flags               = ${ir.build_flags} -DPLUGIN_BUILD_IR_EXTENDED_NO_RX



;;; 1MB flash nodes  **************************************************
; Layout for 1M flash nodes                                           ;
; *********************************************************************
[esp82xx_1M]
extends                   = esp82xx_common
board_build.flash_mode    = dout
board_upload.maximum_size = 786432
build_flags               = -Wl,-Tesp8266.flash.1m128.ld 
                            -DSIZE_1M 
                            -DBUILD_NO_DEBUG
                            ${esp82xx_common.build_flags}

[esp8266_1M]
extends                   = esp82xx_1M
board                     = esp01_1m

[esp8285_1M]
extends                   = esp82xx_1M
board                     = esp8285
build_flags               = ${esp8266_1M.build_flags} -DESP8285


;;; Minimal ***********************************************************
; Minimal build size for OTA                                          ;
; *********************************************************************
[esp82xx_1M_OTA]
extends                   = esp82xx_common
board_build.flash_mode    = dout
board_upload.maximum_size = 616448
build_flags               = ${esp82xx_1M.build_flags} -DPLUGIN_BUILD_MINIMAL_OTA


[esp8266_1M_OTA]
extends                   = esp82xx_1M_OTA
board                     = esp01_1m

[esp8285_1M_OTA]
extends                   = esp82xx_1M_OTA
board                     = esp8285
build_flags               = ${esp82xx_1M_OTA.build_flags} -DESP8285


;;; 2MB flash nodes  **************************************************
; Layout for 2M flash nodes                                           ;
; *********************************************************************

[esp8266_2M256]
extends                   = esp82xx_common
board                     = esp12e
board_build.flash_mode    = dio
board_upload.maximum_size = 1044464
build_flags               = -Wl,-Tesp8266.flash.2m256.ld
                            ${esp82xx_common.build_flags}

[espWroom2M]
extends                   = esp82xx_common
board                     = esp12e
board_build.flash_mode    = dio
board_upload.maximum_size = 1044464
build_flags               = -Wl,-Tesp8266.flash.2m.ld
                            ${esp82xx_common.build_flags}

[espWroom2M256]
extends                   = esp82xx_common
board_build.flash_mode    = dout
board_upload.maximum_size = 1044464
board                     = esp_wroom_02
build_flags               = -Wl,-Tesp8266.flash.2m256.ld
                            ${esp82xx_common.build_flags}


;;; 4MB flash nodes  **************************************************
; Layout for 4M flash nodes                                           ;
; *********************************************************************

[esp8266_4M1M]
extends                   = esp82xx_common
board                     = esp12e
board_build.flash_mode    = dio
board_upload.maximum_size = 1044464
build_flags               = -Wl,-Tesp8266.flash.4m1m.ld
                            ${esp82xx_common.build_flags}

[esp8266_4M2M]
extends                   = esp82xx_common
board                     = esp12e
board_build.flash_mode    = dio
board_upload.maximum_size = 1044464
build_flags               = -Wl,-Tesp8266.flash.4m2m.ld
                            ${esp82xx_common.build_flags}



;;; 16MB flash nodes  *************************************************
; Layout for 16M flash nodes                                          ;
; *********************************************************************

; Configuration for the Wemos D1 mini pro (16M)
; This configuration can only be used with core versions 2.5.0 or newer.
; Performance of 14M SPIFFS is really slow.
; See https://github.com/esp8266/Arduino/issues/5932
[esp8266_16M]
extends                   = esp82xx_common
board                     = esp12e
board_build.flash_mode    = dio
board_upload.maximum_size = 1044464
build_flags               = -Wl,-Tesp8266.flash.16m14m.ld 
                            -DSPIFFS_MAX_OPEN_FILES=20
                            ${esp82xx_common.build_flags}

;;; Custom builds *****************************************************
; Use either the plugins defined in                                   ;
; pre_custom_esp82xx.py or Custom.h                                   ;
; *********************************************************************


[hard_esp82xx]
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags}
                            -DBUILD_NO_DEBUG
                            -DPLUGIN_BUILD_CUSTOM


; Custom: 4M1M version --------------------------
[env:custom_ESP8266_4M1M]
extends                   = esp8266_4M1M
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags} 
                            ${esp8266_4M1M.build_flags} 
                            -DPLUGIN_BUILD_CUSTOM
lib_ignore                = ESP32_ping, ESP32WebServer
extra_scripts             = pre:pre_custom_esp82xx.py


[env:custom_sdk3_ESP8266_4M1M]
extends                   = esp8266_4M1M
platform                  = ${core261_sdk3_platform.platform}
build_flags               = ${core261_sdk3_platform.build_flags}
                            ${esp8266_4M1M.build_flags} 
                            -DPLUGIN_BUILD_CUSTOM
lib_ignore                = ESP32_ping, ESP32WebServer
extra_scripts             = pre:pre_custom_esp82xx.py


[env:custom_beta_ESP8266_4M1M]
extends                   = esp8266_4M1M
platform                  = ${beta_platform.platform}
build_flags               = ${beta_platform.build_flags}
                            ${esp8266_4M1M.build_flags}
                            -DPLUGIN_BUILD_CUSTOM
lib_ignore                = ESP32_ping, ESP32WebServer
extra_scripts             = pre:pre_custom_esp82xx.py


; Custom: 4M2M version --------------------------
[env:custom_ESP8266_4M2M]
extends                   = esp8266_4M2M
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags}
                            ${esp8266_4M1M.build_flags}
                            -DPLUGIN_BUILD_CUSTOM
lib_ignore                = ESP32_ping, ESP32WebServer
extra_scripts             = pre:pre_custom_esp82xx.py




;;; NORMAL (STABLE) ***************************************************
; normal version with stable plugins                                  ;
; *********************************************************************

; NORMAL: 1024k version --------------------------
[env:normal_ESP8266_1M]
extends                   = esp8266_1M
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags}
                            ${esp8266_1M.build_flags}


[env:normal_sdk3_ESP8266_1M]
extends                   = esp8266_1M
platform                  = ${core261_sdk3_platform.platform}
build_flags               = ${core261_sdk3_platform.build_flags}
                            ${esp8266_1M.build_flags}


[env:normal_ESP8266_1M_VCC]
extends                   = esp8266_1M
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags}
                            ${esp8266_1M.build_flags}
                            -D FEATURE_ADC_VCC=true


; NORMAL: 1024k for esp8285 ----------------------
[env:normal_ESP8285_1M]
extends                   = esp8285_1M
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags}
                            ${esp8285_1M.build_flags}


; NORMAL: 2048k WROOM02 version --------------------------
[env:normal_WROOM02_2M]
extends                   = espWroom2M
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags}
                            ${espWroom2M.build_flags}


; NORMAL: 2048k WROOM02 version 256k SPIFFS --------------------------
[env:normal_WROOM02_2M256]
extends                   = espWroom2M256
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags}
                            ${espWroom2M256.build_flags}


; NORMAL: 4096k version --------------------------
[env:normal_ESP8266_4M1M]
extends                   = esp8266_4M1M
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags}
                            ${esp8266_4M1M.build_flags}

; NORMAL: 16M version --------------------------
[env:normal_ESP8266_16M]
extends                   = esp8266_16M
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags}
                            ${esp8266_16M.build_flags}


;;; Minimal ***********************************************************
; Minimal build size for OTA                                          ;
; *********************************************************************

[env:minimal_core_242_ESP8266_1M_OTA]
extends                   = esp8266_1M_OTA
platform                  = ${core_2_4_2.platform}
build_flags               = ${core_2_4_2.build_flags}
                            ${esp8266_1M_OTA.build_flags}

[env:minimal_core_242_ESP8285_1M_OTA]
extends                   = esp8285_1M_OTA
platform                  = ${core_2_4_2.platform}
build_flags               = ${core_2_4_2.build_flags}
                            ${esp8285_1M_OTA.build_flags}

[env:minimal_core_261_ESP8266_1M_OTA]
extends                   = esp8266_1M_OTA
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags} 
                            ${esp8266_1M_OTA.build_flags}

[env:minimal_core_261_ESP8285_1M_OTA]
extends                   = esp8285_1M_OTA
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags} 
                            ${esp8285_1M_OTA.build_flags}

[env:minimal_core_261_sdk3_ESP8266_1M_OTA]
extends                   = esp8266_1M_OTA
platform                  = ${core261_sdk3_platform.platform}
build_flags               = ${core261_sdk3_platform.build_flags} 
                            ${esp8266_1M_OTA.build_flags}

[env:minimal_core_261_sdk3_ESP8285_1M_OTA]
extends                   = esp8285_1M_OTA
platform                  = ${core261_sdk3_platform.platform}
build_flags               = ${core261_sdk3_platform.build_flags} 
                            ${esp8285_1M_OTA.build_flags}



;;; IR      ***********************************************************
; IR builds                                                           ;
; *********************************************************************


; Minimal IR: 1024k version --------------------------
; Build including IR libraries, including extended AC commands
; Minimal set of other plugins
[env:minimal_IRext_ESP8266_1M]
extends                   = esp8266_1M
platform                  = ${minimal_ir_extended.platform}
lib_ignore                = ${minimal_ir_extended.lib_ignore}  
build_flags               = ${minimal_ir_extended.build_flags} 
                            ${esp8266_1M.build_flags}
build_unflags             = ${esp8266_1M_OTA.build_unflags} -DPLUGIN_BUILD_NORMAL_IR


; Minimal IR: 4096k version --------------------------
; Build including IR libraries, INCLUDING extended AC commands
; Includes Extended IR AC commands (takes a lot more program space)
; 4M flash, 1M SPIFFS
[env:minimal_IRext_ESP8266_4M1M]
extends                   = esp8266_4M1M
platform                  = ${minimal_ir_extended.platform} 
lib_ignore                = ${minimal_ir_extended.lib_ignore}
build_flags               = ${minimal_ir_extended.build_flags} 
                            ${esp8266_4M1M.build_flags}

; 4M flash, 2M SPIFFS
[env:minimal_IRext_ESP8266_4M2M]
extends                   = esp8266_4M2M
platform                  = ${minimal_ir_extended.platform} 
lib_ignore                = ${minimal_ir_extended.lib_ignore}
build_flags               = ${minimal_ir_extended.build_flags}
                            ${esp8266_4M2M.build_flags}


; NORMAL IR: 4096k version --------------------------
; Build including IR libraries, INCLUDING extended AC commands
; Includes Extended IR AC commands (takes a lot more program space)
; 4M flash, 2M SPIFFS
[env:normal_IRext_no_rx_ESP8266_4M2M]
extends                   = esp8266_4M2M
platform                  = ${normal_ir_extended_no_rx.platform} 
lib_ignore                = ${normal_ir_extended_no_rx.lib_ignore}
build_flags               = ${normal_ir_extended_no_rx.build_flags}
                            ${esp8266_4M2M.build_flags}



;;; TEST  *************************************************************
; additional plugins (and dependend code) that is marked as TESTING   ;
; Includes "normal" + "testing" plugins                               ;
; *********************************************************************


; TEST: 4096k version + FEATURE_ADC_VCC ----------
[env:test_ESP8266_4M_VCC]
extends                   = esp8266_4M1M
platform                  = ${testing.platform}
build_flags               = ${testing.build_flags}
                            ${esp8266_4M1M.build_flags}
                            -D FEATURE_ADC_VCC=true


[env:test_beta_ESP8266_4M1M]
extends                   = esp8266_4M1M
platform                  = ${testing_beta.platform}
build_flags               = ${testing_beta.build_flags}
                            ${esp8266_4M1M.build_flags}


[env:test_beta_ESP8266_16M]
extends                   = esp8266_16M
platform                  = ${testing_beta.platform}
build_flags               = ${testing_beta.build_flags}
                            ${esp8266_16M.build_flags} 
                            -DPIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK22y







;;; DEV  **************************************************************
; additional plugins (and dependend code) that is in development      ;
; (probably broken or incomplete)                                     ;
; *********************************************************************

; DEV : 4096k version ----------------------------
[env:dev_ESP8266_4M1M]
extends                   = esp8266_4M1M
platform                  = ${dev.platform}
build_flags               = ${dev.build_flags} 
                            ${esp8266_4M1M.build_flags}



;;; HARDWARE SPECIFIC VERSIONS ***********************************************************
; versions specially designed to fit, and contents only needed plugins for each hardware ;
; ****************************************************************************************

; ITEAD Products

; ITEAD / SONOFF BASIC version ------------------
;[env:hard_SONOFF_BASIC]
;extends                   = esp8266_1M, hard_esp82xx
;platform                  = ${hard_esp82xx.platform}
;build_flags               = ${hard_esp82xx.build_flags} ${esp8266_1M.build_flags} -D PLUGIN_SET_SONOFF_BASIC


; ITEAD / SONOFF TH10/TH16 version -------------------
;[env:hard_SONOFF_TH1x]
;extends                   = esp8266_1M, hard_esp82xx
;platform                  = ${hard_esp82xx.platform}
;build_flags               = ${hard_esp82xx.build_flags} ${esp8266_1M.build_flags} -D PLUGIN_SET_SONOFF_TH1x

; ITEAD / SONOFF POW & POW R2 version --------------------
; Sonoff Pow (ESP8266 - HLW8012)
; GPIO00 Button
; GPIO05 HLW8012 Sel output
; GPIO12 Red Led and Relay (0 = Off, 1 = On)
; GPIO13 HLW8012 CF1 voltage / current
; GPIO14 HLW8012 CF power
; GPIO15 Blue Led (0 = On, 1 = Off)

; Sonoff Pow R2 (ESP8266 4M flash - CSE7766)
; GPIO00 Button
; GPIO01 Serial RXD 4800 baud 8E1 CSE7766 energy sensor
; GPIO03 Serial TXD
; GPIO12 Red Led and Relay (0 = Off, 1 = On)
; GPIO13 Blue Led (0 = On, 1 = Off)
[env:hard_SONOFF_POW_4M1M]
extends                   = esp8266_4M1M, hard_esp82xx
platform                  = ${hard_esp82xx.platform}
build_flags               = ${hard_esp82xx.build_flags} 
                            ${esp8266_4M1M.build_flags}
                            -D PLUGIN_SET_SONOFF_POW


; Build including power measurement plugins for those devices that have only 1M flash.
; For example those made by BlitzWolf SHP
[env:hard_other_POW_ESP8285_1M]
extends                   = esp8266_1M_OTA, hard_esp82xx
platform                  = ${hard_esp82xx.platform}
build_flags               = ${hard_esp82xx.build_flags} 
                            ${esp8266_1M_OTA.build_flags}
                            -D PLUGIN_SET_SONOFF_POW


; ITEAD / SONOFF S20 version --------------------
;[env:hard_SONOFF_S20]
;extends                   = esp8266_1M_OTA, hard_esp82xx
;platform                  = ${hard_esp82xx.platform}
;build_flags               = ${hard_esp82xx.build_flags} ${esp8266_1M_OTA.build_flags} -D PLUGIN_SET_SONOFF_S2x


; ITEAD / SONOFF 4CH version --------------------
;[env:hard_SONOFF_4CH]
;extends                   = esp8285_1M_OTA, hard_esp82xx
;platform                  = ${hard_esp82xx.platform}
;build_flags               = ${hard_esp82xx.build_flags} ${esp8285_1M_OTA.build_flags} -D PLUGIN_SET_SONOFF_4CH



; ITEAD / SONOFF TOUCH version ------------------
;[env:hard_SONOFF_TOUCH]
;extends                   = esp8285_1M_OTA, hard_esp82xx
;platform                  = ${hard_esp82xx.platform}
;build_flags               = ${hard_esp82xx.build_flags} ${esp8285_1M_OTA.build_flags} -D PLUGIN_SET_SONOFF_TOUCH


; Shelly1 Open Source (ESP8266-2MB)
; https://shelly.cloud/shelly1-open-source/
; GPIO04 Relay (non inverted)
; GPIO05 Button
[env:hard_Shelly_1_2M256]
extends                   = esp8266_2M256, hard_esp82xx
platform                  = ${hard_esp82xx.platform}
build_flags               = ${hard_esp82xx.build_flags} 
                            ${esp8266_2M256.build_flags}
                            -D PLUGIN_SET_SHELLY_1

; Ventus W266 weather station
; https://www.letscontrolit.com/wiki/index.php/VentusW266
[env:hard_Ventus_W266]
extends                   = esp8266_1M, hard_esp82xx
platform                  = ${hard_esp82xx.platform}
build_flags               = ${hard_esp82xx.build_flags}
                            ${esp8266_1M_OTA.build_flags}
                            -D PLUGIN_SET_VENTUS_W266


;;; ESP32 test build ********************************************************************;
; Status of the ESP32 support is still considered "beta"                                 ;
; Most plugins work just fine on ESP32.                                                  ;
; Especially some plugins using serial may not run very well  (GPS does run fine).       ;
; ***************************************************************************************;



[esp32_common]
extends                   = common
platform                  = ${core_esp32_1_11_1.platform}
lib_ignore                = AS_BH1750, ESP8266WiFi, ESP8266Ping, ESP8266WebServer, ESP8266HTTPUpdateServer, ESP8266mDNS, IRremoteESP8266, ESPEasy_ESP8266Ping, ESP32_ping, HeatpumpIR
lib_deps                  = https://github.com/TD-er/ESPEasySerial.git
board_build.f_flash       = 80000000L
board_build.flash_mode    = dout
board_upload.maximum_size = 1900544
board_build.partitions    = esp32_partition_app1810k_spiffs316k.csv
build_unflags             = -Wall
build_flags               = ${mqtt_flags.build_flags} 
                            -D BUILD_GIT='"${sysenv.TRAVIS_TAG}"' 
                            -DCONFIG_FREERTOS_ASSERT_DISABLE
                            -DCONFIG_LWIP_ESP_GRATUITOUS_ARP
                            -DCONFIG_LWIP_GARP_TMR_INTERVAL=30



; Custom: 4096k version --------------------------
[env:custom_ESP32_4M316k]
extends                   = esp32_common
platform                  = ${esp32_common.platform}
build_flags               = ${esp32_common.build_flags}   -DPLUGIN_BUILD_CUSTOM
board                     = esp32dev
extra_scripts             = pre:pre_custom_esp32.py


[env:test_ESP32_4M316k]
extends                   = esp32_common
platform                  = ${esp32_common.platform}
build_flags               = ${esp32_common.build_flags}  -DPLUGIN_SET_TEST_ESP32
board                     = esp32dev


[env:test_ESP32-wrover-kit_4M316k]
extends                   = esp32_common
platform                  = ${esp32_common.platform}
build_flags               = ${esp32_common.build_flags}  -DPLUGIN_SET_TEST_ESP32
board                     = esp-wrover-kit
upload_protocol           = ftdi
debug_tool                = ftdi
debug_extra_cmds          = break Misc.ino:3011


;Special build environment definitions.
;These are used for analysis and debugging.
;
;!! DO NOT LOAD THESE ONTO A MODULE !!

[debug_pio]
build_type                = debug
check_tool                = clangtidy
build_flags               = ${compiler_warnings.build_flags}


[env:spec_debug_custom_ESP8266_4M1M]
extends                   = esp8266_4M1M, debug_pio
platform                  = ${regular_platform.platform}
build_flags               = ${regular_platform.build_flags}
                            ${debug_pio.build_flags}
                            ${esp8266_4M1M.build_flags}
                            -DPLUGIN_BUILD_CUSTOM
lib_ignore                = ESP32_ping, ESP32WebServer
extra_scripts             = pre:pre_custom_esp82xx.py


[env:spec_debug_beta_custom_ESP8266_4M1M]
extends                   = esp8266_4M1M, debug_pio
platform                  = ${beta_platform.platform}
build_flags               = ${beta_platform.build_flags}
                            ${debug_pio.build_flags}
                            ${esp8266_4M1M.build_flags}
                            -DPLUGIN_BUILD_CUSTOM
lib_ignore                = ESP32_ping, ESP32WebServer
extra_scripts             = pre:pre_custom_esp82xx.py


[env:spec_debug_custom_ESP32_4M316k]
extends                   = esp32_common, debug_pio
platform                  = ${esp32_common.platform}
build_flags               = ${esp32_common.build_flags} ${debug_pio.build_flags}   -DPLUGIN_BUILD_CUSTOM
board                     = esp32dev
extra_scripts             = pre:pre_custom_esp32.py



; Special env for memory analysis
; This may generate builds which cannot be run, so do not upload to a node.
; Has the same lib_ignore as the IR builds, or else those cannot be built for testing
[env:spec_memanalyze_ESP8266]
extends                   = esp8266_4M1M
platform                  = ${regular_platform.platform}
lib_ignore                = ESP32_ping, ESP32WebServer
build_flags               = ${esp8266_4M1M.build_flags} -DMEMORY_ANALYSIS -DPLUGIN_BUILD_CUSTOM -w -DUSE_NON_STANDARD_24_TASKS -DTASKS_MAX=24
extra_scripts             = pre:pre_memanalyze.py

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#35 Post by mackowiakp » 23 Nov 2019, 19:33

Works ! But I tested only normal 4M1M. Now I add two my own plugins that is FM tuner and 15 inch epaper display and remove unnecesery for me plugins to keep bin size appx 800 kB.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#36 Post by mackowiakp » 23 Nov 2019, 19:41

But I try to use original platformio.ini to compile normal 4M1M and it compile me firmware with and without my own plugins.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#37 Post by TD-er » 23 Nov 2019, 19:59

Can you be a bit more specific here?
Works ! But I tested only normal 4M1M.
But I try to use original platformio.ini to compile normal 4M1M and it compile me firmware with and without my own plugins.
Does this mean I have to concatenate all files to make it work?
Or are you now using the platformio.ini file from the old configuration from a few days ago?
And I guess you just should try to configure your own "custom" build, where you have your own Custom.h file included.
That's what it is meant to be used for, those custom builds.
The Python script I included for the custom builds (as called by platformio when building the custom build) does check for the presence of this Custom.h file.
If it does exist, it will only use the defines in that file and nothing else, so you can make the build just as you need it to be.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#38 Post by mackowiakp » 23 Nov 2019, 20:14

Does this mean I have to concatenate all files to make it work?
Or are you now using the platformio.ini file from the old configuration from a few days ago?
Nope. I use platformio.ini "as is" from file labeled "Source code (zip)" in "Assets". This file contains all platformio.ini while ESPEasy_mega-20191123.zip - not.

Look at content of Source code (zip):

Code: Select all

[maciek@Piotr ESPEasy-mega-20191123]$ ls platformio*
platformio_core_defs.ini   platformio_esp82xx_base.ini  platformio.ini
platformio_esp32_envs.ini  platformio_esp82xx_envs.ini  platformio_special_envs.ini
And ESPEasy_mega-20191123.zip

Code: Select all

[maciek@Piotr TMP]$ cd ESPEasy_mega-20191123/source/
[maciek@Piotr source]$ ls platformio*
platformio.ini
And of course, I use Custom.h but I wanted to test option "normal" "as is" taken from repo file.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#39 Post by TD-er » 23 Nov 2019, 20:54

OK, will have a look at the script generating the ZIP to see why it is missing the files.
Makes you wonder what else may be missing.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: platformio.ini problem in mega-20191122

#40 Post by TD-er » 24 Nov 2019, 16:07

Last night (quite literally) I fixed the build script to include platformio*.ini instead of only the single file in the ZIP file.
So in the next nightly build there will be more ini files included in the nightly build ZIP file.

I now also noticed you had replied before my elaborate concatenated .ini file, which I overlooked yesterday.
Sorry for the confusion about that.

mackowiakp
Normal user
Posts: 527
Joined: 07 Jun 2018, 06:47
Location: Gdynia/Poland

Re: platformio.ini problem in mega-20191122

#41 Post by mackowiakp » 24 Nov 2019, 16:23

As usual. As we say "Only this one does not make mistakes, which does nothing".

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests