Printer not working

Hello, I’m trying to connect my thermal printer so that I can print receipt.

I’m using Mike42/ESC-POS PHP Library which allows me to print from website to my local printer. I know my hosting website can’t access my local printer. That’s why I’m trying to use services.

I’ve added my services the same as my printer IP address,, and port 9100 using TCP and also HTTP.

If I access the remote endpoint with TCP on my local machine I get random printer error, I don’t know it’s just weird symbol. And If I accessed the IP with HTTP it will come as the printer admin page. Things started going down from here, if I try to print in my hosting server, the PHP came out as an error 500, and when I check the logs it gave me this:

PHP Fatal error: Uncaught Exception: Cannot initialise NetworkPrintConnector: Connection refused in /home/bowboxpr/public_html/vendor/mike42/escpos-php/src/Mike42/Escpos/PrintConnectors/NetworkPrintConnector.php:40
Stack trace:

It says that the connection is refused. I’m kinda at a dead end here. Maybe I setup my printer wrong?

I assume your using the desktop? here is what I do:

So now that’s my target printer service, now when I connect:

So you can telnet into that to test :
telnet 33002

Once it connects I should be able to type
test 1234
press ^]
then type quit, the printer should print “test 1234”

now you have verified your connection.

Note that endpoint only exists on the machine that has the desktop running. But it should stay available until you remove it.

Also see this for testing: