I have deployed my Laravel App to AWS and using NGINX server. I want to print some receipts from server to the local printers. I am using this package mike42/escpos-php.
and here is my code
try {
$connector = new Mike42EscposPrintConnectorsWindowsPrintConnector("POS-80C");
/* Print a "Hello world" receipt" */
$printer = new Mike42EscposPrinter($connector);
$printer -> text("Hello World!n");
$printer -> cut();
/* Close printer */
$printer -> close();
} catch (Exception $e) {
echo "Couldn't print to this printer: " . $e -> getMessage() . "n";
}```
I have enabled sharing of this printer *POS-80C* from windows.
But whenever I try to print, I rceived this error.
Command "smbclient '//ip-172-31-43-229/POS-80C' -c 'print -' -N -m SMB2" failed with exit code 1: do_connect: Connection to ip-172-31-43-229 failed (Error NT_STATUS_CONNECTION_REFUSED)
Here *ip-172-31-43-229* is IP of server on AWS.
*smbclient* is working fine on nginx. What can be the issue?