Open ratxrat opened 5 years ago
On which OS are you Linux or Windows ?
accidentially closed, hope you see it again as open
i use windows os
I see source code use power sheel righ? Maybe my powersell restricted couse not detect printer
i just try to run command and this is result
Location : Name : XP-80 PrinterState : 0 PrinterStatus : 3 ShareName : SystemName : ABUAZKA-PC
Location : Name : XP-58 (copy 1) PrinterState : 0 PrinterStatus : 3 ShareName : SystemName : ABUAZKA-PC
Location : Name : XP-58 PrinterState : 1030 PrinterStatus : 1 ShareName : SystemName : ABUAZKA-PC
Location : Name : Microsoft XPS Document Writer PrinterState : 0 PrinterStatus : 3 ShareName : SystemName : ABUAZKA-PC
Location : Name : Fax PrinterState : 0 PrinterStatus : 3 ShareName : SystemName : ABUAZKA-PC
Location : Name : EPSON L360 Series PrinterState : 0 PrinterStatus : 3 ShareName : SystemName : ABUAZKA-PC
in this line "if (listResultLines[d].indexOf("ShareName")>-1) "
look all ny printer cannot have ShareName
SOLVE :)
Just Sharing printer and set share name all work
Ok thats the way it works, BTW may i ask what you are using it for ( type of app /field of use liek cash register etc )
i create electron app for windows and use star printer, but cash drawer cannot open maybe you can help me for cash drawer
Actually it is in the source with comment: // a pulse of 25 ms worked quite fine with my cash drawer so i set it as default PULSE_PIN2_DEFAULT: new Buffer('1B70001919','hex').toString('utf8'), PULSE_PIN5_DEFAULT: new Buffer('1B70011919','hex').toString('utf8'), PULSE: function(pin,ontime,offtime){ if (pin==2){ var pinHexString = '00'; }else{ var pinHexString = '01'; } var command = new Buffer('1B70'+pinHexString+("00"+ontime.toString(16)).slice(-2)+("00"+offtime.toString(16)).slice(-2),'hex').toString('utf8'); return command; }
In my app i simply call it like this: Printer.append(Printer.ESCPOS_CMD.PULSE_PIN2_DEFAULT);
ok thanks i will try later dude :+1:
thanks work for cash drawer
work with usb star termal printer but if i use serial printer epson cannot detect printer on array