scratch3.0无法连接wedo2.0

问题导致的原因:websocket连接地址是wss://device-manager.scratch.mit.edu:20110/scratch/ble

解决方案:修改源码中websocket连接地址,将之改成wss://127.0.0.1:20110/scratch/ble即可;

1、源码位置

在vscode中全局搜索 wss://device-manager.scratch.mit.edu:20110/scratch/ble,如图:
scratch3.0无法连接wedo2.0_第1张图片
注意:
vscode默认全局搜索不会搜索node_modules文件夹(坑啦我好长时间),修改vscode用户设置,ctrl+shift+p打开选择之后选择首选项设置,如图:

scratch3.0无法连接wedo2.0_第2张图片
新增代码:

	"search.exclude": {
        "**/node_modules": false
    }

2、测试结果

重新打包后,重新连接wedo2.0,如图:

scratch3.0无法连接wedo2.0_第3张图片
成功啦哈

你可能感兴趣的:(scratch3.0无法连接wedo2.0)