Sammy1Am / MoppyClassic

Moppy has been replaced with Moppy 2.0!
568 stars 190 forks source link

No ports in dropdown menu #83

Closed RobisLV closed 9 years ago

RobisLV commented 9 years ago

Hello! I tried to connect my arduino to moppy but when I run it in NetBeans the dropdown menu does not display any ports. I installed RXTXcomm as instructed: RXTXcomm.jar to jdk_1.7.0_71/jre/lib/ext librxtxSerial.so to jdk_1.7.0_71/jre/lib/amd64 I have set up file permisions and user groups. I am using Ubuntu 14.04 64-bit, Netbeans 8.0.2. I tied both advannced and non-advanced Moppy. Any ideas?

Sammy1Am commented 9 years ago

Stick with Moppy Advanced; it's slightly more up to date so you've got a better chance there.

RobisLV commented 9 years ago

I get warning during compilation: warning: [options] bootstrap class path not set in conjunction with -source 1.5 Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 warning

Then I recompiled with -Xlint unchecked: warning: [options] bootstrap class path not set in conjunction with -source 1.5 /home/robis/Source/Moppy-moppy-advanced/Java/MoppyDesk/src/moppydesk/outputs/MoppyCOMBridge.java:113: warning: [unchecked] unchecked conversion Enumeration comPorts = CommPortIdentifier.getPortIdentifiers(); required: Enumeration found: Enumeration /home/robis/Source/Moppy-moppy-advanced/Java/MoppyDesk/src/moppydesk/testing/MoppyFloppySim.java:51: warning: [unchecked] unchecked conversion Enumeration comPorts = CommPortIdentifier.getPortIdentifiers(); required: Enumeration found: Enumeration 3 warnings

Other than opening project, compilation and running is without warnings. I removed RXTXcomm.jar from "Project" menu and added the one in jdk_1.7.0_71/jre/lib/ext. I also removed RXTXcomm.jar from "Files" menu. Still not luck.

Edit: I tried deleting .jar and .so files from jdk_1.7.0_71/jre/.. and copilation failed. So it appearsh that files are referenced correctly. Question: Does Moppy should display all ports (like usb-serial transceivers, if any are available) or only arduino?

Sammy1Am commented 9 years ago

It should be displaying all your serial ports regardless of if anything is connected to them or not (I think). The unchecked conversion warnings seem weird since a) I haven't seen those before, and b) it says it was expecting an Enumeration and found an Enumeration =P.

I know this isn't a terribly reliable solution, but if you manually installed RXTX, try removing the jar and so files that you installed, and use your package manager of choice to install the library instead. I think it's librxtx-java. In theory, I don't think you need to reference it specifically in NetBeans since apt-get will make sure Java can find it.

RobisLV commented 9 years ago

I deleted the files and installed librxtx-java from repo. Now I get error when running: run: java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886) at java.lang.Runtime.loadLibrary0(Runtime.java:849) at java.lang.System.loadLibrary(System.java:1088) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:123) at moppydesk.outputs.MoppyCOMBridge.getAvailableCOMPorts(MoppyCOMBridge.java:113) at moppydesk.ui.ChannelOutControl.initComponents(ChannelOutControl.java:123) at moppydesk.ui.ChannelOutControl.(ChannelOutControl.java:31) at moppydesk.ui.MoppyControlWindow.setupOutputControls(MoppyControlWindow.java:77) at moppydesk.ui.MoppyControlWindow.(MoppyControlWindow.java:58) at moppydesk.MoppyUI.startup(MoppyUI.java:50) at org.jdesktop.application.Application$1.run(Application.java:171) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:703) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

RobisLV commented 9 years ago

Solved it! I aded RXTXcomm.jar (from /usr/share/java) in project and added -Djava.library.path="/usr/lib/jni/" to the VM options in project properties. Found solution here: http://ubuntuforums.org/showthread.php?t=1747382

Thank you very much for your help :)

Sammy1Am commented 9 years ago

Glad you got it working!