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: https://www.youtube.com/watch?v=MFencFdpV5g

This is the code I am using:

Code: Select allvoid setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  delay(1000);
  Serial.print('a');
}

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%)
║   SEGMENT  BYTES    DESCRIPTION
╠══ DATA     1496     initialized variables
╠══ RODATA   920      constants       
╚══ BSS      25688    zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 59667 / 65536 bytes (91%)
║   SEGMENT  BYTES    DESCRIPTION
╠══ 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%)
║   SEGMENT  BYTES    DESCRIPTION
╚══ IROM     232100   code in flash   
esptool.py 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 esptool.py that does the connection and uploading.

The fact that there are no other messages from esptool.py 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 https://learn.sparkfun.com/tutorials/ho ... vers/linux
User avatar
By spinabove
#96326 No other messages from esptool.py show it did not start up, which points to a problem with the usb serial port, most likely caused by the usb driver. This must work with the NodeMCU's CH340 usb serial. Most distributions of Linux should automatically have this, but you may need to install it in some.
User avatar
By paxtonleiny
#96526 There are no other notifications from esptool.py indicating that it failed to launch, which suggests a USB serial port issue that was most likely brought on by the USB driver. The CH340 USB serial port on the NodeMCU must support this. This should come pre-installed in the majority of Linux variants, though you might need to install it in some.