curdeveryday / vscode-m5stack-mpy

A extension to mange files for M5Stack micropython system
MIT License
32 stars 14 forks source link

No tree view with id 'm5stack' registered when refreshing #10

Open jhollowe opened 3 years ago

jhollowe commented 3 years ago

Extension version: 1.0.9

VSCode About Info:

Version: 1.55.2 Commit: 3c4e3df9e89829dce27b7b5c24508306b151f30d Date: 2021-04-13T09:35:57.887Z Electron: 11.3.0 Chrome: 87.0.4280.141 Node.js: 12.18.3 V8: 8.7.220.31-electron.0 OS: Windows_NT x64 10.0.19042

When attempting to do some actions (refresh the file tree listing, upload file, delete file, etc), the following error is presented and the file tree breaks. To fix it, you must deselect the COM and reselect the COM.

Saving a file, reading files, and "Run in M5Stack" all work without the error.

Error: No tree view with id 'm5stack' registered.
    at a.$getChildren (c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:86:55517)
    at u._doInvokeHandler (c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:12794)
    at u._invokeHandler (c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:12478)
    at u._receiveRequest (c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:11145)
    at u._receiveOneMessage (c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:10130)
    at c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:90:8032
    at _.fire (c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:57:1836)
    at E.fire (c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:15496)
    at c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:29750
    at _.fire (c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:57:1836)
    at E.fire (c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:15496)
    at t._receiveMessage (c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:20754)
    at c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:17640
    at _.fire (c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:57:1836)
    at acceptChunk (c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:12861)
    at c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:65:12209
    at Socket.w (c:\Users\jhollowe\Desktop\VSCode-win32-x64-1.55.2\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:105:13173)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)

dqkKbzMCso

pacheca533 commented 3 years ago

I have the same problem, but I add, when I upload the program the first time it works, but the next time I try to upload it does not run, I need to restart m5stack to be able to load a new program. This is a big problem for me, because I need to upload many times to debug my program.

darul75 commented 2 years ago

Hi guys, might have a fix for that but I am about rewriting the whole from scratch...in a fork.

I d like to contact first the author of this extension to ask him few questions, I will let you know how it goes.

darul75 commented 2 years ago

Fix coming soon

wacsy commented 2 years ago

I got similar issue. I have tried on both windows 10 and macos 11.6. It only shows the main.py but every other file / folder I click will give me error / false. I am running the M5Stack-paper with UIFlow v1.8.7

darul75 - I am very looking forward to the fix, and thanks a lot.

darul75 commented 2 years ago

@curdeveryday do you think there will be a new release soon?

darul75 commented 2 years ago

@wacsy @jhollowe can you please give it a try with latest version v1.1.3 and let us know if that works for you now. thanks in advance.

wacsy commented 2 years ago

@wacsy @jhollowe can you please give it a try with latest version v1.1.3 and let us know if that works for you now. thanks in advance.

Yes, I have tried it and it works prefect. Thank you very much.

But I got an error when I try to upload a png file to the img folder: Error running command m5stack.itemUpload: Communication error, sorry.. This is likely caused by the extension that contributes m5stack.itemUpload.

Any idea?

wacsy commented 2 years ago

And I think there is some limitation of the communication. I got communication error if I want to draw 5 rectangles but 4 is ok by using M5Rect. I think I will go back to m5stack/M5EPD with PlatformIO for the time being. Just hope we can use python some day.

darul75 commented 2 years ago

glad to hear you back about this initial issue, will investigate your upload failure with a png file and your second case which sounds pretty straightforward, would you mind sharing a piece of code with us?

darul75 commented 2 years ago

@wacsy I think I found where the issue is coming for the image upload, probably a restriction on the device firmware about filenames, I will add some more details here shortly, fix should be pretty easy though.

wacsy commented 2 years ago

glad to hear you back about this initial issue, will investigate your upload failure with a png file and your second case which sounds pretty straightforward, would you mind sharing a piece of code with us?

Great! M5stack kits are great products. I hope we can have brilliant software and documents for it as well. Here is the entire code I would like to try with vscode m5stack mpy

from m5stack import *
from m5ui import *
from uiflow import *
from m5mqtt import M5mqtt
from m5stack import touch

setScreenColor(15)

HTtimer = None
freCont = None
TXT = None

rectangle0 = M5Rect(84, 154, 150, 150, 15, 1)
rectangle1 = M5Rect(283, 154, 150, 150, 15, 1)
labelTitle = M5TextBox(145, 40, "Switches", lcd.FONT_DejaVu56, 0, rotate=0)
labTx = M5TextBox(58, 860, "Text", lcd.FONT_DejaVu24, 0, rotate=0)
ima_lamp = M5Img(95, 165, "res/lamp.png", True)
circle0 = M5Circle(439, 880, 50, 0, 0)
ima_proj = M5Img(294, 165, "res/projector.png", True)
labTy = M5TextBox(58, 905, "Text", lcd.FONT_DejaVu24, 0, rotate=0)
ima_temp = M5Img(102, 406, "res/temperature.png", True)
ima_hum = M5Img(294, 406, "res/humi.png", True)
lab_ttemp = M5TextBox(113, 553, "00.0", lcd.FONT_DejaVu40, 0, rotate=0)
lab_thum = M5TextBox(332, 553, "00", lcd.FONT_DejaVu40, 0, rotate=0)
label2 = M5TextBox(185, 860, "Text", lcd.FONT_DejaVu24, 0, rotate=0)
label0 = M5TextBox(185, 904, "Text", lcd.FONT_DejaVu24, 0, rotate=0)

m5mqtt = M5mqtt('m5p2', '192.168.0.1', 1883, 'username', 'password', 300)
HTtimer = 0
freCont = 0
lab_thum.setText(str("%.0f"%((sht30.humidity))))
lab_ttemp.setText(str("%.1f"%((sht30.temperature))))
lcd.show()
while True:
  if touch.status():
    labTx.setText(str(touch.read()[0]))
    labTy.setText(str(touch.read()[1]))
    if (touch.read()[0]) > 130 and (touch.read()[0]) < 210:
      if (touch.read()[1]) > 200 and (touch.read()[1]) < 270:
        if TXT == '0':
          m5mqtt.start()
          m5mqtt.publish(str('topic/control'),str('1'))
          TXT = '1'
        else:
          m5mqtt.start()
          m5mqtt.publish(str('topic/control'),str('0'))
          TXT = '0'
        label2.setText(str(TXT))
      else:
        label2.setText('out')
    else:
      label2.setText('out')
    lcd.partial_show(40, 850, 220, 100)
    freCont = freCont + 1
  HTtimer = HTtimer + 2
  if HTtimer > (5 * 60) * 1000:
    lab_thum.setText(str("%.0f"%float((sht30.humidity))))
    lab_ttemp.setText(str("%.1f"%float((sht30.temperature))))
    HTtimer = 0
    lcd.partial_show(110, 550, 280, 60)
    freCont = freCont + 1
  if freCont > 6:
    freCont = 0
    lcd.show()
  wait_ms(2)

This is verified with the web page version of UIFlow (https://flow.m5stack.com/) and working correctly. But it shows the communication error when I using VSCode. So I started with some short codes to try:

from m5stack import *
from m5ui import *
from uiflow import *
from m5mqtt import M5mqtt
from m5stack import touch

setScreenColor(15)

HTtimer = None
freCont = None
TXT = None

rectangle0 = M5Rect(84, 154, 150, 150, 15, 1)
rectangle1 = M5Rect(283, 154, 150, 150, 15, 1)
rectangle2 = M5Rect(83, 254, 150, 150, 15, 1)
rectangle3 = M5Rect(83, 354, 150, 150, 15, 1)
lcd.show()

this one only draw 4 rectangles and it works, but if I add another M5Rect it will failed.

curdeveryday commented 2 years ago

@wacsy I try your codes, it works in my M5Paper. Could you show your serial output or the communication error message? image image

wacsy commented 2 years ago

@wacsy I try your codes, it works in my M5Paper. Could you show your serial output or the communication error message?

Sorry, my misstake was only copied the script to the main.py rather than creat a new one under apps folder. Now it is working correctly. Thank you very much.

The png image can be uploaded to res folder with an error:

error during png upload

And the UI is frozen, do you have any solution, please?

tree view cannot show it corrently after upload done

Do I need to find a serial sniffer on this, please? The VSCode doesn't give me any useful information about the communication error. Or does it have some log I can check, please?