Error compiling for board NodeMCU 1.0 (ESP-12E Module)

Hi,

I need your help. I need to do serial communication for nodemcu and arduino uno. My nodemcu is version 3

This is the coding for node mcu:

#include <SoftwareSerial.h>
#include <ESP8266WiFi.h>

SoftwareSerial NodeMCU(D2, D1);

void setup() {
Serial.begin(9600);
NodeMCU.begin(4800);
pinMode(D2, INPUT);
pinMode(D1, OUTPUT);
}

void loop() {
int i = 10;
NodeMCU.print(i);
NodeMCU.println("\n");
Serial.println(i);
delay(30);
}

This is the coding for arduino uno:

#include <SoftwareSerial.h>
SoftwareSerial ArduinoUno (3, 2);

void setup() {
Serial.begin(9600);
ArduinoUno.begin(4800);
}

void loop() {
while (ArduinoUno.available() > 0) {
float val = ArduinoUno.parseFloat();
if (ArduinoUno.read() == ‘\n’) {
Serial.println(val);
}
}
delay(30);
}

for the arduino uno, it can be uploaded in arduino IDE, but for nodemcu, it state like this:

Arduino: 1.8.13 (Windows 10), Board: “NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200”

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\acer\Documents\Arduino\libraries -fqbn=esp8266:esp8266:nodemcuv2:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,eesz=4M2M,led=2,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200 -vid-pid=1A86_7523 -ide-version=10813 -build-path C:\Users\acer\AppData\Local\Temp\MW_ArduinoHWSetup\MW_ArduinoBuild -warnings=none -build-cache C:\Users\acer\AppData\Local\Temp\arduino_cache_482601 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.python3.path=C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\python3\3.7.2-post1 -prefs=runtime.tools.python3-3.7.2-post1.path=C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\python3\3.7.2-post1 -prefs=runtime.tools.mkspiffs.path=C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\mkspiffs\3.0.0-newlib4.0.0-gnu23-48f7b08 -prefs=runtime.tools.mkspiffs-3.0.0-newlib4.0.0-gnu23-48f7b08.path=C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\mkspiffs\3.0.0-newlib4.0.0-gnu23-48f7b08 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.0-newlib4.0.0-gnu23-48f7b08 -prefs=runtime.tools.xtensa-lx106-elf-gcc-3.0.0-newlib4.0.0-gnu23-48f7b08.path=C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.0-newlib4.0.0-gnu23-48f7b08 -verbose C:\Users\acer\Desktop\TESTING\NODE_MCU_TEST\1 arah\NodeMCU\NodeMCU.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\acer\Documents\Arduino\libraries -fqbn=esp8266:esp8266:nodemcuv2:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,eesz=4M2M,led=2,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200 -vid-pid=1A86_7523 -ide-version=10813 -build-path C:\Users\acer\AppData\Local\Temp\MW_ArduinoHWSetup\MW_ArduinoBuild -warnings=none -build-cache C:\Users\acer\AppData\Local\Temp\arduino_cache_482601 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.python3.path=C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\python3\3.7.2-post1 -prefs=runtime.tools.python3-3.7.2-post1.path=C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\python3\3.7.2-post1 -prefs=runtime.tools.mkspiffs.path=C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\mkspiffs\3.0.0-newlib4.0.0-gnu23-48f7b08 -prefs=runtime.tools.mkspiffs-3.0.0-newlib4.0.0-gnu23-48f7b08.path=C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\mkspiffs\3.0.0-newlib4.0.0-gnu23-48f7b08 -prefs=runtime.tools.xtensa-lx106-elf-gcc.path=C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.0-newlib4.0.0-gnu23-48f7b08 -prefs=runtime.tools.xtensa-lx106-elf-gcc-3.0.0-newlib4.0.0-gnu23-48f7b08.path=C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.0-newlib4.0.0-gnu23-48f7b08 -verbose C:\Users\acer\Desktop\TESTING\NODE_MCU_TEST\1 arah\NodeMCU\NodeMCU.ino

Using board ‘nodemcuv2’ from platform in folder: C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\hardware\esp8266\3.0.0

Using core ‘esp8266’ from platform in folder: C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\hardware\esp8266\3.0.0

Detecting libraries used…

“C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.0-newlib4.0.0-gnu23-48f7b08/bin/xtensa-lx106-elf-g++” -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ “-IC:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\hardware\esp8266\3.0.0/tools/sdk/include” “-IC:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\hardware\esp8266\3.0.0/tools/sdk/lwip2/include” “-IC:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\hardware\esp8266\3.0.0/tools/sdk/libc/xtensa-lx106-elf/include” “-IC:\Users\acer\AppData\Local\Temp\MW_ArduinoHWSetup\MW_ArduinoBuild/core” -c -w -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=gnu++17 -ffunction-sections -fdata-sections -fno-exceptions -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 -w -x c++ -E -CC -DNONOSDK22x_190703=1 -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10813 -DARDUINO_ESP8266_NODEMCU_ESP12E -DARDUINO_ARCH_ESP8266 “-DARDUINO_BOARD=“ESP8266_NODEMCU_ESP12E”” -DLED_BUILTIN=2 -DFLASHMODE_DIO -DESP8266 “-IC:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266” “-IC:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\hardware\esp8266\3.0.0\variants\nodemcu” “C:\Users\acer\AppData\Local\Temp\MW_ArduinoHWSetup\MW_ArduinoBuild\sketch\NodeMCU.ino.cpp” -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Alternatives for bits/c++config.h:

ResolveLibrary(bits/c++config.h)

→ candidates:

In file included from c:\programdata\matlab\supportpackages\r2018a\3p.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.0-newlib4.0.0-gnu23-48f7b08\xtensa-lx106-elf\include\c++\10.2.0\stdlib.h:36,

             from C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266/Arduino.h:27,

             from C:\Users\acer\AppData\Local\Temp\MW_ArduinoHWSetup\MW_ArduinoBuild\sketch\NodeMCU.ino.cpp:1:

c:\programdata\matlab\supportpackages\r2018a\3p.instrset\arduinoide.instrset\idepkgs\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.0-newlib4.0.0-gnu23-48f7b08\xtensa-lx106-elf\include\c++\10.2.0\cstdlib:41:10: fatal error: bits/c++config.h: No such file or directory

41 | #include <bits/c++config.h>

  |          ^~~~~~~~~~~~~~~~~~

compilation terminated.

exit status 1

Error compiling for board NodeMCU 1.0 (ESP-12E Module).

I dont know how matlab support packages have nothing to do with this. I also already uninstall the arduino hardware package in matlab