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

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

Open
minecraftswingman opened this issue May 31, 2022 · 1 comment

Comments

@minecraftswingman
Copy link

minecraftswingman commented May 31, 2022

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 minecraftswingman changed the title Cannot start the firmata device stack trace Cannot start the firmata device because the port is 'busy' stack trace May 31, 2022
@minecraftswingman
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant