custom build with platformio and atom

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
hansi9990
New user
Posts: 7
Joined: 10 Mar 2022, 13:59

custom build with platformio and atom

#1 Post by hansi9990 » 31 Mar 2022, 18:09

Hi

I would like to create a custom build of ESP Easy with atom and Platformio, until a few days ago it worked without any problems,
but since a few days I've been getting error messages even though I haven't changed anything in the sources or the configuration.
This is the error message:

Code: Select all

Scanning dependencies...
Dependency Graph
Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3312.0_x64__qbz5n2kfra8p0\lib\threading.py", line 973, in _b
ootstrap_inner
    self.run()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3312.0_x64__qbz5n2kfra8p0\lib\threading.py", line 910, in ru
n
    self._target(*self._args, **self._kwargs)
  File "C:\Users\hansh\.platformio\penv\lib\site-packages\platformio\proc.py", line 48, in run
    self.do_reading()
  File "C:\Users\hansh\.platformio\penv\lib\site-packages\platformio\proc.py", line 103, in do_reading
    self.line_callback(line)
  File "C:\Users\hansh\.platformio\penv\lib\site-packages\platformio\platform\_run.py", line 146, in _on_stdout_line
    self._echo_line(line, level=1)
  File "C:\Users\hansh\.platformio\penv\lib\site-packages\platformio\platform\_run.py", line 167, in _echo_line
    click.secho(line, fg=fg, err=level > 1, nl=False)
  File "C:\Users\hansh\.platformio\penv\lib\site-packages\platformio\__main__.py", line 96, in <lambda>
    click.secho = lambda *args, **kwargs: _safe_echo(1, *args, **kwargs)
  File "C:\Users\hansh\.platformio\penv\lib\site-packages\platformio\__main__.py", line 89, in _safe_echo
    click_echo_origin[origin](*args, **kwargs)
  File "C:\Users\hansh\.platformio\penv\lib\site-packages\click\termui.py", line 637, in secho
    return echo(message, file=file, nl=nl, err=err, color=color)
  File "C:\Users\hansh\.platformio\penv\lib\site-packages\click\utils.py", line 299, in echo
    file.write(out)  # type: ignore
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3312.0_x64__qbz5n2kfra8p0\lib\encodings\cp1252.py", line 19,
 in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-2: character maps to <undefined>
Does anyone happen to know what this error means or what the problem could be?

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: custom build with platformio and atom

#2 Post by ThomasB » 31 Mar 2022, 18:44

It appears to be related to unicode. Probably broke after Platformio did an update without your knowledge. If you Google the error message you will find that there are several past complaints about the unicode problem.

And you should find some proposed solutions. Some involve editing source files to remove the offending chars.

Another solution I found involved changing the language settings in WIN10 (https://github.com/platformio/platformi ... ssues/3971). But this has some side affects, so be careful.

I suggest waiting for more feedback. Someone may have first hand experience with this problem and have suggestions.

- Thomas

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

Re: custom build with platformio and atom

#3 Post by TD-er » 31 Mar 2022, 20:55

Have you edited one of the files in the source tree?

It looks like one of the files may indeed contain some unicode character and does not have the file type (the first 4 bytes in the file) set to UTF-8 or something similar.
When opening such file in Notepad++, you can set the BOM of the file and save it again.
But then you need to know which file may have been altered.

hansi9990
New user
Posts: 7
Joined: 10 Mar 2022, 13:59

Re: custom build with platformio and atom

#4 Post by hansi9990 » 01 Apr 2022, 13:53

Thanks for the answers.

Yes, I've edited the platformio.ini, but the build had worked that way and I hadn't changed anything, the error message appeared without me having changed anything.
I also deleted the sources and checked them out again, the problem still persists.

It is also suspicious that the errors appear immediately after "Scanning dependencies...", which in my opinion indicates a problem with the dependencies and not with the actual sources.

Code: Select all

Scanning dependencies...
Dependency Graph
Exception in thread Thread-2:
Traceback (most recent call last):

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

Re: custom build with platformio and atom

#5 Post by TD-er » 01 Apr 2022, 14:14

You can try to delete the lib_deps folder, which will be fetched again by PlatformIO.

On Windows: C:\Users\gijsn\.platformio
On Linux: ~/.platformio

In this folder, you can delete:
- .cache
- packages
- platforms

In the repository folder you can have a look at the .pio folder.
Everything in there can be deleted.

Also make sure to delete any __tmpfile.cpp in the repository folder.

This may resolve quite a bit of issues.
However it may take quite some time when starting to build to fetch everything again.
I have also seen that you may need to call the build of a PIO env several times to get the build to complete as there seems to be some dependency issue which is (sometimes) done in the wrong order and then PIO is complaining about some missing scons stuff.

hansi9990
New user
Posts: 7
Joined: 10 Mar 2022, 13:59

Re: custom build with platformio and atom

#6 Post by hansi9990 » 02 Apr 2022, 15:50

I did everything as suggested, deleted lib_deps, deleted tempfiles and even if I delete the sources and check out again, the error is always the same.
I still suspect that an upgrade from platformio causes the error. Does nobody else have this problem?

I have tryed a platformio upgrade:
PlatformIO 5.3.0b1 is currently the newest version available.

Is b1 meaning Beta1?

User avatar
Ath
Normal user
Posts: 3419
Joined: 10 Jun 2018, 12:06
Location: NL

Re: custom build with platformio and atom

#7 Post by Ath » 02 Apr 2022, 17:16

According to the release page of Platform IO 5.3 is not yet released, so b1 probably means beta (nothing about that on the release page). You might want to report this as an issue you are having, and include the details of your software-setup (Atom + Platform IO + python + exact versions and other plugins used).

It could also be the combination of Atom and Platform IO, can you install VSCode and install the suggested plugins to retry the build? (both TD-er and myself use VSCode/Platform IO for development).
/Ton (PayPal.me)

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: custom build with platformio and atom

#8 Post by ThomasB » 02 Apr 2022, 18:05

It could also be the combination of Atom and Platform IO, can you install VSCode and install the suggested plugins to retry the build? (both TD-er and myself use VSCode/Platform IO for development).
+1. I also use VSCode/PlatformIO (on Win10). Currently on Core 5.2.5, which at the moment is the latest stable release.
I have tryed a platformio upgrade:
PlatformIO 5.3.0b1 is currently the newest version available.
Rather than use the beta release, I suggest going back to 5.2.5 before continuing to find a fix for the problem.

The link I provided earlier has a proposed solution that works on Win10. But read the details since it may introduce side affects.

- Thomas

hansi9990
New user
Posts: 7
Joined: 10 Mar 2022, 13:59

Re: custom build with platformio and atom

#9 Post by hansi9990 » 09 Apr 2022, 15:17

The build has been running again for a few days, I don't know why, I suspect that an update from Platformio or a library caused the problem.
In addition, I have now also switched to VSCode, in my opinion it is clearer.

User avatar
Ath
Normal user
Posts: 3419
Joined: 10 Jun 2018, 12:06
Location: NL

Re: custom build with platformio and atom

#10 Post by Ath » 09 Apr 2022, 15:39

hansi9990 wrote: 09 Apr 2022, 15:17 The build has been running again for a few days, I don't know why, I suspect that an update from Platformio or a library caused the problem.
Sometimes, Platform IO 'likes' (read: needs) to have it's caches cleared, and toolchain refreshed.
hansi9990 wrote: 09 Apr 2022, 15:17 In addition, I have now also switched to VSCode, in my opinion it is clearer.
Yay!, another developer converted :D :D :D
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests