Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Building code with PlatformIO

Hi,
I am new to this project so please excuse me if these questions are not new.
I recently installed PlatformIO on Visual Studio Code on a Windows 10 laptop. I downloaded the latest code for the ESP8266 legacy V4 software. I opened the provided workspace and tried to build the EspController project. I am using Espressif8266 version 2.6.3 as I got errors on other projects with the latest version 3.x.x.
The following errors popped up.

xtensa-lx106-elf-g++: error: unrecognized command line option '-std=gnu++17'
xtensa-lx106-elf-g++: error: unrecognized command line option '-std=gnu++17'
*** [.pio\build\esp8266_d1mini\src\DIYBMSServer.cpp.o] Error 1
*** [.pio\build\esp8266_d1mini\src\HAL_ESP8266.cpp.o] Error 1
xtensa-lx106-elf-g++: error: unrecognized command line option '-std=gnu++17'
*** [.pio\build\esp8266_d1mini\src\PacketReceiveProcessor.cpp.o] Error 1
*** [.pio\build\esp8266_d1mini\src\PacketRequestGenerator.cpp.o] Error 1

Any idea why it would not compile?

Well, it looks like this version of the compiler does not support C++17 !
BTW, you can multiple versions of the framework in parallel.
Just specify which version you want in the ini file.

Hi Fred
I used the INI file as is. So I did not select anything else. I thought that it might work “out of the box” if I used what was supplied.
I did change the compiler version but then a heap of other problems pop up. I am using the version 2.6.3 of the framework.
I tried the ESP32 version of the code and that compiles first time with no issues.

Could you show your ini file please?

I tried to do that but new users can only post two links inside a file and there are a couple of links to the github sources.

Is there a way to attach the file rather?

Can you write me an “email” ?

Yes, Email?

Fixed - you should be able to attach the files now.

1 Like

Thanks Robert.

Hi Marius,
In platformio.ini at line 29, write “platform = [email protected]” and comment lines 38,39,40.
That should solve your problem.
Fred

1 Like

Thanks Fred you are a star man.

1 Like