Skip to content

Make driver reentrant #153

@nospam2k

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]

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