title: ESC/POS Epson TM-T20 Status with PHP
body: <p>I have a Epson TM-T20 (only Ethernet Interface) and I need some Help to get a Status of the Printer via PHP.
  For Printing I use this <a href="https://github.com/mike42/escpos-php" rel="nofollow">Script</a>.
  For getting the Status I tried the following Code:</p>
  
  <pre><code>&lt;?php
  
  $fp = fsockopen ('10.1.10.2, 9100');     //Open a Connection
  frwrite($fp, chr(16).chr(4).chr(4));     //POS Command "DLE EOT n" Status Transmission
  $stat = fgets($fp);                      //Get the Status
  fclose($fp);                             //Close Connection
  $bit = ord($stat);                       //Get Integer
  echo $bit;                               //A this Point I get only "0"
  
  ?&gt;
  </code></pre>
  
  <p>I use a Windows 7 System with XAMPP as a lab environment.</p>
  
  <p>Thanks for your Help.</p>
  
  <p>P.S.: Sorry for my Language but I am not a native speaker.</p>