Node.js: Not able to connect UPOS fiscal printer using TCP/IP

343 views Asked by At

I've connected Exorigo UPOS fiscal printer(model: FPT88FVA) to router using Ethernet cable and want to connect the printer over wifi using TCP/IP protocol from my device, so I've written the below code in Node.js. I've used net module to create tcp client and tried to make connection with printer, but it's not working (doesn't print connected message on console). Not getting any error or response. may be I'm missing something, I tried other ways too but no luck.

Can someone please provide a suggestion what to look for?

var net = require('net');

// ESC MFB O ESC MFE
// 0x1B 0x80 0x4F 0x1B 0x83

var client = new net.Socket();

client.connect(6090, '192.168.029.203', function() {
    console.log('Connected');
    client.write('0x1B 0x80 0x4F 0x1B 0x83');
});

client.on('data', function(data) {
    console.log('Received: ' + data);
    client.destroy(); // kill client after server's response
});

client.on('close', function() {
    console.log('Connection closed');
});
0

There are 0 answers