-
-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Communication problem with 1.9.0-RC1 and 1.9.0-RC2 #151
Comments
Related to #150 |
Fixed by 7e10f4b in 1.9.0-rc.3 Bad (w/ Node.js v4 or earlier versions) const re = new RegExp(/\[[^\]]+\]/, 'g'); Good (all Node.js versions) const re = new RegExp(/\[[^\]]+\]/g); |
Please let me know if 1.9.0-rc.3 works for you. |
Just installed RC3 for Windows 64bit. Didn't fix the problem. |
Just installed cncjs-1.9.0-rc.3-win-x64.exe, but I cannot reproduce this issue. You can see my screenshot below: If possible, could you press Ctrl + Shift + I to Toggle Developer Tool, and check if there are any error messages logged to the console? Thank you. |
@cheton Here are some screen shots for you. And V1.8.14 on the same PC with the same GRBL board is not showing any errors and works OK. |
The last two errors For the first two errors, it shows that your workspace settings was corrupted. I tried to corrupt my file in You can go to Settings > Workspace to restore to defaults, then the first two errors should disappear. I will add more sanity checks to eliminate these errors. However, I can continue to use the web interface after encountering these errors, but your installed version of 1.9.0-rc.3 didn't have Grbl initialized correctly. It should show the welcome message as below:
Have you ever tried disconnecting the USB cable and then connect it again? In some rare cases, I may encounter the issue that Grbl won't response after connection established, but disconnect USB cable and then connect it again will resolve this issue. |
@cheton I also noticed the file download size dropped significantly with rc4. rc3 was 37.3Mb, rc4 is 34.7Mb. Is something missing from rc4? |
@cheton As you can see from the screen shots, V1.8.14 command console is responding OK, but V1.9.0 rc3 is not. |
Oops. I updated a 3rd-party dependency "delay" to its latest version (v1.3.1 -> v2.0) in 1.9.0-rc.4, but delay@2.0 seems to be broken, and unfortunately it didn't fail the build: I will rollback this change and submit a new build to fix this issue for 1.9.0-rc.4. Otherwise, I installed 1.9.0-rc.3 (win-x64) on another Windows machine, and it can connect to Grbl without problems. A major difference between 1.8 and 1.9 is the installed program path: This issue might be affected to Electron app only, I will try to find a way to dump console logs from a running Electron app to check if there are error reported from the node.js server. |
Could you try launching the program from command line to check console output? You'll see server logs as shown below: Note. Launching program from command line on Windows may show |
@cheton I've attached some screen shots, but did notice once interesting thing. I started cncjs.exe from the command prompt and took a screen shot. Then pressed the Open button, but nothing happened in the cmd window, so I pressed the closed button and in the cmd window got an error that the com port was already closed. so it appears the com port wasn't open even though the GUI indicated it was. So I tried open and close again, and again got an error that the com port was not open. |
@cheton The error in the cmd windows in V1.9.0-rc may not be relevant as I am seeing the same results in V1.8.14 even though it works. |
I found a way to troubleshoot Electron app:
|
Update: Electron v1.6.4 is a beta release for running an upgraded version of Chrome, the stable release is https://github.com/electron/electron/releases/tag/v1.3.14 |
@cheton I have run cncjs via electron and here are two screenshots. The first is the initial startup and the connection has been established. The second is after a ? command has been sent from the console. |
Thank you for providing this. Will it go back to normal after clicking the Reset button on the navigation bar? It looks probably a serial communication issue especially when running Electron app for Windows, but not always reproducible on other Windows machines. I listed all version changes of electron and electron-builder between cncjs 1.8.14 and 1.9.0-rc.5:
A major change is that I started to use Electron 1.6.2 since cncjs-1.9.0-alpha.5. I just realized that Electron 1.6.2 is running an upgraded Chrome and may have some instability. If you can run well with v1.9.0-alpha.4, but no luck with 1.9.0-alpha.5, it should be probably caused by an upgraded Electron version. https://github.com/cncjs/cncjs/releases/tag/v1.9.0-alpha.4 Otherwise, I will try to rollback Electron to 1.4.15 (stable release) and provide a new release later. |
@cheton Just install V1.9.0 Alpha 4 and it is working fine as you can see from the screen shot. |
Wow. That's great news! I will publish a new release soon. |
1.9.0-rc.6 is ready to download |
@cheton Interesting.. The roll back of electron didn't fix it. I am going install each release from Alpha 4 and see exactly when it stops working. |
@cheton This is really weird. I can't get Alpha 4 to work now. I'm going all the way back to 1.8.14 and work up from there. |
Thank you for all your assistance. Hope this won't take up too much of your time, |
@cheton Just installed Alpha 3 and it worked. Reinstalled alpha 4 and its not working. Went back to alpha 3 and it worke again. Up to alpha 4 and I can't get it to work. I'm not work what made alpha 4 work before. |
Okay. I will create a separate |
See https://github.com/cncjs/cncjs/releases/tag/dev-151-electron-latest There were two files created by AppVeyor CI. The first link is the downgraded version of electron-builder, which is pretty similiar to 1.9.0-alpha.3. The second link the exactly the same thing as 1.9.0-rc.6.
My screenshot for first download link cncjs-1.9.0-dev-151-latest-5822dd19: My screenshot for second download link cncjs-1.9.0-latest-caa256e3: |
I have something and will look back a previous version now, but with both versions above it did not work at first but this is the procedure I followed on both and it worked. I retested by pressing the close button. Pressed Open and got no response, pressed the reset button on the Arduino board and it came to life. I repeated this with dev-151 5 times and repeatedly got the same result. This is not something I have to do in V1.8.x. I tried cncjs-1.9.0-win-x64_electron-1.4.15_electron-builder-16.3.0.exe and got the same results. I and going to installed Alpha 3 again and make sure it worked, then install alpha 4 and see if the above steps works. Give me 15 minutes. |
@cheton 1.9.0-Alpha3 connects and I get the grbl welcome message without having to press the reset button on the Arduino. However I did notice the grbl welcome message takes about 7 seconds to appear. If I press the Arduino reset button again, the welcome message appears almost instantly. 1.9.0-Alpha4 connects, but after 30 seconds still no grbl welcome message in the console. I pressed the Arduino reset button and instantly the welcome message appears and everything is working. Now to 1.9.0-RC6, the same result as 1.9.0-Alpha4. I have the press the Arduino reset button to get it to work. I have repeated these tests 3 times and set the same result. |
@cheton Just went back to 1.9.0-rc3 and the same result. I have the press the Arduino reset button to get the grbl welcome message, and after that it works OK. |
There is one change between 1.9.0-alpha.3 and 1.9.0-alpha.4. I added a mechanism to check if status (?) and parser state ($G) query has not been updated for a long time, it will automatically send 1.9.0-alpha.3 1.9.0-alpha.4 I looked back to your logs, this was activated by 5~6 seconds after connecting to Grbl, so I didn't think this issue might be related to the change.
Otherwise, I didn't find any significant change to the Grbl controller regarding serial communication part. I think this should have no problems on RPi, you can try npm installation later once you have time. Sorry for that currently I don't have any ideas on that. Do you have any other Windows, Mac, or Arduino boards other than Arduino Mega for testing? Use a shielded USB cable might be worth a try (see #133 (comment)). If your Arduino wasn't re-flashed with the latest firmware, you can try https://github.com/grbl/grbl/wiki/Known-Bugs#usb-to-serial-transmission-errors, and check if it can resolve your problems. |
@cheton I haven't experienced any serial transmission problems in the past and I have sent some very large files. You will probably recall I raised the issue with large files on the Raspberry Pi which is now working perfectly. I have installed V1.9.0 and still experiencing the same problem, I have to press the reset button on the Arduino before it starts working. I downgraded back to Alpha 3, and I have no problems with either the UNO or the MEGA board. There must be some small change in Alpha 4 that is affecting this. It's easy enough to work around, but still something to look into. I have also check and both my UNO and my MEGA and running the same CH340 USB/Serial chip. |
Good news! I got an Arduino MEGA and flashed with https://github.com/gnea/grbl-Mega, now I can reproduce this issue. It took me about 7~10 seconds to see the welcome message with Alpha 3, but nothing returned since Alpha 4, unless I press the hardware reset button. I will try to find out what went wrong. |
Just figured out the difference between Grbl and Grbl-Mega. In the initController function, it set the "ready" flag with a delay of 500ms right after a serial connection is established. For example: setTimeout(() => {
this.ready = true;
}, 500); Once the "ready" flag is set to true, the controller will continuously send However, the Grbl startup message might delay around 900ms after establishing a serial connection. If I repeatedly sending status query ( Grbl (Uno and Nano)
Grbl Mega (Mega 2560)
|
@cheton I can reproduce your results with 1.8.14. If I keep sending '?' before the welcome, the welcome never appears, until I stop for about 7 seconds. I think the mega bootloader might be slower than the uno bootloader and it is reseting when it received the command, which is not a valid bootloader command, so it never starts the grbl firmware. However, the bootloader senses when reset via the reset button and starts the grbl firmware immediately without waiting. |
Hi @chamnit In my current implementation, it will send status query ( From my testing, these repeated commands will not cause problems to Grbl, but it did block Grbl-Mega to display start up message with a certain amount of time (e.g. 9 seconds or more). Is it related to the bootloader of an Arduino Mega 2560? Thanks! |
I can confirm that it's fixed in e24a44c, I will inform you when a new build is ready. |
@cheton : Not sure what's causing a delay of 9 seconds or more. The arduino boot loader is usually no more than two or three seconds. |
@cheton I have installed V1.9.1 and tested it a dozen times. Worked flawlessly everything. Thanks for your persistence with this problem. It looks like your solved it. |
Once a serial connection has established, a gcode sender should wait the bootloader to complete before sending any status query commands. Giving 1 second for Smoothie and TinyG boards seems to be enough. For Grbl running on an Arduino board, I modified the code to wait until a Grbl start up message has received. It should resolve the timing issue in 1.9.0 and all earlier versions. |
I have been using cncjs V1.8.14 on my Raspberry pi without any problems. I thought I'd try V1.9.0 RC on my Windows PC and found a problems connecting to my GRBL-Mega V1.1e. I can select the port and baud rate is correct, but when I connect, it says it is connected by nothing works. The Status Reports, Modal Groups and Queue Reports are all blank. If I try to execute a command or jog, nothing happens. If I load a gcode program and run it, it starts, but stops after a few lines have been sent.
So I rolled back to V1.8.14 on my Windows PC and found everything is working correctly. Status Reports, Modal Groups and Queue Reports and all showing the correct data and I can see the serial buffer bouncing around a little as status messages are being sent.
I went back to V1.9.0 RC2 and the same problem. I also have the same problem with V1.9.0 RC1. So it seems my Board is working with V1.8.14 on Windows and my Raspberry Pi, but not on V1.9.0 RC1 or RC2 on Windows. I will try V1.9.0 RC2 on my Raspberry pi soon, but want to backup my existing working setup before I try it.
Is anyone else seeing a problem like this?
The text was updated successfully, but these errors were encountered: