Skip to content

need to initialize twice to discover Aroma Shooter #3

@danielle-h

Description

@danielle-h

Using Raspberry pi running Linux 10 (buster).

output of java -version:

openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment (build 11.0.12+7-post-Raspbian-2deb10u1)
OpenJDK Server VM (build 11.0.12+7-post-Raspbian-2deb10u1, mixed mode)
 private static USBASController initAromajoin() {
    USBASController usbController = new USBASController();
    usbController.scanAndConnect();
    if (!usbController.getConnectedDevices().isEmpty()) {
      for (AromaShooter aromaShooter : usbController.getConnectedDevices()) {
        System.out.println("Connected to AromaShooter: " + aromaShooter.getSerial());
      }
    }
    return usbController;
  }

This code never discovers the Aroma shooter in the first time. It always needs to be called twice.

Output first time: (see issue #2)

com.fazecast.jSerialComm.SerialPortTimeoutException: The write operation timed out before all data was written.
        at com.fazecast.jSerialComm.SerialPort$SerialPortOutputStream.write(SerialPort.java:1470)
        at com.fazecast.jSerialComm.SerialPort$SerialPortOutputStream.write(SerialPort.java:1449)
        at com.aromajoin.sdk.jvm.SerialReader.query(SerialReader.java:33)
        at com.aromajoin.sdk.jvm.usb.USBASController.scanAndConnect(USBASController.java:74)
        at worg.weizmann.App.initAromajoin(App.java:107)
        at worg.weizmann.App.main(App.java:27)

Output second time:

com.fazecast.jSerialComm.SerialPortTimeoutException: The write operation timed out before all data was written.
        at com.fazecast.jSerialComm.SerialPort$SerialPortOutputStream.write(SerialPort.java:1470)
        at com.fazecast.jSerialComm.SerialPort$SerialPortOutputStream.write(SerialPort.java:1449)
        at com.aromajoin.sdk.jvm.SerialReader.query(SerialReader.java:33)
        at com.aromajoin.sdk.jvm.usb.USBASController.scanAndConnect(USBASController.java:74)
        at worg.weizmann.App.initAromajoin(App.java:107)
        at worg.weizmann.App.main(App.java:27)
Connected to AromaShooter: ASN2A00306

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @danielle-h

        Issue actions

          need to initialize twice to discover Aroma Shooter · Issue #3 · aromajoin/controller-sdk-java