openblockcc / openblock-desktop

Graphic programming software for hardware like: arduino, microbit, esp32, esp8266...
MIT License
244 stars 106 forks source link

Failed to upload code on Windows desktop v2.2.8 #27

Closed ysun closed 3 years ago

ysun commented 3 years ago

Expected Behavior

`// generated by OpenBlock

include

void setup() { }

void loop() { digitalWrite(13, HIGH); delay(1 1000); digitalWrite(13, LOW); delay(1 1000); }`

Then click button 'Upload', Openblock should compile the code and upload the binary onto the board Arduino Uno.

Actual Behavior

I connected a Arduino uno , and Openblock could identify it and connect it successfully. But after write a sample code and click upload button, it failed to upload code to the board, just show me "upload failed' after the uploading screen.

Steps to Reproduce

I compile the whole code stack by my self with latest version. Run oepnblock without any error. Try the sample code, then failed.

Operating System and Browser

Build on Linux with docker for win32. Run on windows 10.

zhengyangliu commented 3 years ago

Need your information in the upload window to analyze where the problem is.

ysun commented 3 years ago

Nothing useful, but 'Upload timeout' as followed: Or if any other effort I can do for information collection. image

BTW, I have tried several Arduino uno, no luck. And I did some narrow down, I found the serial port probably works, cause data LED on the board blink while send data via the 'send button'. I doubt it might be due to the arduino compiler. Do I have to install Arduino IDE separately? I didn't find avr-gcc in the Openblock installation folder.

ircbloqcc commented 3 years ago

Nothing useful, but 'Upload timeout' as followed: Or if any other effort I can do for information collection. image

BTW, I have tried several Arduino uno, no luck. And I did some narrow down, I found the serial port probably works, cause data LED on the board blink while send data via the 'send button'. I doubt it might be due to the arduino compiler. Do I have to install Arduino IDE separately? I didn't find avr-gcc in the Openblock installation folder.

I think problem with your installation folder.. Try to reinstall openblock again.. Please check your antivirus if you installed.. Sometimes antivirus will detect the cli file as virus, so it will be remove from installation folder

zhengyangliu commented 3 years ago

Yes, if this problem occurs, arduino-cli.exe should not be found in the tools path. You can check it.

ysun commented 3 years ago

I re-installed it, disabling antivirus, but there is still NOT arduino-cli.exe in the installation folder. Not any virus alarm or error happened while installing. I checked the project folder 'openblock-desktop/dist', where I packagee the win32 installation. There's no arduino-cli.exe, either. Are you sure project integrated the arduino compiler ?

zhengyangliu commented 3 years ago

Which command did you use to package the project. You should run npm run dist. The script will automatically download arduino-cli during the packaging process. If the download fails during this process, the packaging process will not be interrupted. So you need to check if these resources have been successfully fetched.

ysun commented 3 years ago

Oh my. My wrong! I didn't use the script, I ran electron-builder -w instead in the container. That because I didn't find it could be cross-compile in package.json. I have no windows develop env at the moment, so have to build win32 installation on a Linux. So do you have any idea how should I build win32 installation on a Linux OS ?

zhengyangliu commented 3 years ago

Nothing can help you, I use the corresponding system to package the software, you can try a virtual machine.

ysun commented 3 years ago

Ok, get it. Then we can close this issue. I ganna to setup a win10 vm to have a try. Any issue I'll come here then. btw, the guide https://openblockcc.gitee.io/wiki/zh/developer/develop-from-source/pack-desktop-software/ is workable, right ?

zhengyangliu commented 3 years ago

Yes.