Custom build error VS-code and atom

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Custom build error VS-code and atom

#1 Post by Drum » 16 Oct 2019, 14:15

I set up the atom/platformio environment yesterday, updated my local repositories and tried to build.

I received an error
Error: Invalid 'c:\GitHub\ESPEasy\platformio.ini' (project configuration file): 'While reading from 'c:\\GitHub\\ESPEasy\\platformio.ini' [line 501]: section 'env:esp32test_1M8_partition' already exists'

I tried the VS-code/platformio environment and received the same error.
Does not matter if which I try to build, I tried the first 12 just to be sure but exact same error every time. ESPEasy mega branch updated my local repository today just to be sure.

Any thoughts?

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

Re: Custom build error VS-code and atom

#2 Post by TD-er » 16 Oct 2019, 14:37

Yep that was due to a merge error on my side.
I will fix it.
For now you can delete one of both occurrences of that section in the platform.ini file.

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Custom build error VS-code and atom

#3 Post by Drum » 16 Oct 2019, 17:08

I commented out the section, at line 501 then ran into another error:

I will : 'charmap' codec can't encode characters in position 1665437-1665438: character maps to <undefined>:
File "C:\Users\dum\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 126:
env.SConscript("$BUILD_SCRIPT")

with a long list of platformio files ending in .py.

I will try it in linux and see if that changes anything.

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

Re: Custom build error VS-code and atom

#4 Post by TD-er » 16 Oct 2019, 17:42

That's exact the error I also encountered.
Python 3.8 (and probably 3.7.x also) in Windows does yield these errors.
Install Python 2.7.16 and it does work again.

See: https://github.com/platformio/platformi ... -542576734
You may need to uninstall Python 3.8 first before installing 2.7.
PlatformIO must no longer see the configured Python version to make it easy to change the used Python interpreter.

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Custom build error VS-code and atom

#5 Post by Drum » 17 Oct 2019, 14:31

I uninstalled all versions of python, rebooted and installed 2.7.16. Either VScode or Platformin installed Python 3.7.4 and I get the same errors. I even installed the Python extension for VSCode (supposed to allow selection of python version) and I get the same error as well as a conflict with extensions which it does not explain well.

Tried on Linux Mint (same machine - dual boot) and ran into a different error which prevented platformio from running in VSCode. Apparently they have been working on it since last year, are "unable to duplicate" and have a work around which is not explained well enough for me to understand what I need to do.

After lunch I will try on another Linux machine after lunch and see if I can get it to work..

So far I am not thrilled with the VSCode/platformio platform. It is really pretty and has lots of bells and whistles but it relies on a lot of remote servers rather than being able to download a package and go. Despite living less than 5km from a city with fiber internet, the best I can get is Mobile internet which is unreliable (especially when school gets out) and I only get 75GB/month between 2 sims.. Also I have had a few problems over the years using Microsoft's free products. They tend to kill them when they start costing too much and they can not monetize, as well as recent quality issues with multiple products...

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Custom build error VS-code and atom

#6 Post by Drum » 17 Oct 2019, 15:06

I tried another Linux machine and "Error: Could not create PIO Core virtual environment" with a link to bad instructions on how to create it manually.

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Custom build error VS-code and atom

#7 Post by Drum » 17 Oct 2019, 15:58

Okay, I started with a clean Windows 10 install,downloaded esp-easy from github, installed VSCore then installed the extensions, opened the folder for esp-easy and platformio does not recognize esp-eazy at all. Can edit files but no build options anywhere. :(

I have reached my frustration (and data) cap for a while. let me know when there is a reliable solution for building.

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

Re: Custom build error VS-code and atom

#8 Post by TD-er » 17 Oct 2019, 16:09

As soon as the linked issue with PlatformIO is done, I will try to create a how-to of how you should use PlatformIO.

One last tip you can try without using extra bandwidth is to make sure the "workspace folder" you open in VS code is the one containing platformio.ini.
So the file platformio.ini is in the "root" of your workspace folder in VScode.
Do not move the file, but just open the folder which has this file it it.

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Custom build error VS-code and atom

#9 Post by Drum » 17 Oct 2019, 16:34

Okay, somehow in the unzip it added another nested folder, fixed. I get the build options. Clicked build and it downloads athe tool chain and all the other packages, including Python 3.7.4 and I get the errors again.

I checked and it did not have python 3.7.4 installed before I clicked build. Is there something which is requiring python 3.7.4?

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

Re: Custom build error VS-code and atom

#10 Post by TD-er » 17 Oct 2019, 17:05

PlatformIO is using Python.
And I can imagine it will install 3.7.x or even 3.8.0 when there is no Python install found.
The error you get is somewhat about character encoding being undefined?

If so, then you can delete the comment on line 66 of _P052_SenseAir.ino

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Custom build error VS-code and atom

#11 Post by Drum » 17 Oct 2019, 17:17

IN the bottom left corner it lists the version of Python (if you have python extensions installed) it shows 2.7.16 and 3.7.4 (twice).
I tried selecting 2.7 did not work.
This time it did not get that far, all the errors are because I do not have Git installed on this machine.....

Maybe this should be added to the "Read the docs" page.

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

Re: Custom build error VS-code and atom

#12 Post by TD-er » 17 Oct 2019, 17:39

Like I said, I will later this week make a complete step-by-step howto on how to build using PlatformIO.

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Custom build error VS-code and atom

#13 Post by Drum » 17 Oct 2019, 18:13

Okay, it worked that time, after installing git, downloading the repository again and modifying the problem files it completed the build. I will have to test and see if it works,. There are still some issues with platformio but it is building.

Now I need to get it working on a computer with a monitor as the one it is working on is my ultra light work travel laptop with a 11 inch screen....

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Custom build error VS-code and atom

#14 Post by Drum » 17 Oct 2019, 22:03

TD-er,
I figured out the problem I was having with Python. You have to install 2.7.26 and add it to the path then install VSCode and platformio. For some reason the standard install does not add python to the path so platformio does not "see" it.

The only issues I can identify with the readthedocs page with regard to Windows install are
Add:
Install python 2.7.16 and add to Windows Path
Install git and clone repository

Remove C/C++ from extensions to be installed, it is automatic when you install platformio.

I will see if I can figure out what is going on with Linux Mint

Thank you for your help,

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

Re: Custom build error VS-code and atom

#15 Post by TD-er » 17 Oct 2019, 23:08

Did you check the "set path" option in the installer like described here: https://docs.platformio.org/en/latest/f ... all-python

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Custom build error VS-code and atom

#16 Post by Drum » 18 Oct 2019, 00:29

I just uninstalled and reinstalled Python 2.7.16 to verify and it does not have the option to set path in the installer.
I do remember selecting that option on one of the many tries and it had the same error.

I have it working on Linux now, and it is building as long as I do not build env:normal_ESP8266_1M_VCC It fails with lots of errors.

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

Re: Custom build error VS-code and atom

#17 Post by TD-er » 18 Oct 2019, 09:40

Drum wrote: 18 Oct 2019, 00:29 I just uninstalled and reinstalled Python 2.7.16 to verify and it does not have the option to set path in the installer.
I do remember selecting that option on one of the many tries and it had the same error.

I have it working on Linux now, and it is building as long as I do not build env:normal_ESP8266_1M_VCC It fails with lots of errors.
I just tested the Python 2.7.xxx install and indeed it does not have that checkbox.
Python 3.8.0 installer does have it.

Even more reason to let the people from PlatformIO fix the Python3 issue (although I do now have a work-around if needed, but it may be broken again in the future if it is not fixed)

Can you give some of the build errors with that 1M_VCC build?
Or is it "just" that it will not fit in the sketch size?

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Custom build error VS-code and atom

#18 Post by Drum » 18 Oct 2019, 12:47

Interesting, last night it failed, today it completes with warnings (I think that is what the yellow ones are)

My mistake apparenntly it was the env:test_ESP8266_4M_VCC I tried as that one fails with the errors I remember. See below:

Code: Select all

*** [.pio/build/test_ESP8266_4M_VCC/lib6ae] /home/drum/ESPEasy/.pio/build/test_ESP8266_4M_VCC/lib6ae: No such file or directory
Assembler messages:
Fatal error: can't create .pio/build/test_ESP8266_4M_VCC/liba85/ESP8266mDNS/ESP8266mDNS_Legacy.cpp.o: No such file or directory
*** [.pio/build/test_ESP8266_4M_VCC/liba85/ESP8266mDNS/ESP8266mDNS_Legacy.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio/build/test_ESP8266_4M_VCC/libeed/Wire/Wire.cpp.o: No such file or directory
*** [.pio/build/test_ESP8266_4M_VCC/libeed/Wire/Wire.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio/build/test_ESP8266_4M_VCC/liba85/ESP8266mDNS/LEAmDNS_Control.cpp.o: No such file or directory
*** [.pio/build/test_ESP8266_4M_VCC/liba85/ESP8266mDNS/LEAmDNS_Control.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio/build/test_ESP8266_4M_VCC/liba85/ESP8266mDNS/LEAmDNS_Structs.cpp.o: No such file or directory
*** [.pio/build/test_ESP8266_4M_VCC/liba85/ESP8266mDNS/LEAmDNS_Structs.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio/build/test_ESP8266_4M_VCC/liba85/ESP8266mDNS/LEAmDNS_Helpers.cpp.o: No such file or directory
*** [.pio/build/test_ESP8266_4M_VCC/liba85/ESP8266mDNS/LEAmDNS_Helpers.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio/build/test_ESP8266_4M_VCC/liba85/ESP8266mDNS/LEAmDNS.cpp.o: No such file or directory
*** [.pio/build/test_ESP8266_4M_VCC/liba85/ESP8266mDNS/LEAmDNS.cpp.o] Error 1
Assembler messages:
Fatal error: can't create .pio/build/test_ESP8266_4M_VCC/liba85/ESP8266mDNS/LEAmDNS_Transfer.cpp.o: No such file or directory
*** [.pio/build/test_ESP8266_4M_VCC/liba85/ESP8266mDNS/LEAmDNS_Transfer.cpp.o] Error 1
FileNotFoundError: [Errno 2] No such file or directory: '/home/drum/ESPEasy/.pio/build/.sconsign3.dblite':
  File "/home/drum/.platformio/packages/tool-scons/script/../engine/SCons/Script/Main.py", line 1374:
    _exec_main(parser, values)
  File "/home/drum/.platformio/packages/tool-scons/script/../engine/SCons/Script/Main.py", line 1337:
    _main(parser)
  File "/home/drum/.platformio/packages/tool-scons/script/../engine/SCons/Script/Main.py", line 1112:
    nodes = _build_targets(fs, options, targets, target_top)
  File "/home/drum/.platformio/packages/tool-scons/script/../engine/SCons/Script/Main.py", line 1311:
    jobs.run(postfunc = jobs_postfunc)
  File "/home/drum/.platformio/packages/tool-scons/script/../engine/SCons/Job.py", line 113:
    postfunc()
  File "/home/drum/.platformio/packages/tool-scons/script/../engine/SCons/Script/Main.py", line 1308:
    SCons.SConsign.write()
  File "/home/drum/.platformio/packages/tool-scons/script/../engine/SCons/SConsign.py", line 117:
    syncmethod()
  File "/home/drum/.platformio/packages/tool-scons/script/../engine/SCons/dblite.py", line 161:
    self._os_unlink(self._file_name)
Exception ignored in: <bound method dblite.__del__ of <SCons.dblite.dblite object at 0x7f2726f9d470>>
Traceback (most recent call last):
  File "/home/drum/.platformio/packages/tool-scons/script/../engine/SCons/dblite.py", line 143, in __del__
  File "/home/drum/.platformio/packages/tool-scons/script/../engine/SCons/dblite.py", line 140, in close
  File "/home/drum/.platformio/packages/tool-scons/script/../engine/SCons/dblite.py", line 161, in sync
FileNotFoundError: [Errno 2] No such file or directory: '/home/drum/ESPEasy/.pio/build/.sconsign3.dblite'

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

Re: Custom build error VS-code and atom

#19 Post by TD-er » 18 Oct 2019, 13:14

Those build errors, do you get them with the unmodified source from the GitHub repo?
Are you sure you do not have a lock on the build directory (e.g. open file in some editor, terminal in the directory, etc) ?

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Custom build error VS-code and atom

#20 Post by Drum » 18 Oct 2019, 13:44

The only modifications I have made are to platformio.py to comment out the duplicated ESP32 section at line 501.
Other than that I can not see anything open that would affect those directories. It is really weird because the same without VCC worked no problem.
I just ran it again and I get different errors.

/home/drum/ESPEasy/src/_P089_Ping.ino: In function 'boolean Plugin_089(byte, EventStruct*, String&)':
/home/drum/ESPEasy/src/_P089_Ping.ino:215:53: error: 'getTaskIndexByName' was not declared in this scope
int8_t taskIndex = getTaskIndexByName(taskName);
^
/home/drum/ESPEasy/src/_P089_Ping.ino: In function 'uint8_t PingReceiver(void*, raw_pcb*, pbuf*, const ip_addr_t*)':
/home/drum/ESPEasy/src/_P089_Ping.ino:260:35: error: 'getPluginId' was not declared in this scope
int plugin = getPluginId(index);

Okay, I tried the env:test_core_260_sdk3_alpha_ESP8266_4M1M and on the FIRST BUILD I received the same errors as in my previous message and on the SECOND BUILD I received the errors above in this message. I did not change anything other than scrolling through the terminal window in platformio to read the errors. No idea why.

I am sure it is there and I am just not seeing it, but when it says 4M is that MB or Mb. I assumed it was MB until I saw one with 16M

Thanks

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

Re: Custom build error VS-code and atom

#21 Post by TD-er » 18 Oct 2019, 16:02

Ah P089 is one of the last merged ones so there may be an issue with that one.
Can you open an issue for it at Github, so I won't forget fixing it before the next new nightly build?

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: Custom build error VS-code and atom

#22 Post by Drum » 18 Oct 2019, 16:36

Issue opened... I understand the need but I started to have flashbacks of completing Italian Government forms...

By the way, I tried the build on the windows install and I had the same problem. The first build failed sooner with what appeared to be permission errors, see below. They do not show up on the second build of the same env.

Code: Select all

Cloning into 'c:\Users\Drum\Documents\GitHub\ESPEasy\.pio\libdeps\test_core_260_sdk3_alpha_ESP8266_4M1M\_tmp_installing-5k3pztmz-package'...
PermissionError: [WinError 5] Access is denied: 'c:\\Users\\Drum\\Documents\\GitHub\\ESPEasy\\.pio\\libdeps\\test_core_260_sdk3_alpha_ESP8266_4M1M\\_tmp_installing-5k3pztmz-package\\.git\\objects\\47\\92ae0b2f70d6537b6d6b22e1603caca202ebd4':
  File "C:\Users\Drum\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 126:
    env.SConscript("$BUILD_SCRIPT")
  File "C:\Users\Drum\.platformio\packages\tool-scons\script\..\engine\SCons\Script\SConscript.py", line 605:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\Drum\.platformio\packages\tool-scons\script\..\engine\SCons\Script\SConscript.py", line 286:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\Drum\.platformio\platforms\espressif8266@src-d2f6a4ecb96f34425e5e701de09dc0a9\builder\main.py", line 203:
    target_elf = env.BuildProgram()
  File "C:\Users\Drum\.platformio\packages\tool-scons\script\..\engine\SCons\Environment.py", line 224:
    return self.method(*nargs, **kwargs)
  File "C:\Users\Drum\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 122:
    _build_project_deps(env)
  File "C:\Users\Drum\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 47:
    project_lib_builder = env.ConfigureProjectLibBuilder()
  File "C:\Users\Drum\.platformio\packages\tool-scons\script\..\engine\SCons\Environment.py", line 224:
    return self.method(*nargs, **kwargs)
  File "C:\Users\Drum\.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 1043:
    project.install_dependencies()
  File "C:\Users\Drum\.platformio\penv\lib\site-packages\platformio\builder\tools\piolib.py", line 878:
    lm.install(uri)
  File "C:\Users\Drum\.platformio\penv\lib\site-packages\platformio\managers\lib.py", line 359:
    force=force)
  File "C:\Users\Drum\.platformio\penv\lib\site-packages\platformio\managers\package.py", line 701:
    track=True)
  File "C:\Users\Drum\.platformio\penv\lib\site-packages\platformio\managers\package.py", line 500:
    return self._install_from_tmp_dir(_tmp_dir, requirements)
  File "C:\Users\Drum\.platformio\penv\lib\site-packages\platformio\managers\package.py", line 583:
    shutil.move(tmp_dir, pkg_dir)
  File "C:\Users\Drum\.platformio\python37\lib\shutil.py", line 578:
    rmtree(src)
  File "C:\Users\Drum\.platformio\python37\lib\shutil.py", line 516:
    return _rmtree_unsafe(path, onerror)
  File "C:\Users\Drum\.platformio\python37\lib\shutil.py", line 395:
    _rmtree_unsafe(fullname, onerror)
  File "C:\Users\Drum\.platformio\python37\lib\shutil.py", line 395:
    _rmtree_unsafe(fullname, onerror)
  File "C:\Users\Drum\.platformio\python37\lib\shutil.py", line 395:
    _rmtree_unsafe(fullname, onerror)
  File "C:\Users\Drum\.platformio\python37\lib\shutil.py", line 400:
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\Users\Drum\.platformio\python37\lib\shutil.py", line 398:
    os.unlink(fullname)

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests