PlatformIO issue

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
martinus
Normal user
Posts: 129
Joined: 15 Feb 2020, 16:57

PlatformIO issue

#1 Post by martinus » 23 Jan 2021, 09:13

Trying to switch from my (favorite) Arduino-IDE to PlatformIO. I've installed VS-Code and extension PlatformIO IDE.
And i can now compile a sample on ESP8266 and ESP32 (basic sketch)

However, compiling latest ESPEasy project seems to require 2.74 and the tool manager gives an error. No luck here.

Code: Select all

> Executing task: C:\Users\Martinus\.platformio\penv\Scripts\pio.exe run --environment normal_ESP8266_1M <
Processing normal_ESP8266_1M (platform: espressif8266@2.6.2; board: esp01_1m; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Tool Manager: Installing git+https://github.com/esp8266/Arduino.git#2.7.4
Tool Manager: Installing git+https://github.com/esp8266/Arduino.git#2.7.4
Error: Traceback (most recent call last):
  File "c:\users\Martinus\.platformio\penv\lib\site-packages\platformio\__main__.py", line 109, in main
    cli()  # pylint: disable=no-value-for-parameter
Any quick pointer to what's missing?

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

Re: PlatformIO issue

#2 Post by TD-er » 23 Jan 2021, 11:00

I have made a tutorial (sorry about the bad editing, I used Windows' own editor which didn't allow a preview and was quite unstable) on how to install PIO + VS code.
https://www.youtube.com/watch?v=ArqwMcY ... Noorlander

Maybe you missed a step somewhere?
Are you using Python 3.7 or higher?
Since PIO 5 Python 2.x is no longer supported.

martinus
Normal user
Posts: 129
Joined: 15 Feb 2020, 16:57

Re: PlatformIO issue

#3 Post by martinus » 23 Jan 2021, 15:08

Thanks for the video!

I used this generic tutorial:
https://randomnerdtutorials.com/vs-code ... 6-arduino/
But they did not mention anything about git for windows. I had github desktop installed but your video pointed out that you need "Git for windows"

After installing this, everything seems fine and compilation succeeded :D
Using custom.h now compiles to 576kB which is oke for 1M smartplugs.

I guess Arduino IDE has some issues with properly handling all includes and defines... :(

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

Re: PlatformIO issue

#4 Post by TD-er » 23 Jan 2021, 15:21

Yep, some defines need to be defined at "command line" for the compiler, which is quite hard to do in Arduino IDE.

With 574k you have stripped out a lot.

martinus
Normal user
Posts: 129
Joined: 15 Feb 2020, 16:57

Re: PlatformIO issue

#5 Post by martinus » 23 Jan 2021, 16:05

TD-er wrote: 23 Jan 2021, 15:21 With 574k you have stripped out a lot.
That was just a test without including any plugin.
After including C001,C005 and my own Smartplug plugin P240, it compiles to 599 kB.
Still ok for my 'Action' brand Smartplugs that use the ESP8285

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

Re: PlatformIO issue

#6 Post by TD-er » 23 Jan 2021, 16:24

You also experimented with a compressed 2-step OTA build, so maybe we can together have a look at it to see if we can get the intermediate build smaller so we are not limited to this 600k limit we now have.
Also maybe LittleFS may be more stable on a FS smaller than 128k. SPIFFS isn't.

martinus
Normal user
Posts: 129
Joined: 15 Feb 2020, 16:57

Re: PlatformIO issue

#7 Post by martinus » 23 Jan 2021, 16:49

TD-er wrote: 23 Jan 2021, 16:24 You also experimented with a compressed 2-step OTA build, so maybe we can together have a look at it to see if we can get the intermediate build smaller so we are not limited to this 600k limit we now have.
Yes i remember trying the gzipped version. But back then, the Arduino lib version did not include a gzip compatible bootloader (version 2.6.3 if i remember correctly).

Then i also started to experiment with other options and I'm currently using a intermediate loader that has my Wifi settings hardcoded. It does not use SPIFFS and it's compiled with an ancient 2.3.0. lib.
Size = 247 kB (versus 271 kB for the default SPIFFS enabled two-step loader)

Also tried a version with Wifi settings stored into EEPROM sector.

But ESPEasy now uses 2.7.4. right? That version uses a bootloader that should understand uploading a gzip bin.
So one should only compile the intermediate loader version with a more recente Arduino framework and that would work (?)

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

Re: PlatformIO issue

#8 Post by TD-er » 23 Jan 2021, 17:44

It should work, but it will be too large as the current version of the Arduino core does add quite a bit to the build size.

Post Reply

Who is online

Users browsing this forum: No registered users and 51 guests