User_interface.h: No such file or directory

In file included from C:\Desktop\Smart_Gas_Detector\Smart_Gas_Detector.ino:18:0:
BlynkEdgent.h:3:12: fatal error: user_interface.h: No such file or directory
#include “user_interface.h”
^~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
user_interface.h: No such file or directory

I am using nodeMCU ESP826
What should I do to fix this error?

What version of the ESP8266 Core do you have installed ? (Arduino IDE > Tools > Board > Boards Manager > Search for ESP8266)

What board type are you choosing in the IDE when you compile the sketch?

What version of the Blynk C++ library do you have installed?

Pete.

I am using arduino ide 1.8.19, when i search for esp8266, nothing showing. This is what i got when i search ESP

I choose ‘arduino uno’ when compiling

This is the library version that i installed for blynk

Okay, that’s your problem.
You need to install the ESP8266 core, which will give you various ESP8266 based boards, including several NodeMCU versions, and it’s one of those that you need to choose.

To install the ESP8266 core you need to follow these instructions…

Pete.

here comes another error while compiling

Have you installed the MQ-2 lib?

I installed a library named MQUnifiedsensor, which stated it includes the MQ2 sensor


May i know how to install this MQ2 library?

Yes, but then you have to use MQUnifiedsensor.h instead of MQ2.h in your sketch :slight_smile:

Scroll down to “Usage”…

@PeteKnight
When I compile the sketch and upload it, it shows the error as shown below.

. Variables and constants in RAM (global, static), used 40368 / 80192 bytes (50%)
║   SEGMENT  BYTES    DESCRIPTION
╠══ DATA     1684     initialized variables
╠══ RODATA   8324     constants       
╚══ BSS      30360    zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 62811 / 65536 bytes (95%)
║   SEGMENT  BYTES    DESCRIPTION
╠══ ICACHE   32768    reserved space for flash instruction cache
╚══ IRAM     30043    code in IRAM    
. Code in flash (default, ICACHE_FLASH_ATTR), used 452128 / 1048576 bytes (43%)
║   SEGMENT  BYTES    DESCRIPTION
╚══ IROM     452128   code in flash   
esptool.py v3.0

Serial port COM5
A fatal esptool.py error occurred: Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31)

Best
John

@johnweak please edit your last post (using the pencil icon at the bottom) and remove your screenshot then replace it with the text from your compiler error - copy and paste the text, dont screenshot it.
When you post the text put triple backticks at the beginning and end of the compiler error message so that it displays correctly.
Triple backticks look like this:
```

Copy and paste these if you can’t find the correct symbol on your keyboard.

Pete.

Dear Pete

Noted with thanks. Will edit it soon. Sorry for the inconvenience

Best
John

This error indicates that your computer can’t talk to your ESP8266 to be able to upload the code, or possibly that the ESP8266 isn’t in the correct state to accept the code.

Things to try…

  • Ensure that you’ve selected the correct serial port
  • Ensure that you’re using a USB cable that has both power and data cables (some just provide power)
  • Avoid opening the serial monitor while the code upload is trying to execute
  • Try the upload again
  • Try rebooting your computer then uploading again
  • Remove all connections to your board (except the USB cable) then try uploading again

Pete.

Topic closed as user @johnweak has created another topic about a similar issue relating to code upload.

Pete.