What should I do to compile custom firmware?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
399310471
Normal user
Posts: 4
Joined: 14 Oct 2019, 05:36

What should I do to compile custom firmware?

#1 Post by 399310471 » 14 Oct 2019, 14:24

First of all, I am not very good at English, so the following texts are all translations. I hope everyone can understand. I am still learning how to use 8266 and how to build a custom firmware, so the questions that may be asked are rather stupid.I hope that you can help me with the solution. I will study hard and try to understand every word you say, thank you again.

I have a 8266 and I try to access 5 sensors to monitor the air quality in my home.
I have BMP280, BH1750, SDS110, WZ-S and CCS811. ESPEASY is a good platform that allows me to easily connect BMP280, BH1750 and SDS110, but WZ-S and CCS811 do not add these two plug-ins in the three versions of ESPEASY officially. I have to try to compile a custom firmware.
So, I installed ATOM according to the tutorial given by the official WIKI and installed PlatformIO in ATOM, downloaded the ZIP file package from GPEUB of ESPEASY, decompressed, tried to press F7, ATOM reported many errors.

So, I installed ATOM according to the tutorial given by the official WIKI and installed PlatformIO in ATOM, downloaded the ZIP file package from GPEUB of ESPEASY, decompressed, tried to press F7, ATOM reported many errors.
UnicodeEncodeError: 'gbk' codec can't encode character '\xe2' in position 850838: illegal multibyte sequence:



File "C:\Users\39931\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 126:
env.SConscript("$BUILD_SCRIPT")
File "C:\Users\39931\.platformio\packages\tool-scons\script\..\engine\SCons\Script\SConscript.py", line 605:
return _SConscript(self.fs, *files, **subst_kw)
File "C:\Users\39931\.platformio\packages\tool-scons\script\..\engine\SCons\Script\SConscript.py", line 286:
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
File "C:\Users\39931\.platformio\platforms\espressif8266@src-d2f6a4ecb96f34425e5e701de09dc0a9\builder\main.py", line 203:
target_elf = env.BuildProgram()
File "C:\Users\39931\.platformio\packages\tool-scons\script\..\engine\SCons\Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "C:\Users\39931\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 110:
env.BuildFrameworks(env.get("PIOFRAMEWORK"))
File "C:\Users\39931\.platformio\packages\tool-scons\script\..\engine\SCons\Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "C:\Users\39931\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 288:
env.ConvertInoToCpp()
File "C:\Users\39931\.platformio\packages\tool-scons\script\..\engine\SCons\Environment.py", line 224:
return self.method(*nargs, **kwargs)
File "C:\Users\39931\.platformio\penv\lib\site-packages\platformio\builder\tools\piomisc.py", line 198:
out_file = c.convert(ino_nodes)
File "C:\Users\39931\.platformio\penv\lib\site-packages\platformio\builder\tools\piomisc.py", line 57:
return self.process(contents)
File "C:\Users\39931\.platformio\penv\lib\site-packages\platformio\builder\tools\piomisc.py", line 80:
assert self._gcc_preprocess(contents, out_file)
File "C:\Users\39931\.platformio\penv\lib\site-packages\platformio\builder\tools\piomisc.py", line 90:
fp.write(contents)


I tried installing a different version of PYTHON (I don't know if it was caused by my PYTHON), I also tried Google search for a solution, but I didn't find a solution in the last post that raised this question in the forum. Also invalid. So I sent the question again, I hope everyone can tell me how to fix this error, need to modify those files, or add those characters. Thanks~

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

Re: What should I do to compile custom firmware?

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

Have you looked at the more recent documentation also?
https://espeasy.readthedocs.io/en/lates ... th-vs-code

399310471
Normal user
Posts: 4
Joined: 14 Oct 2019, 05:36

Re: What should I do to compile custom firmware?

#3 Post by 399310471 » 14 Oct 2019, 16:23

I checked the link and tried to understand the text above.Maybe I am a rookie
I downloaded the ZIP file, unzipped, found espeasy, ino, press F7 to find the build ESP8266 4M, received the prompt to install GIT, I received the error mentioned above after installation. Where am I doing something wrong? How do I need to proceed to the next step.

Thanks Reply

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

Re: What should I do to compile custom firmware?

#4 Post by grovkillen » 14 Oct 2019, 16:29

Do you have Python installed and added to environment PATH?
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:

399310471
Normal user
Posts: 4
Joined: 14 Oct 2019, 05:36

Re: What should I do to compile custom firmware?

#5 Post by 399310471 » 14 Oct 2019, 16:48

Yes, I installed PYTHON 2.7.16 and PYTHON 3.7.4, added the C:\Python27\Scripts directory and the C:\Python27 directory to the system environment in PATH.

399310471
Normal user
Posts: 4
Joined: 14 Oct 2019, 05:36

Re: What should I do to compile custom firmware?

#6 Post by 399310471 » 14 Oct 2019, 19:57

I tried to replace the system and installed ATOM for ubuntu. The error messages mentioned earlier were no longer displayed, but I got a new error.

Collect2 : error : ld returned 1 exit status
[.pio/build/dev_ESP8266_4M1M/firmware.elf] Error 1


This error seems to be easier to handle, but I don't know how to change it. Can someone tell me? Thank you
I tried to build ESPEASY dev_ESP8266_4M1M, and when I tried to build the test and normal versions, I didn't receive an error message.

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

Re: What should I do to compile custom firmware?

#7 Post by TD-er » 14 Oct 2019, 21:21

You don't have to install Python yourself when you install PlatformIO in Atom or VScode.
It really isn't that hard, so I really should run some clean install and take screenshots or something like that, since a lot of people are running into this.

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

Re: What should I do to compile custom firmware?

#8 Post by Drum » 16 Oct 2019, 16:52

TD-er wrote:
14 Oct 2019, 21:21
You don't have to install Python yourself when you install PlatformIO in Atom or VScode.
It really isn't that hard, so I really should run some clean install and take screenshots or something like that, since a lot of people are running into this.
Yes please! Pretty sure I should not need to edit the platformio files...

Code: Select all

UnicodeEncodeError: '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")
  File "C:\Users\dum\.platformio\packages\tool-scons\script\..\engine\SCons\Script\SConscript.py", line 605:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\dum\.platformio\packages\tool-scons\script\..\engine\SCons\Script\SConscript.py", line 286:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\dum\.platformio\platforms\espressif8266\builder\main.py", line 203:
    target_elf = env.BuildProgram()
  File "C:\Users\dum\.platformio\packages\tool-scons\script\..\engine\SCons\Environment.py", line 224:
    return self.method(*nargs, **kwargs)
  File "C:\Users\dum\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 110:
    env.BuildFrameworks(env.get("PIOFRAMEWORK"))
  File "C:\Users\dum\.platformio\packages\tool-scons\script\..\engine\SCons\Environment.py", line 224:
    return self.method(*nargs, **kwargs)
  File "C:\Users\dum\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 288:
    env.ConvertInoToCpp()
  File "C:\Users\dum\.platformio\packages\tool-scons\script\..\engine\SCons\Environment.py", line 224:
    return self.method(*nargs, **kwargs)
  File "C:\Users\dum\.platformio\penv\lib\site-packages\platformio\builder\tools\piomisc.py", line 198:
    out_file = c.convert(ino_nodes)
  File "C:\Users\dum\.platformio\penv\lib\site-packages\platformio\builder\tools\piomisc.py", line 57:
    return self.process(contents)
  File "C:\Users\dum\.platformio\penv\lib\site-packages\platformio\builder\tools\piomisc.py", line 80:
    assert self._gcc_preprocess(contents, out_file)
  File "C:\Users\dum\.platformio\penv\lib\site-packages\platformio\builder\tools\piomisc.py", line 90:
    fp.write(contents)
  File "C:\Users\dum\.platformio\python37\lib\encodings\cp1252.py", line 19:
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]

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

Re: What should I do to compile custom firmware?

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

I was trying to make a manual and promptly broke my own setup.
The guys from PlatformIO are working on the bug report right now.

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

Re: What should I do to compile custom firmware?

#10 Post by mackowiakp » 18 Oct 2019, 18:24

I also tried to use ATOM (on Linux). Always errors, editor crash etc.
After installing M$ Visual Studio all problems disappeared.
Just add the M$ VS repository to Linux - depending on Linux - in .deb or .rpm format and simply edit/compile what you need.
I dont use Windows.

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests