0
votes

I have connected EPSON TM-T81 thermal printer to router through Ethernet cable and gave one ip address i.e. 192.168.1.12 and

I have a site which is hosted on amazon server and I want to make receipt printing over the web directly.

I am using the below library for printing.

You can check below diagram how it will works

enter image description here

https://github.com/mike42/escpos-php

If I am testing from localhost than I can found the printer and printing works fine but when I try to print from site it shows me below error

<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at 
 [no address given] to inform them of the time this error occurred,
 and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>

From my debug i found that it can not find the printer so it can't make the socket object.

Do I need to setup anything on amazon ?

Client PC is running on windows 8 and I have installed epson driver in that.

1
If you're trying to connect to 192.168.1.12 over the internet - that won't work, all 192.168.x.x addresses are Private, and can only route in the same local network. - ahoffner

1 Answers

0
votes

Your thermal printer is behind router so you need to forward network packet from Internet to this printer. If your router is quite advanced then you can set firewall rule to match network packet from/to this printer and forward it. If you use SOHO router see with your router documentation if they support port forwarding. I think you will get more response if you asked them in ServerFault. StackOverflow is about programming QA