sg-wireless / pymakr-vsc

GNU General Public License v3.0
97 stars 25 forks source link

[BUG] uploadProject does not work #274

Closed VitorNilson closed 1 year ago

VitorNilson commented 1 year ago

I am trying to upload a sample project to my ESP8266 board and Pymakr can not upload the project.

This is the error: image

As you can see bellow, I can access the board and run python codes on the terminal:

image

Steps to reproduce the behavior:

  1. Erase board and install latest micropython bin to ESP8266
  2. Install Pymakr on VSCODE and crate a new project
  3. Try to Sync project to device image
  4. See error

Expected behavior Should upload code to the board.

Desktop (please complete the following information):

Additional context This is the source code that I am trying to upload to the device:

image image image

jakobrosenberg commented 1 year ago

Hi @VitorNilson . It looks like Pymakr is trying to clear your rootPath, which I assume is ('/').

Could you try this in paste mode in your REPL and report the results to me?

def rmdir(directory):
    os.chdir(directory)
    for f in os.listdir():
        try:
            os.remove(f)
        except OSError:
            pass
    for f in os.listdir():
        rmdir(f)
    os.chdir('..')
    try:
      os.rmdir(directory)
    except OSError:
      pass

# Your root dir. Please change if this is different.
rmdir('/')