Skip to content

Make driver reentrant #153

Description

@nospam2k

I'm trying to figure out how to move this into node-red and I need to figure out how I can close the serial port when node-red reloads. I'm down to, in the driver (this case is enttec-open-usb-dmx):

 this.dev = new SerialPort(deviceId, {
    'baudRate': 250000,
    'dataBits': 8,
    'stopBits': 2,
    'parity': 'none',
  }, err => {
    if (!err) {
      this.start();
    } else {
      console.warn(err);
    }
  });

I get err, but I can't figure out how to close the serial port from the previous open.

[Error: Error Resource temporarily unavailable Cannot lock port]

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

      Issue actions