public static String find() {
        String portName = "";
        PyramidPort port;
        Courier courier;
        RS232Socket socket = new RS232Socket();

        // Get all currently available ports
        String[] availablePorts = PyramidPort.getPortList();

        for (String p : availablePorts) {

            try {
                port = new PyramidPort.PortBuilder(p).build();
                RS232Configuration.INSTANCE.setPollrate(100);
                courier = new Courier(port, socket);
                courier.start();

                // Wait for 10 polls before querying comm status
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException ex) {
                }

                if (courier.getCommsOkay()) {
                    portName = p;
                }

                courier.stopThread();
                port.closePort();

            } catch (PyramidDeviceException ex) {
                logger.error("Unable to open port: {} -> {}", p, ex);
            }

            // Stop when we find a port
            if (!portName.equals("")) {
                break;
            }
        }

        return portName;
    }