0
votes

I'm trying to use node-thermal-printer (https://github.com/Klemen1337/node-thermal-printer/) to connect with ZPL Printer (https://chrome.google.com/webstore/detail/zpl-printer/phoidlklenidapnijkabnfdgmadlcmjo).

When I run the ZPL Printer, I can successfully access the printer via URL browser in the following address: (http://localhost:9100/)

My Javascript code to connect with the printer using the node-thermal-printer is:

printer.init({
      type: "epson",                    
      interface: "/dev/usb/lp0",       // Linux interface
      ip: "localhost",                // Ethernet printing IP
      port: "9100"                   // Ethernet printing PORT
});

printer.isPrinterConnected( function(isConnected){ 
    console.log(isConnected);
}); 

Running this, I have a false connected.

In the IP address I also already tried: http://127.0.0.1/ and port: 9100, but it doesn't work.

Please someone help-me.

Sorry for my bad english.

1

1 Answers

0
votes

If your printer is network try the following :

printer.init({
  type: 'epson',
  interface: 'tcp://yourip:9100',

});

replace yourip with your printer ip