Unable to read printer status using Node ESC-POS Star BSC10UD

24 Views Asked by At

Hi Im writing a small small script in my electron app that gets the status of the printer using DLE EOT based on this documentation https://starmicronics.com/support/download/star-esc-pos-mode-command-specifications/ , Im also using node escpos https://github.com/song940/node-escpos

Following this post Epson thermal printer status from NodeJS with ESC/POS , I was able to send a DLE EOT however it doesnt log a buffer

Here is the code snippet from

const device = new escpos.USB("0x0519", "0x000B");
const printer = new escpos.Printer(device);
const _ = require('escpos/commands');

device.open(function () {
  device.on('data', function(response) {
     console.log(data);
     console.log(data.toString('hex'));
  });

   device.write(_.DLE);
   device.write(_.EOT);
   device.write(String.fromCharCode(1));

   setTimeout(() => {
     printer.close();
   }, 1000)
}) 

Im using a different printer on this with the model of BSC10UD

0

There are 0 best solutions below