So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By sntshk
#96066 Hi there,

First of all, I have no background in electronics. Before buying NodeMCU, I have done some very basic sensor interfacing using Raspberry Pi.

My purpose of buying NodeMCU is for home automation. I have an ESP8266 NodeMCU CP2102 Board. Here are some more information about my setup:

1. I am using Ubuntu.
2. I have already made USB connection to the controller.
3. I have downloaded Arduino IDE by following this tutorial:

This is the code I am using:

Code: Select allvoid setup() {
  // put your setup code here, to run once:

void loop() {
  // put your main code here, to run repeatedly:


And this is the error I am getting when trying to upload the sketch:

Code: Select all. Variables and constants in RAM (global, static), used 28104 / 80192 bytes (35%)
╠══ DATA     1496     initialized variables
╠══ RODATA   920      constants       
╚══ BSS      25688    zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 59667 / 65536 bytes (91%)
╠══ ICACHE   32768    reserved space for flash instruction cache
╚══ IRAM     26899    code in IRAM   
. Code in flash (default, ICACHE_FLASH_ATTR), used 232100 / 1048576 bytes (22%)
╚══ IROM     232100   code in flash v3.0
Serial port /dev/ttyUSB0
Failed uploading: uploading error: exit status 2

Can you guys guide me to troubleshoot this?
User avatar
By btidey
#96074 The exit status of 2 is just the standard error status of that does the connection and uploading.

The fact that there are no other messages from would indicate that it did not get going which would suggest a problem with it using the usb serial port and probably associated with the usb driver. This needs to support the CH340 usb serial on the NodeMCU. Most linux installs should support this but some may require you to install one.

Check out ... vers/linux