intellij-micropython icon indicating copy to clipboard operation
intellij-micropython copied to clipboard

File uploading is stuck

Open oryair1 opened this issue 6 years ago • 18 comments
trafficstars

I followed every step in the README file, though when I press run to upload the python files I get: "Connecting to COM4 Uploading files: 0% (0/1) C:\Projects\MicroPython\ESP32\main.py -> main.py" This just stays like this forever. Please tell me what to do.

oryair1 avatar Dec 13 '18 18:12 oryair1

Uploading is done via a Python script microupload.py located in the plugin installation directory. See this doc for the platform-specific location of the directory with installed plugins. In order to debug this problem you can try running /path/to/your/project/virtualenv/bin/python microupload.py with the necessary parameters from the system command line and see what it does. Feel free to copy this script into your project directory so you can modify it / debug it within PyCharm.

vlasovskikh avatar Dec 13 '18 20:12 vlasovskikh

OK, thanks a lot! I will try to do that and be back with results. I have one more question - what is the python version of micropython?

oryair1 avatar Dec 13 '18 20:12 oryair1

@vlasovskikh I debuuged the microupload.py script and I noticed the this line is blocking the script - "files.put(remote_path, fd.read())" Can you tell why?

oryair1 avatar Dec 13 '18 22:12 oryair1

Is your REPL terminal open when you are trying to upload? I noticed that if it is open, uploading will get stuck like you describe.

jeffkarney avatar Dec 16 '18 17:12 jeffkarney

Unfortunately no, a REPL terminal was not open at the time of upload. Can you think of any thing else which will cause "files.put(remote_path, fd.read())" to block the script?

oryair1 avatar Dec 16 '18 19:12 oryair1

I've also faced this issue, with one ESP32 board, which other tools were able to connect and flash files to. However, trying with a different ESP32 board, I was able to get the tool to flash the files sucessfully. I'll post here if I do more digging on the "bad board"

lpbas avatar Feb 04 '19 10:02 lpbas

did you find the solution on this issue

SimahoJr avatar Jul 11 '19 23:07 SimahoJr

For me, I ended up using a different board and the upload is working fine ever since... Did not have the time to dig deeper into the issue.

lpbas avatar Jul 15 '19 09:07 lpbas

Great, but I have a solution for that, I have d one this to avoid that every time and it alwasys work.

  1. When you are uploading make sure the running terminals, like "REPL terminal” or “Python terminal” are all closed. These terminals are found on the bottom of the IDE..
  2. If for some reason it doesn’t upload, I found that if you flash it again with esptool.py on the terminal, it works fine. (You can create a script to do that, It will be easy)

On 15 Jul 2019, at 12:59, Lucas Paul <[email protected]mailto:[email protected]> wrote:

For me, I ended up using a different board and the upload is working fine ever since... Did not have the time to dig deeper into the issue.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/vlasovskikh/intellij-micropython/issues/77?email_source=notifications&email_token=AGBAYD56ZWFEH5UN5YR7HB3P7RC7DA5CNFSM4GKIU5E2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ5HK4Q#issuecomment-511341938, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGBAYD6ET5NXKNIJ37NG2XTP7RC7DANCNFSM4GKIU5EQ.

SimahoJr avatar Jul 15 '19 10:07 SimahoJr

Closing this issue as obsolete. If the problem is still relevant to you, feel free to comment or open another issue.

vlasovskikh avatar Jun 06 '20 00:06 vlasovskikh

I am facing the exact same issue. The upload is stuck forever. @SimahoJr could you possibly share the script as a gist?

quaintdev avatar Feb 04 '21 06:02 quaintdev

Turns out adding a delay of 3 seconds like below in microupload.py solves the issue. While debugging step by step I found out that there was no issue at all. It works if we slow it down a bit. 😃

            time.sleep(3) 
            files.put(remote_path, fd.read())

quaintdev avatar Feb 04 '21 07:02 quaintdev

Hi, Adding time.sleep(1) in script microupload.py, as mentioned above, worked for me! Thanks a lot!

frederic-bonjour avatar Jul 25 '21 09:07 frederic-bonjour

There is #142 that proposes one way to fix it. I've left my review comments there suggesting yet another approach.

vlasovskikh avatar Aug 05 '21 11:08 vlasovskikh

There is #142 that proposes one way to fix it. I've left my review comments there suggesting yet another approach.

I have the same issue now, Ive tried thay but the line I get pointed out debugging is "raise DocopExit()", any idea what my problem might be?

AnAvgGuy avatar Jan 08 '22 22:01 AnAvgGuy

I still have this one .... "Connecting to COM4 Uploading files: 0% (0/1) C:\Projects\MicroPython\ESP32\main.py -> main.py"

No file uploaded. I have tried different delay times in microupload.py, but nothing helps. I also try the boot button while Run flash, but no positive result. Please advice ....

Amundw99 avatar Sep 06 '23 18:09 Amundw99

Estou enfrentado este mesmo erro ao tentar usar o NodeMCU ESP8266 com Micropython no Pycharm, consigo ate fazer upload do código uma vez, mas se for tentar novamente a execução simplesmente não finaliza me deixando apenas com isso na tela: Connecting to COM3 Uploading files: 0% (0/1) C:\Users\Marcos\PycharmProjects\pythonProject2\main.py -> main.py

Se alguém tiver alguma sugestão agradeço. Segue a imagem da minha tela de codificação, {CC87FE1E-7617-4B6D-8B17-902F22B7FB7D} png

marcosdantas1897 avatar Nov 02 '23 23:11 marcosdantas1897

Estou enfrentado este mesmo erro ao tentar usar o NodeMCU ESP8266 com Micropython no Pycharm, consigo ate fazer upload do código uma vez, mas se for tentar novamente a execução simplesmente não finaliza me deixando apenas com isso na tela: Connecting to COM3 Uploading files: 0% (0/1) C:\Users\Marcos\PycharmProjects\pythonProject2\main.py -> main.py

Se alguém tiver alguma sugestão agradeço. Segue a imagem da minha tela de codificação, {CC87FE1E-7617-4B6D-8B17-902F22B7FB7D} png

Try:

  1. Press the boot button while uploading
  2. Make sure you have the right firmware (micropython)

SimahoJr avatar Nov 05 '23 09:11 SimahoJr