JetBrains / intellij-micropython

Plugin for MicroPython devices in PyCharm and IntelliJ
https://plugins.jetbrains.com/plugin/9777-micropython
Apache License 2.0
514 stars 107 forks source link

Error in run flash #328

Open RamiresOliv opened 1 month ago

RamiresOliv commented 1 month ago

Hi, I am new using the PyCharm and the ESP32. I tried to use PyCharm to code in python my esp, but I am facing this error every time I try to flash it.

My code:

import time
from machine import Pin

led = Pin(13, Pin.OUT)
led.value(False)

while True:
    time.sleep(1)
    led.value(False)
    time.sleep(1)
    led.value(True)

Output:

C:/Users/Gustavo/esp32/esp32/.venv/Scripts/python.exe C:\Users\Gustavo\AppData\Roaming\JetBrains\PyCharmCE2024.2\plugins\intellij-micropython/scripts/microupload.py -C C:/Users/Gustavo/esp32/esp32 -v COM5 C:/Users/Gustavo/esp32/esp32/main.py
Connecting to COM5
Uploading files: 0% (0/1)
C:\Users\Gustavo\esp32\esp32\main.py -> main.py
Traceback (most recent call last):
  File "C:\Users\Gustavo\AppData\Roaming\JetBrains\PyCharmCE2024.2\plugins\intellij-micropython\scripts\microupload.py", line 139, in <module>
    main(sys.argv[1:])
  File "C:\Users\Gustavo\AppData\Roaming\JetBrains\PyCharmCE2024.2\plugins\intellij-micropython\scripts\microupload.py", line 79, in main
    files.put(remote_path, fd.read())
  File "C:\Users\Gustavo\esp32\esp32\.venv\lib\site-packages\ampy\files.py", line 209, in put
    self._pyboard.exec_("f = open('{0}', 'wb')".format(filename))
  File "C:\Users\Gustavo\esp32\esp32\.venv\lib\site-packages\ampy\pyboard.py", line 268, in exec_
    raise PyboardError('exception', ret, ret_err)
elmot commented 2 weeks ago

How about to test a new approach? https://github.com/JetBrains/intellij-micropython/discussions/330