firmata4j icon indicating copy to clipboard operation
firmata4j copied to clipboard

Cannot start the firmata device because the port is 'busy' stack trace

Open minecraftswingman opened this issue 2 years ago • 1 comments

i keep getting error this stack trace to be exact java.io.IOException: Cannot start firmata device java.io.IOException: Cannot start firmata devi Caused by: jssc.SerialPortException: Port name - /dev/tty.usbmodem14501; Method name - openPort(); Exception type - Port busy.

heres my code ` if (device == null) { try { device = new FirmataDevice(COM_PORT); device.start(); device.ensureInitializationIsDone();

            //initialize pin (just like how you initialize in Arduino IDE)
            BUTTON_UP = device.getPin(2);
            BUTTON_RIGHT = device.getPin(3);
            BUTTON_DOWN = device.getPin(4);
            BUTTON_LEFT = device.getPin(5);
            BUTTON_E = device.getPin(6);
            BUTTON_F = device.getPin(7);
            Pin[] Buttonpins = {BUTTON_DOWN, BUTTON_LEFT, BUTTON_RIGHT, BUTTON_UP, BUTTON_E, BUTTON_F, JOYSTICK_BUTTON};
            for (Pin pin : Buttonpins){
                pin.setMode(Pin.Mode.INPUT);
            }


        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
    } 

minecraftswingman avatar May 31 '22 22:05 minecraftswingman

and i am also getting a error Cannot invoke "org.firmata4j.Pin.setMode(org.firmata4j.Pin$Mode)" because "pin" is null how is pin null when i initialized in the code above

minecraftswingman avatar Jun 01 '22 17:06 minecraftswingman