lukevp / ESC-POS-.NET

Efficient, Easy to Use Thermal Printing & POS (Windows/Linux/OSX, WiFi/BT/USB/Ethernet)
MIT License
523 stars 171 forks source link

USB not working #220

Open danielegithub opened 1 year ago

danielegithub commented 1 year ago

Hi everyone. Has anyone encountered the same error?

public SerialPrinter Printer { get; set; }

    public PosCommand()
    {
        this.Printer = new SerialPrinter(portName: "USB0001", baudRate: 115200);
    }

and have exception "The given port name (USB001) does not resolve to a valid serial port. (Parameter Portname).

My ports is configured as "Port: USB001" and Description "Virtual printer port for USB".

Thank

lukevp commented 1 year ago

This library uses System.Io.Ports. That exception is probably being thrown by the MS library. Normally the virtual COM ports are mapped to the normal serial port names (like COM6 or something). Does your virtual port driver support that?