Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Upload Problem for NodeMCU

Status
Not open for further replies.

ZJ0518

Newbie
Newbie level 3
Joined
Jun 24, 2019
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
28
Hi, I faced such issue while uploading my code from arduino IDE to my NODEMCU Lua V3 ESP8266 WIFI.

Error:
Code:
Executable segment sizes:
IROM   : 248372          - code in flash         (default or ICACHE_FLASH_ATTR)
IRAM   : 27960   / 32768 - code in IRAM          (ICACHE_RAM_ATTR, ISRs...)
DATA   : 1320  )         - initialized variables (global, static) in RAM/HEAP
RODATA : 2224  ) / 81920 - constants             (global, static) in RAM/HEAP
BSS    : 25552 )         - zeroed variables      (global, static) in RAM/HEAP
Sketch uses 279876 bytes (26%) of program storage space. Maximum is 1044464 bytes.
Global variables use 29096 bytes (35%) of dynamic memory, leaving 52824 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.8
Serial port COM4
Traceback (most recent call last):
  File "C:\Users\Zhang Jie\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4/tools/upload.py", line 65, in <module>
    esptool.main(cmdline)
  File "C:/Users/Zhang Jie/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\esptool.py", line 2889, in main
    esp = chip_class(each_port, initial_baud, args.trace)
  File "C:/Users/Zhang Jie/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool\esptool.py", line 237, in __init__
    self._port = serial.serial_for_url(port)
  File "C:/Users/Zhang Jie/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial\serial\__init__.py", line 88, in serial_for_url
    instance.open()
  File "C:/Users/Zhang Jie/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial\serial\serialwin32.py", line 78, in open
    self._reconfigure_port()
  File "C:/Users/Zhang Jie/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial\serial\serialwin32.py", line 222, in _reconfigure_port
    'Original message: {!r}'.format(ctypes.WinError()))
serial.serialutil.SerialException: Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.', None, 31)
serial.serialutil.SerialException: Cannot configure port, something went wrong. Original message: PermissionError(13, 'A device attached to the system is not functioning.',

This is my code to interface the Ultrasonic Sensor and NodeMCU.

C:
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = "-2fX0ap9fZmfV1sZLpw06ab6WNvagomb";
char ssid[] = "BlazingSpeed-TIME2.4G";
char pass[] = "1bwf3988";

const int trigPin = D0;
const int echoPin = D1;

long duration;
int distance;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Blynk.begin(auth,ssid,pass);
  pinMode(trigPin,OUTPUT);
  pinMode(echoPin,INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(trigPin,LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin,HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin,LOW);
  duration = pulseIn(echoPin,HIGH);
  distance = duration*0.34/2;

  if (distance <= 10){
    Blynk.virtualWrite(V0,255);
  }
  else{
    Blynk.virtualWrite(V0,0);
  }
  if (distance <= 6){
    Blynk.virtualWrite(V1,255);
  }
  else{
    Blynk.virtualWrite(V1,0);
  }
  if (distance <= 3){
    Blynk.virtualWrite(V2,255);
  }
  else{
    Blynk.virtualWrite(V2,0);
  }
  Blynk.run();
}
 
Last edited by a moderator:

The source code isn't the problem although you might need to change 'distance' to a float type to make the calculation work.
The error on the last two lines indicates a problem with the serial port on the computer you are using to program the device. Basically it can't access the port you have specified.

Incidentally, you should change your 'auth[]' code (get a new one from Blynk) now it has been published. You should keep it secret as now anyone using it can access your device!

Brian.
 

The source code isn't the problem although you might need to change 'distance' to a float type to make the calculation work.
The error on the last two lines indicates a problem with the serial port on the computer you are using to program the device. Basically it can't access the port you have specified.

Incidentally, you should change your 'auth[]' code (get a new one from Blynk) now it has been published. You should keep it secret as now anyone using it can access your device!

Brian.


Hi Brian,
Does that means that the USB cable I used or the NodeMCU module is faulty?
 

I don't use Windows but from the error report it would seem the problem is that the computer is unable to see the serial port so it suggests either a configuration error in the PC or the cable is faulty. It is unlikely to be a faulty NodeMCU but not impossible.

Check the NodeMCU has 5V between the 'Vin' pin and the 'GND' pin when the USB cable is plugged in. Also check the 3.3V is present between the '3V3' pin and 'GND'. If you check the USB port (in the Windows control panel I think) it should report seeing the UART, most likely reporting it as a CP2012.

Brian.
 
I think is change new line usb for upload.

see detail refer

**broken link removed**
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top