just esp8266

razor_trash
Posts: 2
Joined: Sat Jan 06, 2024 10:42 am

just esp8266

Postby razor_trash » Sat Jan 06, 2024 10:49 am

  1. #include <Arduino.h>
  2.  
  3. // Define the LED pin
  4. const int ledPin = D2;  // Change D2 to the appropriate pin for your setup
  5.  
  6. void setup() {
  7.   // Set the LED pin as an output
  8.   pinMode(ledPin, OUTPUT);
  9. }
  10.  
  11. void loop() {
  12.   // Turn on the LED
  13.   digitalWrite(ledPin, HIGH);
  14.   delay(1000);  // 1-second delay
  15.  
  16.   // Turn off the LED
  17.   digitalWrite(ledPin, LOW);
  18.   delay(1000);  // 1-second delay
  19. }
hii
trying to run this code in my esp8266 board using vscode, but whenever I try to run code, vscode always returns this message:
--------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards ... mcuv2.html
PLATFORM: Espressif 8266 (4.2.1) > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:
- framework-arduinoespressif8266 @ 3.30102.0 (3.1.2)
- tool-esptool @ 1.413.0 (4.13)
- tool-esptoolpy @ 1.30000.201119 (3.0.0)
- tool-mklittlefs @ 1.203.210628 (2.3)
- tool-mkspiffs @ 1.200.0 (2.0)
- toolchain-xtensa @ 2.100300.220621 (10.3.0)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 37 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Retrieving maximum program size .pio\build\nodemcuv2\firmware.elf
Checking size .pio\build\nodemcuv2\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [=== ] 34.3% (used 28104 bytes from 81920 bytes)
Flash: [=== ] 25.0% (used 261479 bytes from 1044464 bytes)
Configuring upload protocol...
AVAILABLE: espota, esptool
CURRENT: upload_protocol = esptool
Looking for upload port...
Using manually specified: COM9
Uploading .pio\build\nodemcuv2\firmware.bin
esptool.py v3.0
Serial port COM9
Traceback (most recent call last):
File "C:\Users\schol\.platformio\packages\tool-esptoolpy\esptool.py", line 3969, in <module>
_main()
File "C:\Users\schol\.platformio\packages\tool-esptoolpy\esptool.py", line 3962, in _main
main()
File "C:\Users\schol\.platformio\packages\tool-esptoolpy\esptool.py", line 3551, in main
esp = chip_class(each_port, initial_baud, args.trace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\schol\.platformio\packages\tool-esptoolpy\esptool.py", line 271, in __init__
self._port = serial.serial_for_url(port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\schol\.platformio\penv\Lib\site-packages\serial\__init__.py", line 90, in serial_for_url
instance.open()
File "C:\Users\schol\.platformio\penv\Lib\site-packages\serial\serialwin32.py", line 64, in open
raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))
serial.serialutil.SerialException: could not open port 'COM9': FileNotFoundError(2, 'Не удается найти указанный файл.', None, 2)
*** [upload] Error 1

------------------
I suppose it happens due to port issue: automatically it choosed 5 but I looked at device manager and switched to 9 coz it showed usb connection on this port
help someone pleeeeeeees

Who is online

Users browsing this forum: No registered users and 24 guests