Skip to content
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

Serial connection unstable on RaspberryPI #1213

Closed
breiler opened this issue Apr 13, 2019 · 12 comments
Closed

Serial connection unstable on RaspberryPI #1213

breiler opened this issue Apr 13, 2019 · 12 comments
Labels

Comments

@breiler
Copy link
Collaborator

breiler commented Apr 13, 2019

The new default connection driver jSerialComm does not work on ARM-based processors like on the RaspberryPI or Asus TinkerBoard. The connection can be established to GRBL but fails intermittently.

We are using an old version of jSerialComm which might be the cause. But upgrading the library can't be done due to this netbeans-plugin-module issue:
mojohaus/nbm-maven-plugin#42

Tried building a snapshot version of the nbm-maven-plugin (nbm-maven-plugin-4.2-SNAPSHOT) which now lets me build with the latest jSerialComm library.

We need to wait until Apache Incubation process of netbeans is ready and has packaged a new version (looking forward to using your work @ebarboni): https://github.com/apache/incubator-netbeans-mavenutils/

In the meantime you can switch to JSSC-driver on RaspberryPI which works reliable: https://github.com/winder/Universal-G-Code-Sender/wiki/Raspberry-Pi

@breiler breiler added the bug label Apr 13, 2019
@winder
Copy link
Owner

winder commented Apr 20, 2019

Looks like we should be able to upgrade netbeans platform soon! Netbeans has been accepted to Apache, I think they’re still working on a press release but it’s been announced on the public mailing list:
http://mail-archives.apache.org/mod_mbox/netbeans-dev/201904.mbox/%3CCACkjAxS-fCp9mbr435QaZacbzKWpgfGgMdt0tCknUK4HOow4Hg@mail.gmail.com%3E

One of the last steps was getting the netbeans domain, which must be complete since they’re already staging artifacts
http://mail-archives.apache.org/mod_mbox/netbeans-dev/201904.mbox/%[email protected]%3E

@breiler
Copy link
Collaborator Author

breiler commented May 9, 2019

It seems that the new netbeans libraries are available on maven central. It might be possible to upgrade to the latest platform. I would like to give this a try later this week.

@mike-pittelko
Copy link

Any progress on this?

@breiler
Copy link
Collaborator Author

breiler commented Oct 3, 2019

I made a search a couple of weeks ago and couldn't find the new version for building NBM-modules. Made a quick search for it now and found the new version which seems to have the required fix: https://mvnrepository.com/artifact/org.apache.netbeans.utilities/nbm-maven-plugin/4.2

I'll give it a go and try to update it.

@jes
Copy link

jes commented Nov 11, 2020

Possibly related to this: I have found spurious disconnections using JSerialComm which went away when I switched to JSSC, and I'm not using an ARM board, it's a normal x86_64 laptop (Thinkpad X200).

@breiler
Copy link
Collaborator Author

breiler commented Nov 11, 2020

If the JSerialComm driver doesn't work properly on Linux, should we consider making JSSC the default?

@jes We have had far more problems with JSSC than JSerialComm (especially in Windows) so I rather not make it default again, you can search for issues containing "JSSC" in project.

The JSSC project looks abandoned, but there is a fork that seems to have active development which we could give a try: https://github.com/java-native/jssc

@jes
Copy link

jes commented Nov 11, 2020

Fair enough. I wonder if it would be easy to have a separate default for Windows vs Linux?

It doesn't make much difference to me now as I now know what the problem is, but I can't be the only person who has spent days trying to debug an apparent EMI problem only to find out it is a broken serial library.

@breiler
Copy link
Collaborator Author

breiler commented Nov 11, 2020

Sure, we can try to add that. I have not had any problems on my Linux instance with JSerialComm so I hope we don't introduce other problems... =/

So the default library to use should be according to the following:
Linux - JSSC
Windows - JSerialComm
MacOSX - JSerialComm

@jes
Copy link

jes commented Nov 11, 2020

In case it helps, here's a simple test case that I find reliably fails with JSerialComm and passes with JSSC:

  • reduce Grbl's baud rate to 9600 (BAUD_RATE in grbl/config.h)
  • make a G-code file that just rapidly moves to (0,0), (0,2), (2,2), (2,0), and back, over and over again
  • send the file using UGS. It will go offline within 5 seconds

You don't even need to be connected to a CNC machine, just running Grbl on an Arduino with no hardware connected.

(This is the fastest test case I found to differentiate between the "working" and "failing" condition - in practice, even at 115200 baud, I also find that JSSC can run real-life jobs for hours on end with no problems, and JSerialComm disconnects about once every hour or two - I have not yet had a single disconnection with JSSC).

@breiler
Copy link
Collaborator Author

breiler commented Nov 11, 2020

Excellent thanks!

@jes
Copy link

jes commented Nov 11, 2020

Thank you!!

@breiler
Copy link
Collaborator Author

breiler commented Dec 5, 2020

I'm closing this as it is the best we can do right now.

@breiler breiler closed this as completed Dec 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants