First build

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Pi57
New user
Posts: 9
Joined: 14 May 2021, 08:32
Location: France

First build

#1 Post by Pi57 » 14 May 2021, 19:22

Hi,

I pretty new with ESPEasy. I already use it with the "normal" build. It was very cool :) working in association with Jeedom for my domotic setup.

Now I want to try to build my own version. For that I have define the default environment on platformio with my board type

Code: Select all

default_envs = normal_ESP32_4M316k
Then I have start the build. At the beginning I got some issue regarding Git, but after some search on the web I found that I have to install Git (it was not install with GitHub Desktop).

But now, I have an other issue, and I'm not able to solve it, even after some search on the web...

It seems that it's coming from Compiletime Define. You can see the log below :

Code: Select all

In file included from C:/users/pierre-yves/.platformio/packages/framework-arduinoespressif32@3.10004.210126/cores/esp32/Arduino.h:146:0,
                 from src/src/Helpers/CompiletimeDefines.h:4,
                 from src/src/Helpers/CompiletimeDefines.cpp:1:
<command-line>:0:31: error: too many decimal points in number
C:/users/pierre-yves/.platformio/packages/framework-arduinoespressif32@3.10004.210126/cores/esp32/WString.h:39:76: note: in definition of macro 'FPSTR'
 #define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
                                                                            ^
C:/users/pierre-yves/.platformio/packages/framework-arduinoespressif32@3.10004.210126/cores/esp32/WString.h:40:34: note: in expansion of macro 'PSTR'
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                  ^
src/src/Helpers/CompiletimeDefines.cpp:54:12: note: in expansion of macro 'F'
     return F(SET_BUILD_PLATFORM);
            ^
src/src/Helpers/CompiletimeDefines.cpp:54:14: note: in expansion of macro 'SET_BUILD_PLATFORM'
     return F(SET_BUILD_PLATFORM);
              ^
src/src/Helpers/CompiletimeDefines.cpp:62:32: warning: character constant too long for its type
     return F(SET_BUILD_GIT_HEAD);
                                ^
In file included from C:/users/pierre-yves/.platformio/packages/framework-arduinoespressif32@3.10004.210126/cores/esp32/Arduino.h:146:0,
                 from src/src/Helpers/CompiletimeDefines.h:4,
                 from src/src/Helpers/CompiletimeDefines.cpp:1:
src/src/Helpers/CompiletimeDefines.cpp: In function 'String get_binary_filename()':
<command-line>:0:27: error: 'ESP_Easy_mega_20210514_normal_ESP32_4M316k' was not declared in this scope
C:/users/pierre-yves/.platformio/packages/framework-arduinoespressif32@3.10004.210126/cores/esp32/WString.h:39:76: note: in definition of macro 'FPSTR'
 #define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
                                                                            ^
C:/users/pierre-yves/.platformio/packages/framework-arduinoespressif32@3.10004.210126/cores/esp32/WString.h:40:34: note: in expansion of macro 'PSTR'
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                  ^
src/src/Helpers/CompiletimeDefines.cpp:28:12: note: in expansion of macro 'F'
     return F(SET_BUILD_BINARY_FILENAME);
            ^
src/src/Helpers/CompiletimeDefines.cpp:28:14: note: in expansion of macro 'SET_BUILD_BINARY_FILENAME'
     return F(SET_BUILD_BINARY_FILENAME);
              ^
src/src/Helpers/CompiletimeDefines.cpp: In function 'String get_build_platform()':
<command-line>:0:20: error: 'Windows' was not declared in this scope
C:/users/pierre-yves/.platformio/packages/framework-arduinoespressif32@3.10004.210126/cores/esp32/WString.h:39:76: note: in definition of macro 'FPSTR'
 #define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
                                                                            ^
C:/users/pierre-yves/.platformio/packages/framework-arduinoespressif32@3.10004.210126/cores/esp32/WString.h:40:34: note: in expansion of macro 'PSTR'
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                  ^
src/src/Helpers/CompiletimeDefines.cpp:54:12: note: in expansion of macro 'F'
     return F(SET_BUILD_PLATFORM);
            ^
src/src/Helpers/CompiletimeDefines.cpp:54:14: note: in expansion of macro 'SET_BUILD_PLATFORM'
     return F(SET_BUILD_PLATFORM);
              ^
<command-line>:0:42: error: 'SP0' was not declared in this scope
C:/users/pierre-yves/.platformio/packages/framework-arduinoespressif32@3.10004.210126/cores/esp32/WString.h:39:76: note: in definition of macro 'FPSTR'
 #define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
                                                                            ^
C:/users/pierre-yves/.platformio/packages/framework-arduinoespressif32@3.10004.210126/cores/esp32/WString.h:40:34: note: in expansion of macro 'PSTR'
 #define F(string_literal) (FPSTR(PSTR(string_literal)))
                                  ^
src/src/Helpers/CompiletimeDefines.cpp:54:12: note: in expansion of macro 'F'
     return F(SET_BUILD_PLATFORM);
            ^
src/src/Helpers/CompiletimeDefines.cpp:54:14: note: in expansion of macro 'SET_BUILD_PLATFORM'
     return F(SET_BUILD_PLATFORM);
              ^
*** [.pio\build\normal_ESP32_4M316k\src\src\Helpers\CompiletimeDefines.cpp.o] Error 1
Regarding the output of python script to set the define value, I have this :

Code: Select all

 ------------------------------- 
 Compile time defines 
 File System:      SPIFFS
 PROGNAME:         ESP_Easy_mega_20210514_normal_ESP32_4M316k
 BUILD_PLATFORM:   Windows-10-10.0.19041-SP0
 GIT_HEAD:         'mega_7aced75'
 ------------------------------- 
Something strange is that my Windows version is 10.0.19042 ... (I have already try to overwrite this value with my Windows version but don't change anything)

So if someone have an idea to help me :)

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

Re: First build

#2 Post by Ath » 14 May 2021, 21:51

Have you downloaded the source as a zip file from Github or did you 'git clone' it (with or without creating a fork) to your system?
/Ton (PayPal.me)

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

Re: First build

#3 Post by TD-er » 14 May 2021, 22:05

Yep, looks like the Python code tries to create information from the current Git branch, failing miserably.
Sounds like something that may need to have some try...except code to always return something when the git branch cannot be determined.

Maybe you should try to build a "custom" build. That way you can also work with a Custom.h file (rename the Custom-sample.h file to Custom.h and edit it appropriately to what you need)

Pi57
New user
Posts: 9
Joined: 14 May 2021, 08:32
Location: France

Re: First build

#4 Post by Pi57 » 14 May 2021, 22:31

Yes I have created a Fork, then the source code was download with github desktop.

I just try to build a custom build, by using your explanation, but same result :(

As I got these information from the Python script, I think it's able to get something : Git head is not the branch ?

Code: Select all

 Compile time defines 
 File System:      SPIFFS
 PROGNAME:         ESP_Easy_mega_20210514_custom_ESP32_4M316k
 BUILD_PLATFORM:   Windows-10-10.0.19041-SP0
 GIT_HEAD:         'mega_7aced75'

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

Re: First build

#5 Post by TD-er » 14 May 2021, 22:43

Can you revert your changes in Platform.ini and just try to build it using the PIO project tast selector?
2021-05-14 22_41_38-Networking.cpp - ESPEasy - Visual Studio Code.png
2021-05-14 22_41_38-Networking.cpp - ESPEasy - Visual Studio Code.png (35.61 KiB) Viewed 6748 times

Code: Select all

 ------------------------------- 
 Compile time defines 
 File System:      SPIFFS
 PROGNAME:         ESP_Easy_mega_20210514_normal_ESP32_4M316k
 BUILD_PLATFORM:   Windows-10-10.0.19041-SP0
 GIT_HEAD:         'feature/fetchConfig_9d2aa8b'
 ------------------------------- 
 

Pi57
New user
Posts: 9
Joined: 14 May 2021, 08:32
Location: France

Re: First build

#6 Post by Pi57 » 14 May 2021, 23:01

Still the same error by this way.

I have also try with the original git clone, but no change (without fork)

On VS Code (bottom left) I have selected the branch mega, and my Python interpreter is 3.8.2 64 bits : it is right ? This is the same information display on GIT_HEAD from the python script

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

Re: First build

#7 Post by TD-er » 14 May 2021, 23:12

Hmm looks like there are some quotes missing in the Python process.

I had to fight this a lot to make it compatible with both Windows and Linux.

See this part in the file tools/pio/generate-compiletime-defines.py:

Code: Select all

# needed to wrap in a number of double quotes.
# one level for adding it to the list of defines
# another level to have the string quoted in the .cpp file
# somewhere along the line, another level is removed.
def wrap_quotes(str_value):
    if platform.system() == 'Windows':
        return "\"\"\"{}\"\"\"".format(str_value)
    else:
        return '\'\"\"\"{}\"\"\"\''.format(str_value)
Can you try to add an extra layer of quotes on the Windows section?
Or maybe add something that's causing Python to crash there or print something, just to check if we enter the 'Windows' section.

Pi57
New user
Posts: 9
Joined: 14 May 2021, 08:32
Location: France

Re: First build

#8 Post by Pi57 » 14 May 2021, 23:42

Yes the script enter in the windows section (checked with a print).

I have check to build the code for an other board : ESP8266 and it works :) I can build the "normal" and "custom" build

So that means that the python script should be ok, and the issue should come from somewhere else, maybe linked to ESP32

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

Re: First build

#9 Post by TD-er » 14 May 2021, 23:49

Or maybe try to clean the build.
You can delete te temp build dirs in .pio/build
For example my path: C:\GitHub\TD-er\ESPEasy\.pio\build

Pi57
New user
Posts: 9
Joined: 14 May 2021, 08:32
Location: France

Re: First build

#10 Post by Pi57 » 15 May 2021, 08:28

Ok temp build clear but no change.

I have try to build for some other board like sonoff and shelly, and it works ...

it seems that only ESP32 is not working. I try an other ESP32 environment (same as normal but with ETH at the end) and got an other error (if I remember I also got it with the "normal" and "custom", but don't remember how I solve it ...)

Code: Select all

Compiling .pio\build\normal_ESP32_4M316k_ETH\libf95\SparkFun_APDS-9960_Sensor_Arduino_Library\SparkFun_APDS9960.cpp.o
Compiling .pio\build\normal_ESP32_4M316k_ETH\lib705\TinyGPSPlus-1.0.2\TinyGPS++.cpp.o
Compiling .pio\build\normal_ESP32_4M316k_ETH\lib0dd\Adafruit_SGP30-1.0.5\Adafruit_SGP30.cpp.o
Compiling .pio\build\normal_ESP32_4M316k_ETH\libefe\Regexp\Regexp.cpp.o
Compiling .pio\build\normal_ESP32_4M316k_ETH\src\ESPEasy-Globals.cpp.o
*** [.pio\build\normal_ESP32_4M316k_ETH\src\ESPEasy.ino.cpp.o] G:\GitHub\letscontrolit\ESPEasy\src\ESPEasy.ino.cpp: No such file or directory

Pi57
New user
Posts: 9
Joined: 14 May 2021, 08:32
Location: France

Re: First build

#11 Post by Pi57 » 15 May 2021, 09:06

Maybe a lib version issue ?

Code: Select all

Dependency Graph
|-- <ESPeasySerial> 2.0.5+sha.80db36b
|   |-- <SC16IS752> 1.0.1
|   |   |-- <SPI> 1.0
|   |   |-- <Wire> 1.0.1
|-- <Adafruit ILI9341> 1.5.7
|   |-- <Adafruit GFX Library> 1.10.7
|   |   |-- <Adafruit BusIO> 1.7.3
|   |   |   |-- <Wire> 1.0.1
|   |   |   |-- <SPI> 1.0
|   |   |-- <Wire> 1.0.1
|   |   |-- <SPI> 1.0
|   |-- <SPI> 1.0
|-- <Adafruit GFX Library> 1.10.7
|   |-- <Adafruit BusIO> 1.7.3
|   |   |-- <Wire> 1.0.1
|   |   |-- <SPI> 1.0
|   |-- <Wire> 1.0.1
|   |-- <SPI> 1.0
|-- <LOLIN_EPD> 1.0.0
|   |-- <SPI> 1.0
|   |-- <Adafruit GFX Library> 1.10.7
|   |   |-- <Adafruit BusIO> 1.7.3
|   |   |   |-- <Wire> 1.0.1
|   |   |   |-- <SPI> 1.0
|   |   |-- <Wire> 1.0.1
|   |   |-- <SPI> 1.0
|-- <Adafruit BusIO> 1.7.3
|   |-- <Wire> 1.0.1
|   |-- <SPI> 1.0
|-- <VL53L0X> 1.3.0
|   |-- <Wire> 1.0.1
|-- <SparkFun VL53L1X 4m Laser Distance Sensor> 1.2.9
|   |-- <Wire> 1.0.1
|-- <ServoESP32> 1.0.3
|-- <WiFi> 1.0
|-- <Wire> 1.0.1
|-- <SPI> 1.0
|-- <FS> 1.0
|-- <SPIFFS> 1.0
|   |-- <FS> 1.0
|-- <I2Cdevlib-Core>
|   |-- <Wire> 1.0.1
|-- <SC16IS752> 1.0.1
|   |-- <SPI> 1.0
|   |-- <Wire> 1.0.1
|-- <ArduinoOTA> 1.0
|   |-- <WiFi> 1.0
|   |-- <Update> 1.0
|   |-- <ESPmDNS> 1.0
|   |   |-- <WiFi> 1.0
|-- <Update> 1.0
|-- <ESPmDNS> 1.0
|   |-- <WiFi> 1.0
|-- <WebServer> 1.0
|   |-- <WiFi> 1.0
|   |-- <FS> 1.0
|-- <ESP32HTTPUpdateServer>
|   |-- <WiFi> 1.0
|   |-- <WebServer> 1.0
|   |   |-- <WiFi> 1.0
|   |   |-- <FS> 1.0
|   |-- <FS> 1.0
|   |-- <Update> 1.0
|-- <DNSServer> 1.1.0
|   |-- <WiFi> 1.0
|-- <PubSubClient> 2.7
|-- <ArduinoJson> 6.16.1
|-- <AS_BH1750>
|   |-- <Wire> 1.0.1
|-- <LiquidCrystal_I2C>
|   |-- <Wire> 1.0.1
|-- <NewPingESP8266>
|-- <ESP8266_SSD1306> 3.2.7
|   |-- <Wire> 1.0.1
|   |-- <SPI> 1.0
|-- <Adafruit NeoPixel> 1.0.6
|-- <SerialSensors> 0.0.1
|   |-- <ESPeasySerial> 2.0.5+sha.80db36b
|   |   |-- <SC16IS752> 1.0.1
|   |   |   |-- <SPI> 1.0
|   |   |   |-- <Wire> 1.0.1
|   |-- <SC16IS752> 1.0.1
|   |   |-- <SPI> 1.0
|   |   |-- <Wire> 1.0.1
|-- <MechInputs> 0.0.1
|-- <HTTPClient> 1.2
|   |-- <WiFi> 1.0
|   |-- <WiFiClientSecure> 1.0
|   |   |-- <WiFi> 1.0
|-- <WiFiClientSecure> 1.0
|   |-- <WiFi> 1.0
|-- <CHT16K33 LED Matrix Library> 0.0.1
|   |-- <Wire> 1.0.1
|-- <Adafruit MPR121> 1.0.0
|   |-- <Wire> 1.0.1
|-- <SparkFun APDS9960 RGB and Gesture Sensor> 1.4.2
|   |-- <Wire> 1.0.1
|-- <TinyGPSPlus> 1.0.2
|-- <Adafruit SGP30 Sensor> 1.0.5
|   |-- <Wire> 1.0.1
|-- <Regexp> 0.1.0

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

Re: First build

#12 Post by Ath » 15 May 2021, 09:11

That file not found message smells like your Antivirus is interferring with the build. Can you exclude the ESPEasy folder (incl. subfolders) from AV scanning, to see if that improves the build?
Sometimes it just needs a second build, I sometimes see similar build issues, (Windows 10, MS Defender AV).
/Ton (PayPal.me)

Pi57
New user
Posts: 9
Joined: 14 May 2021, 08:32
Location: France

Re: First build

#13 Post by Pi57 » 15 May 2021, 10:07

Yes I also think about antivirus, but no change after deactivation (bitdefender)

But now it works :), I have completely remove espressif32 framework and reinstall it and I'm able to build completely.

Thanks TD-er and Ath for spending time to help me :)

And now I can play with ESPEasy

See you ;)

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

Re: First build

#14 Post by Ath » 15 May 2021, 10:22

Pi57 wrote: 15 May 2021, 10:07 Thanks TD-er and Ath for spending time to help me :)

And now I can play with ESPEasy
You're welcome, the more the merrier :D
/Ton (PayPal.me)

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 35 guests