0
private static void initProgram() {
    System.out.println("fdsf");

    //Must start by setting up the COM port to identify where the arduino is. 
    portList = CommPortIdentifier.getPortIdentifiers();

    while (portList.hasMoreElements()) {
        System.out.println("gggg");
        portId = (CommPortIdentifier) portList.nextElement();
        if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) {
            System.out.println(portId.getName());

            if (portId.getName().equals("/dev/ttyACM0")) {
                //SimpleRead reader = new SimpleRead();
            }
        }
    }

    System.out.println("fdsfsssssssss");
}

I'm running 64 bit linux with java 7 (openjdk) and have the problem in a simple application whereby the program compiles and runs, but never prints "gggg", i.e. never gets to enumerating the COM ports.

I've added myself to the dialout group, and downloaded the RXTX libraries from here - http://www.cloudhopper.com/opensource/rxtx/ - and put them in the appropriate folders. I just don't know what I need to do to get it to find any serial ports.

EDIT: Just thought I should mention that I have already tried, in my command prompt, executing sudo apt-get install librxtx-java, which hasn't appeared to have helped.

dsolimano
  • 8,870
  • 3
  • 48
  • 63

0 Answers0